|
|
|
|
import 'dart:ui';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:mc_common_app/classes/app_state.dart';
|
|
|
|
|
import 'package:mc_common_app/classes/consts.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/int_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/extensions/string_extensions.dart';
|
|
|
|
|
import 'package:mc_common_app/theme/colors.dart';
|
|
|
|
|
import 'package:mc_common_app/views/setting_options/widgets/custom_setting_options_tile.dart';
|
|
|
|
|
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';
|
|
|
|
|
|
|
|
|
|
class ProfileScreen extends StatelessWidget {
|
|
|
|
|
const ProfileScreen({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
// final ImagePicker _picker = ImagePicker();
|
|
|
|
|
|
|
|
|
|
Widget showItem({required String icon, required String title, required VoidCallback onTap, String? subTitle}) {
|
|
|
|
|
return InkWell(
|
|
|
|
|
onTap: onTap,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
SizedBox(
|
|
|
|
|
width: 16,
|
|
|
|
|
height: 16,
|
|
|
|
|
child: SvgPicture.asset(
|
|
|
|
|
icon,
|
|
|
|
|
color: subTitle == null ? MyColors.black : MyColors.primaryColor,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
12.width,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
title.toText(isBold: true, fontSize: 14),
|
|
|
|
|
if (subTitle != null) subTitle.toText(fontSize: 14, color: MyColors.primaryColor),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.arrow_forward,
|
|
|
|
|
size: 16,
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
|
|
return Scaffold(
|
|
|
|
|
extendBody: true,
|
|
|
|
|
backgroundColor: const Color(0xffefefef),
|
|
|
|
|
body: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 3,
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
image: AssetImage(MyAssets.icLogoWhitePng),
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: BackdropFilter(
|
|
|
|
|
filter: ImageFilter.blur(sigmaX: 7.0, sigmaY: 7.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
// height:,
|
|
|
|
|
color: Colors.white.withOpacity(0.0),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
flex: 8,
|
|
|
|
|
child: Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
child: ListView(
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Container(
|
|
|
|
|
height: 90,
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: ClipOval(
|
|
|
|
|
child: Image.asset(
|
|
|
|
|
MyAssets.carBanner,
|
|
|
|
|
width: 90,
|
|
|
|
|
height: 90,
|
|
|
|
|
fit: BoxFit.fill,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
Container(
|
|
|
|
|
height: 35,
|
|
|
|
|
width: 35,
|
|
|
|
|
decoration: BoxDecoration(color: MyColors.white, shape: BoxShape.circle, border: Border.all(color: MyColors.darkTextColor, width: 0.1)),
|
|
|
|
|
child: const Icon(Icons.edit_note, color: MyColors.darkIconColor, size: 27).paddingOnly(left: 5),
|
|
|
|
|
).onPress(() {})
|
|
|
|
|
],
|
|
|
|
|
).horPaddingMain(),
|
|
|
|
|
10.height,
|
|
|
|
|
"${AppState().getUser.data!.userInfo!.firstName} ${AppState().getUser.data!.userInfo!.lastName ?? ""}".toText(fontSize: 20).paddingOnly(left: 25),
|
|
|
|
|
Column(
|
|
|
|
|
children: [
|
|
|
|
|
CustomProfileOptionsTile(
|
|
|
|
|
titleText: "Country",
|
|
|
|
|
subtitleText: "Saudi Arabia",
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
CustomProfileOptionsTile(
|
|
|
|
|
titleText: "Email",
|
|
|
|
|
subtitleText: "${AppState().getUser.data!.userInfo!.email}",
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
CustomProfileOptionsTile(
|
|
|
|
|
titleText: "Phone Number",
|
|
|
|
|
subtitleText: "${AppState().getUser.data!.userInfo!.email}",
|
|
|
|
|
needBorderBelow: true,
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
CustomProfileOptionsTile(
|
|
|
|
|
titleText: "Password",
|
|
|
|
|
subtitleText: "************",
|
|
|
|
|
onTap: () {},
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
).toContainer(width: double.infinity, isShadowEnabled: true, paddingAll: 10, margin: const EdgeInsets.fromLTRB(24, 24, 24, 0), borderRadius: 0),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
CircleAvatar(
|
|
|
|
|
radius: 20,
|
|
|
|
|
backgroundColor: Colors.white,
|
|
|
|
|
child: const Icon(Icons.arrow_back_ios_rounded, color: MyColors.darkIconColor, size: 18).paddingOnly(right: 4),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
}).paddingOnly(left: 21, right: 21, top: 50),
|
|
|
|
|
|
|
|
|
|
// SingleChildScrollView(
|
|
|
|
|
// scrollDirection: Axis.vertical,
|
|
|
|
|
// child: Column(
|
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
// children: [
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
|
// children: [
|
|
|
|
|
// CircleAvatar(
|
|
|
|
|
// radius: 20,
|
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
|
// child: const Icon(Icons.arrow_back_ios_rounded, color: MyColors.darkIconColor, size: 18).paddingOnly(right: 4),
|
|
|
|
|
// ).onPress(() {
|
|
|
|
|
// Navigator.pop(context);
|
|
|
|
|
// }),
|
|
|
|
|
// ],
|
|
|
|
|
// ).paddingOnly(left: 21, right: 21, top: 50),
|
|
|
|
|
// Stack(
|
|
|
|
|
// children: [
|
|
|
|
|
// Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// showItem(
|
|
|
|
|
// icon: MyAssets.icEmail,
|
|
|
|
|
// title: "Country",
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// navigateWithName(context, AppRoutes.changeEmailPage);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// const Divider(
|
|
|
|
|
// height: 1,
|
|
|
|
|
// ),
|
|
|
|
|
// showItem(
|
|
|
|
|
// icon: MyAssets.icPassword,
|
|
|
|
|
// title: "Country",
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// navigateWithName(context, AppRoutes.changePassword);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// const Divider(
|
|
|
|
|
// height: 1,
|
|
|
|
|
// ),
|
|
|
|
|
// showItem(
|
|
|
|
|
// icon: MyAssets.icPhoneNumber,
|
|
|
|
|
// title: "Country",
|
|
|
|
|
// onTap: () {
|
|
|
|
|
// navigateWithName(context, AppRoutes.changeMobilePage);
|
|
|
|
|
// },
|
|
|
|
|
// ),
|
|
|
|
|
// const Divider(
|
|
|
|
|
// height: 1,
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ).toWhiteContainer(width: double.infinity, pading: const EdgeInsets.symmetric(horizontal: 21)),
|
|
|
|
|
// Row(
|
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
// children: [
|
|
|
|
|
// Container(
|
|
|
|
|
// height: 68,
|
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
|
// child: ClipOval(
|
|
|
|
|
// child: Image.asset(
|
|
|
|
|
// MyAssets.carBanner,
|
|
|
|
|
// width: 68,
|
|
|
|
|
// height: 68,
|
|
|
|
|
// fit: BoxFit.fill,
|
|
|
|
|
// ),
|
|
|
|
|
// )),
|
|
|
|
|
// InkWell(
|
|
|
|
|
// onTap: () {},
|
|
|
|
|
// child: Container(
|
|
|
|
|
// padding: const EdgeInsets.only(left: 17, right: 17, top: 8, bottom: 8),
|
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
|
// borderRadius: BorderRadius.circular(30),
|
|
|
|
|
// color: Colors.black.withOpacity(.21),
|
|
|
|
|
// ),
|
|
|
|
|
// child: Row(
|
|
|
|
|
// children: [
|
|
|
|
|
// const Icon(Icons.photo, color: Colors.white, size: 16),
|
|
|
|
|
// 4.width,
|
|
|
|
|
// "edit".toText(fontSize: 12, color: Colors.white),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ],
|
|
|
|
|
// ).horPaddingMain(),
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
// ),
|
|
|
|
|
// Container(
|
|
|
|
|
// height: MediaQuery.of(context).size.height,
|
|
|
|
|
// width: MediaQuery.of(context).size.width,
|
|
|
|
|
// color: Colors.white,
|
|
|
|
|
// child: Column(
|
|
|
|
|
// children: [
|
|
|
|
|
// CustomSettingOptionsTile(
|
|
|
|
|
// leadingWidget: const Icon(Icons.person, size: 20), titleText: "Invite Friends", needBorderBelow: true, onTap: () => navigateWithName(context, AppRoutes.myRequestsPage)),
|
|
|
|
|
// CustomSettingOptionsTile(
|
|
|
|
|
// leadingWidget: const Icon(Icons.help, size: 20), titleText: "Help", needBorderBelow: true, onTap: () => navigateWithName(context, AppRoutes.settingOptionsFaqs)),
|
|
|
|
|
// CustomSettingOptionsTile(leadingWidget: const Icon(Icons.person, size: 20), titleText: "Account", onTap: () => navigateWithName(context, AppRoutes.profileView)),
|
|
|
|
|
// ],
|
|
|
|
|
// ).toContainer(width: double.infinity, isShadowEnabled: true, paddingAll: 10, borderRadius: 0),
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
//
|