23 changed files with 421 additions and 55 deletions
-
BINassets/images/sample_avatar.png
-
3assets/svg/icon_location.svg
-
4assets/svg/icon_logout.svg
-
3lib/common_ui/resources/my_assets.dart
-
4lib/core/routers/my_routes.dart
-
25lib/core/widgets/background/my_background.dart
-
45lib/core/widgets/button/my_gradient_button.dart
-
27lib/core/widgets/container/gradient_container.dart
-
91lib/core/widgets/input/my_input.dart
-
6lib/features/home/presentation/pages/home_page.dart
-
2lib/features/home/presentation/pages/widgets/home_battle_cast.dart
-
2lib/features/home/presentation/pages/widgets/home_battle_league.dart
-
3lib/features/home/presentation/pages/widgets/home_membership.dart
-
2lib/features/intro/presentation/ui/intro_page.dart
-
3lib/features/master/presentation/ui/master_page.dart
-
56lib/features/profile/presentation/ui/profile_page.dart
-
21lib/features/profile/presentation/ui/widgets/profile_avatar.dart
-
39lib/features/profile/presentation/ui/widgets/profile_delete_account.dart
-
20lib/features/profile/presentation/ui/widgets/profile_location.dart
-
38lib/features/profile/presentation/ui/widgets/profile_logout.dart
-
4lib/l10n/app_en.arb
-
12lib/l10n/app_localizations.dart
-
6lib/l10n/app_localizations_en.dart
|
After Width: 106 | Height: 106 | Size: 17 KiB |
@ -0,0 +1,3 @@ |
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|||
<path d="M4.95833 7.79167C4.95833 6.22625 6.22625 4.95833 7.79167 4.95833C9.35708 4.95833 10.625 6.22625 10.625 7.79167C10.625 9.35708 9.35708 10.625 7.79167 10.625C6.22625 10.625 4.95833 9.35708 4.95833 7.79167ZM7.08333 14.1242C5.64692 13.9637 4.30776 13.3196 3.28574 12.2976C2.26373 11.2756 1.61961 9.93641 1.45917 8.5H0.708333C0.31875 8.5 0 8.18125 0 7.79167C0 7.40208 0.31875 7.08333 0.708333 7.08333H1.45917C1.61961 5.64692 2.26373 4.30776 3.28574 3.28574C4.30776 2.26373 5.64692 1.61961 7.08333 1.45917V0.708333C7.08333 0.31875 7.40208 0 7.79167 0C8.18125 0 8.5 0.31875 8.5 0.708333V1.45917C9.93641 1.61961 11.2756 2.26373 12.2976 3.28574C13.3196 4.30776 13.9637 5.64692 14.1242 7.08333H14.875C15.2646 7.08333 15.5833 7.40208 15.5833 7.79167C15.5833 8.18125 15.2646 8.5 14.875 8.5H14.1242C13.9637 9.93641 13.3196 11.2756 12.2976 12.2976C11.2756 13.3196 9.93641 13.9637 8.5 14.1242V14.875C8.5 15.2646 8.18125 15.5833 7.79167 15.5833C7.40208 15.5833 7.08333 15.2646 7.08333 14.875V14.1242ZM12.75 7.79167C12.75 5.05042 10.5329 2.83333 7.79167 2.83333C5.05042 2.83333 2.83333 5.05042 2.83333 7.79167C2.83333 10.5329 5.05042 12.75 7.79167 12.75C10.5329 12.75 12.75 10.5329 12.75 7.79167Z" fill="white"/> |
|||
</svg> |
|||
@ -0,0 +1,4 @@ |
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|||
<path d="M5 2H16C16.7956 2 17.5587 2.31607 18.1213 2.87868C18.6839 3.44129 19 4.20435 19 5V19C19 19.2652 18.8946 19.5196 18.7071 19.7071C18.5196 19.8946 18.2652 20 18 20H15" stroke="#F6F6F6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
|||
<path d="M12 12V14M5 2L12.588 3.518C13.268 3.65392 13.8799 4.02121 14.3197 4.55739C14.7594 5.09358 14.9998 5.76555 15 6.459V20.78C14.9999 20.9279 14.967 21.0739 14.9037 21.2076C14.8404 21.3412 14.7482 21.4592 14.6338 21.5529C14.5194 21.6466 14.3856 21.7138 14.2422 21.7496C14.0987 21.7854 13.949 21.789 13.804 21.76L6.608 20.322C6.15444 20.2313 5.74633 19.9863 5.45314 19.6286C5.15995 19.2708 4.99982 18.8225 5 18.36V2Z" stroke="#F6F6F6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/> |
|||
</svg> |
|||
@ -0,0 +1,25 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|||
import 'package:shia_game_flutter/common_ui/theme/my_theme.dart'; |
|||
|
|||
class MyBackground extends StatelessWidget { |
|||
const MyBackground({super.key, required this.child}); |
|||
|
|||
final Widget child; |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Container( |
|||
decoration: BoxDecoration( |
|||
gradient: RadialGradient( |
|||
radius: 0.6, |
|||
colors: [const Color(0xFF321A6D), context.backgroundColor], |
|||
), |
|||
), |
|||
child: SingleChildScrollView( |
|||
padding: EdgeInsets.symmetric(horizontal: MySpaces.s30), |
|||
child: child, |
|||
), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/container/gradient_container.dart'; |
|||
|
|||
class MyGradientButton extends StatelessWidget { |
|||
const MyGradientButton({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return GradientContainer( |
|||
height: 32, |
|||
width: 116, |
|||
onTap: () {}, |
|||
borderColor: Color(0XFF6D2ADA), |
|||
borderRadius: BorderRadius.all(Radius.circular(5)), |
|||
gradient: LinearGradient( |
|||
begin: AlignmentDirectional.topStart, |
|||
end: AlignmentDirectional.bottomEnd, |
|||
colors: [Color(0XFF823FEB), Color(0XFF4F09BF)], |
|||
), |
|||
child: ShaderMask( |
|||
blendMode: BlendMode.modulate, |
|||
shaderCallback: (bounds) => LinearGradient( |
|||
begin: Alignment.topCenter, |
|||
end: Alignment.bottomCenter, |
|||
colors: [Color(0XFFFFFFFF), Color(0XFFFFFFFF), Color(0XFF9C8CC2)], |
|||
).createShader(bounds), |
|||
child: Text( |
|||
'Change Profile', |
|||
style: Lexend.extraBold.copyWith( |
|||
fontSize: 12, |
|||
shadows: [ |
|||
BoxShadow( |
|||
color: Color(0xFF1B0D31), |
|||
blurRadius: 0, |
|||
offset: Offset(0, 1.69), |
|||
spreadRadius: 0, |
|||
), |
|||
], |
|||
), |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; |
|||
import 'package:shia_game_flutter/common_ui/theme/my_theme.dart'; |
|||
|
|||
class MyInput extends StatelessWidget { |
|||
const MyInput({ |
|||
super.key, |
|||
this.labelText, |
|||
this.hintText, |
|||
this.controller, |
|||
this.obscureText, |
|||
this.keyboardType, |
|||
this.action, |
|||
this.validator, |
|||
this.onChanged, |
|||
this.onTap, |
|||
this.onEditingComplete, |
|||
this.onTapOutside, |
|||
this.enabled, |
|||
this.readOnly, |
|||
this.maxLines, |
|||
this.minLines, |
|||
}); |
|||
|
|||
final String? labelText; |
|||
final String? hintText; |
|||
final TextEditingController? controller; |
|||
final bool? obscureText; |
|||
final TextInputType? keyboardType; |
|||
final TextInputAction? action; |
|||
final String? Function(String?)? validator; |
|||
final void Function(String)? onChanged; |
|||
final void Function()? onTap; |
|||
final void Function()? onEditingComplete; |
|||
final void Function(PointerDownEvent)? onTapOutside; |
|||
final bool? enabled; |
|||
final bool? readOnly; |
|||
final int? maxLines; |
|||
final int? minLines; |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Column( |
|||
crossAxisAlignment: CrossAxisAlignment.start, |
|||
spacing: MySpaces.s8, |
|||
children: [ |
|||
if (labelText != null && labelText!.isNotEmpty) |
|||
Text( |
|||
labelText ?? '', |
|||
style: Lexend.bold.copyWith(fontSize: 12), |
|||
), |
|||
TextFormField( |
|||
controller: controller, |
|||
obscureText: obscureText ?? false, |
|||
keyboardType: keyboardType, |
|||
textInputAction: action, |
|||
validator: validator, |
|||
onChanged: onChanged, |
|||
onTap: onTap, |
|||
onEditingComplete: onEditingComplete, |
|||
enabled: enabled, |
|||
readOnly: readOnly ?? false, |
|||
maxLines: maxLines, |
|||
minLines: minLines, |
|||
style: Lexend.extraBold.copyWith(fontSize: 12), |
|||
cursorColor: context.primaryColor, |
|||
decoration: InputDecoration( |
|||
contentPadding: EdgeInsets.all(MySpaces.s14), |
|||
enabledBorder: OutlineInputBorder( |
|||
borderRadius: BorderRadius.all(Radius.circular(12)), |
|||
borderSide: BorderSide(color: Color(0XFF5715BF), width: 1), |
|||
), |
|||
focusedBorder: OutlineInputBorder( |
|||
borderRadius: BorderRadius.all(Radius.circular(12)), |
|||
borderSide: BorderSide(color: Color(0XFF5715BF), width: 1), |
|||
), |
|||
fillColor: Color(0XFF000000).withValues(alpha: 0.2), |
|||
filled: true, |
|||
hintText: hintText, |
|||
hintStyle: Lexend.extraBold.copyWith(fontSize: 12), |
|||
), |
|||
onTapOutside: (event) { |
|||
FocusManager.instance.primaryFocus?.unfocus(); |
|||
onTapOutside?.call(event); |
|||
}, |
|||
), |
|||
], |
|||
); |
|||
} |
|||
} |
|||
@ -1,14 +1,64 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/controller/profile_controller.dart'; |
|||
import 'package:get/get.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|||
import 'package:shia_game_flutter/core/utils/gap.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/background/my_background.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/button/my_gradient_button.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/input/my_input.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/controller/profile_controller.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/ui/widgets/profile_avatar.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/ui/widgets/profile_delete_account.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/ui/widgets/profile_location.dart'; |
|||
import 'package:shia_game_flutter/features/profile/presentation/ui/widgets/profile_logout.dart'; |
|||
|
|||
class ProfilePage extends GetView<ProfileController> { |
|||
const ProfilePage({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return const Center( |
|||
child: Text('Profile Page'), |
|||
return MyBackground( |
|||
child: Column( |
|||
children: [ |
|||
60.0.gapHeight, |
|||
ProfileAvatar(), |
|||
MyGradientButton(), |
|||
MySpaces.s40.gapHeight, |
|||
MyInput( |
|||
labelText: 'User Name', |
|||
hintText: 'Unknown123456', |
|||
), |
|||
MySpaces.s28.gapHeight, |
|||
_locationInput(), |
|||
200.0.gapHeight, |
|||
_bottomButtons(), |
|||
], |
|||
), |
|||
); |
|||
} |
|||
|
|||
Row _locationInput() { |
|||
return Row( |
|||
crossAxisAlignment: CrossAxisAlignment.end, |
|||
spacing: MySpaces.s10, |
|||
children: [ |
|||
Expanded( |
|||
child: MyInput( |
|||
labelText: 'Your Region', |
|||
hintText: 'Iran - Tehran', |
|||
), |
|||
), |
|||
ProfileLocation(), |
|||
], |
|||
); |
|||
} |
|||
|
|||
Row _bottomButtons() { |
|||
return Row( |
|||
spacing: MySpaces.s20, |
|||
children: [ |
|||
Expanded(child: ProfileDeleteAccount()), |
|||
Expanded(child: ProfileLogout()), |
|||
], |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart'; |
|||
import 'package:shia_game_flutter/common_ui/theme/my_theme.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; |
|||
|
|||
class ProfileAvatar extends StatelessWidget { |
|||
const ProfileAvatar({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return Container( |
|||
height: 106, |
|||
width: 106, |
|||
decoration: BoxDecoration( |
|||
shape: BoxShape.circle, |
|||
border: Border.all(width: 2.5, color: context.primaryColor), |
|||
), |
|||
child: MyImage(asset: MyAssets.sampleAvatar), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; |
|||
import 'package:shia_game_flutter/common_ui/theme/my_theme.dart'; |
|||
import 'package:shia_game_flutter/core/utils/my_localization.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/container/gradient_container.dart'; |
|||
|
|||
class ProfileDeleteAccount extends StatelessWidget { |
|||
const ProfileDeleteAccount({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return GradientContainer( |
|||
height: 58, |
|||
onTap: () {}, |
|||
borderRadius: BorderRadius.all(Radius.circular(MySpaces.s12)), |
|||
color: context.backgroundColor, |
|||
borderGradient: LinearGradient( |
|||
begin: AlignmentDirectional.centerStart, |
|||
end: AlignmentDirectional.centerEnd, |
|||
colors: [ |
|||
Color(0XFF7E94B4).withValues(alpha: 0.3), |
|||
Color(0XFF304053).withValues(alpha: 0), |
|||
], |
|||
), |
|||
padding: EdgeInsets.symmetric( |
|||
vertical: MySpaces.s16, |
|||
horizontal: MySpaces.s28, |
|||
), |
|||
child: FittedBox( |
|||
child: Text( |
|||
context.translate.delete_account, |
|||
maxLines: 1, |
|||
style: Lexend.semiBold.copyWith(fontSize: 14, color: Color(0XFF5F5F88)), |
|||
), |
|||
), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/container/gradient_container.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; |
|||
|
|||
class ProfileLocation extends StatelessWidget { |
|||
const ProfileLocation({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return GradientContainer( |
|||
onTap: () {}, |
|||
width: 48, |
|||
height: 48, |
|||
color: Color(0XFF5715BF), |
|||
borderRadius: BorderRadius.all(Radius.circular(12)), |
|||
child: MyImage(asset: MyAssets.iconLocation), |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
import 'package:flutter/material.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_assets.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_spaces.dart'; |
|||
import 'package:shia_game_flutter/common_ui/resources/my_text_style.dart'; |
|||
import 'package:shia_game_flutter/core/utils/my_localization.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/container/gradient_container.dart'; |
|||
import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; |
|||
|
|||
class ProfileLogout extends StatelessWidget { |
|||
const ProfileLogout({super.key}); |
|||
|
|||
@override |
|||
Widget build(BuildContext context) { |
|||
return GradientContainer( |
|||
height: 58, |
|||
onTap: () {}, |
|||
borderRadius: BorderRadius.all(Radius.circular(MySpaces.s12)), |
|||
color: Color(0XFF270A59), |
|||
padding: EdgeInsets.symmetric( |
|||
vertical: MySpaces.s16, |
|||
horizontal: MySpaces.s28, |
|||
), |
|||
child: Row( |
|||
spacing: MySpaces.s10, |
|||
mainAxisAlignment: MainAxisAlignment.center, |
|||
children: [ |
|||
MyImage(asset: MyAssets.iconLogout), |
|||
FittedBox( |
|||
child: Text( |
|||
context.translate.logout, |
|||
style: Lexend.semiBold.copyWith(fontSize: 14), |
|||
), |
|||
), |
|||
], |
|||
), |
|||
); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue