feature/profile
#3
Merged
amirreza.chegini
merged 2 commits from feature/profile into develop 1 month ago
26 changed files with 541 additions and 83 deletions
-
BINassets/images/question.png
-
BINassets/images/sample_avatar.png
-
3assets/svg/icon_location.svg
-
4assets/svg/icon_logout.svg
-
61assets/svg/intro_star.svg
-
7assets/svg/question.svg
-
7lib/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
-
87lib/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
-
78lib/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
|
Before Width: 25 | Height: 38 | Size: 1.1 KiB |
|
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,61 @@ |
|||
<svg width="181" height="79" viewBox="0 0 181 79" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|||
<g filter="url(#filter0_dd_1_9043)"> |
|||
<path d="M39.0098 9.57129C38.7666 9.07616 38.5892 7.99565 38.4675 6.83357C38.405 6.23174 38.3381 5.62172 38.3137 5.05235C38.1503 5.60143 37.9628 6.20458 37.7713 6.79699C37.405 7.89861 37.0226 8.90833 36.6674 9.3285C35.7894 10.4212 32.4707 11.0956 32.4707 11.0956C32.4707 11.0956 35.7585 12.6101 36.3945 13.9746C36.6109 14.6053 36.7422 15.2613 36.7849 15.9256C36.8455 16.5453 36.9046 17.2266 36.929 17.8681C37.0908 17.2622 37.275 16.6175 37.474 16.0284C37.6596 15.3792 37.9307 14.7572 38.2803 14.1784C39.1898 12.9886 42.7233 12.2034 42.7233 12.2034C42.7233 12.2034 39.6265 10.8255 39.0098 9.57129Z" fill="#FFC860"/> |
|||
</g> |
|||
<g filter="url(#filter1_dd_1_9043)"> |
|||
<path d="M9.96722 67.319C9.73836 66.9936 9.51152 66.2568 9.3208 65.4593C9.22243 65.0462 9.12003 64.6278 9.05378 64.2344C8.97348 64.6278 8.87913 65.0605 8.78076 65.4861C8.59005 66.2783 8.37927 67.0079 8.14037 67.3262C7.55417 68.1505 5.05078 68.8676 5.05078 68.8676C5.05078 68.8676 7.71277 69.6723 8.31704 70.5717C8.5365 70.9933 8.69242 71.4388 8.78076 71.8968C8.87913 72.3224 8.98151 72.7909 9.05378 73.2344C9.12806 72.8016 9.21641 72.3403 9.3208 71.9165C9.40986 71.4519 9.56712 70.9998 9.78855 70.5717C10.3908 69.6776 13.0508 68.8676 13.0508 68.8676C13.0508 68.8676 10.5474 68.1434 9.96722 67.319Z" fill="#FFC860"/> |
|||
</g> |
|||
<g filter="url(#filter2_dd_1_9043)"> |
|||
<path d="M171.582 21.0045C171.324 20.6067 171.069 19.7063 170.855 18.7315C170.744 18.2266 170.629 17.7152 170.554 17.2344C170.464 17.7152 170.358 18.2441 170.247 18.7643C170.032 19.7325 169.795 20.6242 169.527 21.0132C168.867 22.0208 166.051 22.8972 166.051 22.8972C166.051 22.8972 169.046 23.8807 169.725 24.9801C169.972 25.4953 170.148 26.0398 170.247 26.5996C170.358 27.1197 170.473 27.6924 170.554 28.2344C170.638 27.7055 170.737 27.1416 170.855 26.6236C170.955 26.0558 171.132 25.5032 171.381 24.9801C172.058 23.8873 175.051 22.8972 175.051 22.8972C175.051 22.8972 172.234 22.012 171.582 21.0045Z" fill="#FFC860"/> |
|||
</g> |
|||
<defs> |
|||
<filter id="filter0_dd_1_9043" x="27.4211" y="0.00116158" width="20.3531" height="22.9176" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> |
|||
<feFlood flood-opacity="0" result="BackgroundImageFix"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="2.52579"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_9043"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="0.561286"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="effect1_dropShadow_1_9043" result="effect2_dropShadow_1_9043"/> |
|||
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_1_9043" result="shape"/> |
|||
</filter> |
|||
<filter id="filter1_dd_1_9043" x="-0.00079155" y="59.1828" width="18.1031" height="19.1031" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> |
|||
<feFlood flood-opacity="0" result="BackgroundImageFix"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="2.52579"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_9043"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="0.561286"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="effect1_dropShadow_1_9043" result="effect2_dropShadow_1_9043"/> |
|||
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_1_9043" result="shape"/> |
|||
</filter> |
|||
<filter id="filter2_dd_1_9043" x="160.999" y="12.1828" width="19.1031" height="21.1031" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> |
|||
<feFlood flood-opacity="0" result="BackgroundImageFix"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="2.52579"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_9043"/> |
|||
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> |
|||
<feOffset/> |
|||
<feGaussianBlur stdDeviation="0.561286"/> |
|||
<feComposite in2="hardAlpha" operator="out"/> |
|||
<feColorMatrix type="matrix" values="0 0 0 0 1 0 0 0 0 0.784314 0 0 0 0 0.376471 0 0 0 1 0"/> |
|||
<feBlend mode="normal" in2="effect1_dropShadow_1_9043" result="effect2_dropShadow_1_9043"/> |
|||
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_1_9043" result="shape"/> |
|||
</filter> |
|||
</defs> |
|||
</svg> |
|||
@ -0,0 +1,7 @@ |
|||
<svg width="25" height="37" viewBox="0 0 25 37" fill="none" xmlns="http://www.w3.org/2000/svg"> |
|||
<mask id="path-1-outside-1_1_9039" maskUnits="userSpaceOnUse" x="-1" y="-0.412109" width="26" height="38" fill="black"> |
|||
<rect fill="white" x="-1" y="-0.412109" width="26" height="38"/> |
|||
<path d="M3.27049 11.9443L4.73932 3.52016C7.59057 3.04495 9.75061 2.69934 12.8179 2.69934C18.5636 2.69934 22.538 5.50739 21.5012 11.2531C20.8532 14.9684 18.218 17.0852 15.9715 18.7268C14.3299 19.8932 13.3363 20.4549 13.1203 21.5349H5.43053C5.73294 19.5476 6.68335 17.7764 8.67059 16.2644C10.4418 14.9252 12.2131 13.8019 12.4291 12.5923C12.5587 11.7283 12.3427 11.2099 10.8306 11.2099C8.58419 11.2099 7.02896 11.5555 3.7025 12.3331L3.27049 11.9443ZM8.71379 24.0405C11.4786 24.0405 13.4227 26.071 12.9043 29.095C12.3427 32.2055 9.70741 34.1927 6.94256 34.1927C4.17771 34.1927 2.23368 32.2055 2.79529 29.095C3.31369 26.071 5.94894 24.0405 8.71379 24.0405Z"/> |
|||
</mask> |
|||
<path d="M3.27049 11.9443L0.610575 11.4805L0.354009 12.952L1.46425 13.9512L3.27049 11.9443ZM4.73932 3.52016L4.29543 0.856847L2.40806 1.17141L2.0794 3.05638L4.73932 3.52016ZM21.5012 11.2531L18.8441 10.7736L18.8427 10.7814L18.8413 10.7892L21.5012 11.2531ZM15.9715 18.7268L17.5354 20.9279L17.5501 20.9174L17.5646 20.9068L15.9715 18.7268ZM13.1203 21.5349V24.2349H15.3338L15.7679 22.0644L13.1203 21.5349ZM5.43053 21.5349L2.76121 21.1287L2.28852 24.2349H5.43053V21.5349ZM8.67059 16.2644L7.04216 14.1107L7.03565 14.1156L8.67059 16.2644ZM12.4291 12.5923L15.0871 13.067L15.0937 13.03L15.0992 12.9928L12.4291 12.5923ZM3.7025 12.3331L1.89626 14.34L2.94423 15.2832L4.31711 14.9623L3.7025 12.3331ZM12.9043 29.095L15.5613 29.5748L15.5635 29.563L15.5655 29.5512L12.9043 29.095ZM2.79529 29.095L5.45237 29.5748L5.45449 29.563L5.45651 29.5512L2.79529 29.095ZM3.27049 11.9443L5.93041 12.4081L7.39924 3.98394L4.73932 3.52016L2.0794 3.05638L0.610575 11.4805L3.27049 11.9443ZM4.73932 3.52016L5.1832 6.18347C8.0182 5.71097 9.99001 5.39939 12.8179 5.39939V2.69934V-0.000704527C9.51121 -0.000704527 7.16294 0.378931 4.29543 0.856847L4.73932 3.52016ZM12.8179 2.69934V5.39939C15.3254 5.39939 16.9981 6.02192 17.8994 6.8309C18.6579 7.51174 19.2289 8.64095 18.8441 10.7736L21.5012 11.2531L24.1583 11.7326C24.8103 8.11953 23.9125 4.97188 21.5066 2.81227C19.2434 0.780796 16.056 -0.000704527 12.8179 -0.000704527V2.69934ZM21.5012 11.2531L18.8413 10.7892C18.3941 13.353 16.6123 14.9144 14.3784 16.5468L15.9715 18.7268L17.5646 20.9068C19.8236 19.256 23.3123 16.5837 24.1611 11.717L21.5012 11.2531ZM15.9715 18.7268L14.4076 16.5258C13.7253 17.0106 12.8502 17.5906 12.2317 18.1327C11.5108 18.7644 10.7414 19.6618 10.4727 21.0054L13.1203 21.5349L15.7679 22.0644C15.7152 22.3279 15.5505 22.4045 15.7909 22.1938C15.9266 22.0749 16.1224 21.9247 16.4319 21.7038C16.583 21.596 16.7463 21.4819 16.9334 21.3511C17.1171 21.2227 17.3204 21.0806 17.5354 20.9279L15.9715 18.7268ZM13.1203 21.5349V18.8348H5.43053V21.5349V24.2349H13.1203V21.5349ZM5.43053 21.5349L8.09985 21.9411C8.29613 20.6512 8.87282 19.5033 10.3055 18.4132L8.67059 16.2644L7.03565 14.1156C4.49389 16.0496 3.16974 18.4441 2.76121 21.1287L5.43053 21.5349ZM8.67059 16.2644L10.299 18.4181C11.0527 17.8483 12.1211 17.0968 12.902 16.4196C13.6134 15.8027 14.7991 14.6796 15.0871 13.067L12.4291 12.5923L9.77105 12.1177C9.8162 11.8649 9.9125 11.7718 9.8462 11.8594C9.781 11.9456 9.63863 12.1018 9.36408 12.3399C8.76257 12.8615 8.05976 13.3413 7.04217 14.1107L8.67059 16.2644ZM12.4291 12.5923L15.0992 12.9928C15.1799 12.4549 15.3647 10.9345 14.1985 9.71278C13.144 8.60805 11.6806 8.50985 10.8306 8.50985V11.2099V13.9099C11.0767 13.9099 11.116 13.9335 11.0351 13.9118C10.9422 13.8868 10.6156 13.78 10.2924 13.4414C9.94728 13.0799 9.81615 12.6757 9.77674 12.4144C9.74466 12.2016 9.77375 12.0926 9.75888 12.1918L12.4291 12.5923ZM10.8306 11.2099V8.50985C8.22992 8.50985 6.38723 8.93267 3.08789 9.70395L3.7025 12.3331L4.31711 14.9623C7.67069 14.1783 8.93846 13.9099 10.8306 13.9099V11.2099ZM3.7025 12.3331L5.50874 10.3262L5.07674 9.93738L3.27049 11.9443L1.46425 13.9512L1.89626 14.34L3.7025 12.3331ZM8.71379 24.0405V26.7406C9.43199 26.7406 9.81832 26.9924 9.99903 27.2011C10.1635 27.3911 10.3858 27.8061 10.243 28.6388L12.9043 29.095L15.5655 29.5512C15.9411 27.3599 15.4506 25.2477 14.0815 23.6663C12.7286 22.1038 10.7604 21.3405 8.71379 21.3405V24.0405ZM12.9043 29.095L10.2472 28.6153C9.9233 30.4091 8.43333 31.4927 6.94256 31.4927V34.1927V36.8927C10.9815 36.8927 14.762 34.0019 15.5613 29.5748L12.9043 29.095ZM6.94256 34.1927V31.4927C6.20471 31.4927 5.83138 31.239 5.66888 31.05C5.52552 30.8833 5.29031 30.4723 5.45237 29.5748L2.79529 29.095L0.138201 28.6153C-0.261353 30.8282 0.194652 32.966 1.57412 34.5705C2.93444 36.1528 4.91556 36.8927 6.94256 36.8927V34.1927ZM2.79529 29.095L5.45651 29.5512C5.74577 27.8639 7.22265 26.7406 8.71379 26.7406V24.0405V21.3405C4.67524 21.3405 0.881615 24.2781 0.134058 28.6388L2.79529 29.095Z" fill="#351A64" mask="url(#path-1-outside-1_1_9039)"/> |
|||
</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