|
|
|
@ -55,6 +55,38 @@ class _UserProfileScreenState extends State<UserProfileScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
bool isPortrait = MediaQuery.of(context).orientation == Orientation.portrait;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Widget> _actionsList = [
|
|
|
|
|
|
|
|
button("تغيير كلمة المرور", isPortrait).onPress(() {
|
|
|
|
|
|
|
|
Navigator.pushNamed(context, ChangePasswordScreen.routeName);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
|
|
|
|
|
|
|
|
button("تسجيل الخروج", isPortrait).onPress(() async {
|
|
|
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
|
|
|
|
|
|
await prefs.remove(GlobalConsts.userAuthData);
|
|
|
|
|
|
|
|
AppState().setAuthenticationModel(null);
|
|
|
|
|
|
|
|
Utils.showToast("تسجيل خروج المستخدم");
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
|
|
|
|
|
|
|
|
button("حذف الحساب", isPortrait).onPress(() {
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
barrierColor: Colors.white.withOpacity(0.2),
|
|
|
|
|
|
|
|
builder: (BuildContext context) => GeneralDialog(
|
|
|
|
|
|
|
|
message: "هل تود حذف حسابك عبر تطبيق تنغيم؟",
|
|
|
|
|
|
|
|
backgroundColor: Color(0xff598A8D),
|
|
|
|
|
|
|
|
buttonTitle: "تأكيد الحذف",
|
|
|
|
|
|
|
|
buttonBorderColor: ColorConsts.brownLightColor,
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
deleteUserAccount();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
];
|
|
|
|
return SizedBox(
|
|
|
|
return SizedBox(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Stack(
|
|
|
|
child: Stack(
|
|
|
|
@ -63,11 +95,13 @@ class _UserProfileScreenState extends State<UserProfileScreen> {
|
|
|
|
Image.asset(
|
|
|
|
Image.asset(
|
|
|
|
"assets/icons/new/home_dark.jpg",
|
|
|
|
"assets/icons/new/home_dark.jpg",
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
height: double.infinity,
|
|
|
|
height: isPortrait ? double.infinity : null,
|
|
|
|
|
|
|
|
width: isPortrait ? null : double.infinity,
|
|
|
|
opacity: const AlwaysStoppedAnimation(1),
|
|
|
|
opacity: const AlwaysStoppedAnimation(1),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(color: ColorConsts.darkText.withOpacity(0.8)),
|
|
|
|
Container(color: ColorConsts.darkText.withOpacity(0.8)),
|
|
|
|
Column(
|
|
|
|
isPortrait
|
|
|
|
|
|
|
|
? Column(
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
100.height,
|
|
|
|
100.height,
|
|
|
|
@ -88,45 +122,41 @@ class _UserProfileScreenState extends State<UserProfileScreen> {
|
|
|
|
14.height,
|
|
|
|
14.height,
|
|
|
|
(AppState().userName ?? "").toText(25),
|
|
|
|
(AppState().userName ?? "").toText(25),
|
|
|
|
50.height,
|
|
|
|
50.height,
|
|
|
|
button("تغيير كلمة المرور").onPress(() {
|
|
|
|
..._actionsList
|
|
|
|
Navigator.pushNamed(context, ChangePasswordScreen.routeName);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
|
|
|
|
|
|
|
|
button("تسجيل الخروج").onPress(() async {
|
|
|
|
|
|
|
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
|
|
|
|
|
|
|
await prefs.remove(GlobalConsts.userAuthData);
|
|
|
|
|
|
|
|
AppState().setAuthenticationModel(null);
|
|
|
|
|
|
|
|
Utils.showToast("تسجيل خروج المستخدم");
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
Container(width: 50, height: 1, color: ColorConsts.dark99Text).paddingOnly(top: 15, bottom: 15),
|
|
|
|
|
|
|
|
button("حذف الحساب").onPress(() {
|
|
|
|
|
|
|
|
showDialog(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
barrierColor: Colors.white.withOpacity(0.2),
|
|
|
|
|
|
|
|
builder: (BuildContext context) => GeneralDialog(
|
|
|
|
|
|
|
|
message: "هل تود حذف حسابك عبر تطبيق تنغيم؟",
|
|
|
|
|
|
|
|
backgroundColor: Color(0xff598A8D),
|
|
|
|
|
|
|
|
buttonTitle: "تأكيد الحذف",
|
|
|
|
|
|
|
|
buttonBorderColor: ColorConsts.brownLightColor,
|
|
|
|
|
|
|
|
onTap: () {
|
|
|
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
|
|
|
deleteUserAccount();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Image.asset('assets/icons/new/Tangeem-logo-W.png', width: 75),
|
|
|
|
|
|
|
|
30.height,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
width: 78,
|
|
|
|
|
|
|
|
height: 78,
|
|
|
|
|
|
|
|
decoration: BoxDecoration(shape: BoxShape.circle, color: ColorConsts.dark2Text),
|
|
|
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
|
|
|
"assets/icons/new/user_acount.svg",
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
24.height,
|
|
|
|
|
|
|
|
(AppState().userName ?? "").toText(25),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).expanded,
|
|
|
|
|
|
|
|
Column(mainAxisAlignment: MainAxisAlignment.center, children: _actionsList).expanded,
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
).paddingOnly(right: 36, left: 36),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget button(String title) {
|
|
|
|
Widget button(String title, bool isPortrait) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
height: 36,
|
|
|
|
height: 36,
|
|
|
|
width: 165,
|
|
|
|
width: isPortrait ? 165 : 200,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(32),
|
|
|
|
borderRadius: BorderRadius.circular(32),
|
|
|
|
|