fix : ui bug
This commit is contained in:
26
.vscode/launch.json
vendored
Normal file
26
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
|
||||||
|
{
|
||||||
|
"name": "rasadyar_app",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "dart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rasadyar_app (profile mode)",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "dart",
|
||||||
|
"flutterMode": "profile"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "rasadyar_app (release mode)",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "dart",
|
||||||
|
"flutterMode": "release"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
||||||
flutter.sdk=C:\\src\\flutter
|
flutter.sdk=C:\\src\\flutter
|
||||||
flutter.buildMode=debug
|
flutter.buildMode=release
|
||||||
flutter.versionName=1.3.25
|
flutter.versionName=1.3.26
|
||||||
flutter.versionCode=22
|
flutter.versionCode=23
|
||||||
@@ -13,8 +13,12 @@ class ProfileLogic extends GetxController {
|
|||||||
RxInt selectedInformationType = 0.obs;
|
RxInt selectedInformationType = 0.obs;
|
||||||
Rxn<Jalali> birthDate = Rxn<Jalali>();
|
Rxn<Jalali> birthDate = Rxn<Jalali>();
|
||||||
|
|
||||||
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(Resource.loading());
|
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(
|
||||||
Rx<Resource<UserLocalModel>> userLocal = Rx<Resource<UserLocalModel>>(Resource.loading());
|
Resource.loading(),
|
||||||
|
);
|
||||||
|
Rx<Resource<UserLocalModel>> userLocal = Rx<Resource<UserLocalModel>>(
|
||||||
|
Resource.loading(),
|
||||||
|
);
|
||||||
|
|
||||||
TextEditingController nameController = TextEditingController();
|
TextEditingController nameController = TextEditingController();
|
||||||
TextEditingController lastNameController = TextEditingController();
|
TextEditingController lastNameController = TextEditingController();
|
||||||
@@ -36,6 +40,9 @@ class ProfileLogic extends GetxController {
|
|||||||
RxnString _base64Image = RxnString();
|
RxnString _base64Image = RxnString();
|
||||||
RxBool isOnLoading = false.obs;
|
RxBool isOnLoading = false.obs;
|
||||||
|
|
||||||
|
RxBool isUserInformationOpen = true.obs;
|
||||||
|
RxBool isUnitInformationOpen = false.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
@@ -57,7 +64,8 @@ class ProfileLogic extends GetxController {
|
|||||||
lastNameController.text = data.data?.lastName ?? '';
|
lastNameController.text = data.data?.lastName ?? '';
|
||||||
nationalCodeController.text = data.data?.nationalCode ?? '';
|
nationalCodeController.text = data.data?.nationalCode ?? '';
|
||||||
nationalIdController.text = data.data?.nationalId ?? '';
|
nationalIdController.text = data.data?.nationalId ?? '';
|
||||||
birthdayController.text = data.data?.birthday?.toJalali.formatCompactDate() ?? '';
|
birthdayController.text =
|
||||||
|
data.data?.birthday?.toJalali.formatCompactDate() ?? '';
|
||||||
birthDate.value = data.data?.birthday?.toJalali;
|
birthDate.value = data.data?.birthday?.toJalali;
|
||||||
selectedProvince.value = IranProvinceCityModel(
|
selectedProvince.value = IranProvinceCityModel(
|
||||||
name: data.data?.province ?? '',
|
name: data.data?.province ?? '',
|
||||||
@@ -79,8 +87,9 @@ class ProfileLogic extends GetxController {
|
|||||||
Future<void> getUserProfile() async {
|
Future<void> getUserProfile() async {
|
||||||
userProfile.value = Resource.loading();
|
userProfile.value = Resource.loading();
|
||||||
await safeCall<UserProfile?>(
|
await safeCall<UserProfile?>(
|
||||||
call: () async =>
|
call: () async => await chickenRepository.getUserProfile(
|
||||||
await chickenRepository.getUserProfile(token: tokenService.accessToken.value!),
|
token: tokenService.accessToken.value!,
|
||||||
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
userProfile.value = Resource.success(result);
|
userProfile.value = Resource.success(result);
|
||||||
@@ -92,7 +101,9 @@ class ProfileLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> getCites() async {
|
Future<void> getCites() async {
|
||||||
await safeCall(
|
await safeCall(
|
||||||
call: () => chickenRepository.getCity(provinceName: selectedProvince.value?.name ?? ''),
|
call: () => chickenRepository.getCity(
|
||||||
|
provinceName: selectedProvince.value?.name ?? '',
|
||||||
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null && result.isNotEmpty) {
|
if (result != null && result.isNotEmpty) {
|
||||||
cites.value = result;
|
cites.value = result;
|
||||||
@@ -107,7 +118,10 @@ class ProfileLogic extends GetxController {
|
|||||||
lastName: lastNameController.text,
|
lastName: lastNameController.text,
|
||||||
nationalCode: nationalCodeController.text,
|
nationalCode: nationalCodeController.text,
|
||||||
nationalId: nationalIdController.text,
|
nationalId: nationalIdController.text,
|
||||||
birthday: birthDate.value?.toDateTime().formattedDashedGregorian.toString(),
|
birthday: birthDate.value
|
||||||
|
?.toDateTime()
|
||||||
|
.formattedDashedGregorian
|
||||||
|
.toString(),
|
||||||
image: _base64Image.value,
|
image: _base64Image.value,
|
||||||
personType: 'self',
|
personType: 'self',
|
||||||
type: 'self_profile',
|
type: 'self_profile',
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ class ProfilePage extends GetView<ProfileLogic> {
|
|||||||
spacing: 30,
|
spacing: 30,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|
||||||
child: Container(
|
child: Container(
|
||||||
color: AppColor.blueNormal,
|
color: AppColor.blueNormal,
|
||||||
child: Column(
|
child: Column(
|
||||||
@@ -69,83 +68,127 @@ class ProfilePage extends GetView<ProfileLogic> {
|
|||||||
flex: 3,
|
flex: 3,
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
spacing: 16,
|
|
||||||
children: [
|
children: [
|
||||||
rolesWidget(),
|
rolesWidget(),
|
||||||
SizedBox(height: 320.h, child: userProfileInformation()),
|
SizedBox(height: 12.h,),
|
||||||
|
|
||||||
SizedBox(
|
ObxValue((data) {
|
||||||
height: 130.h,
|
if (data.value.status == ResourceStatus.loading) {
|
||||||
child: Container(
|
return LoadingWidget();
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
} else if (data.value.status == ResourceStatus.error) {
|
||||||
decoration: BoxDecoration(
|
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
|
||||||
color: Colors.white,
|
} else if (data.value.status == ResourceStatus.success) {
|
||||||
borderRadius: BorderRadius.circular(8),
|
return Column(
|
||||||
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
spacing: 6,
|
||||||
),
|
|
||||||
child: Stack(
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
children: [
|
children: [
|
||||||
Positioned.fill(
|
ObxValue((isOpen) {
|
||||||
child: Row(
|
return GestureDetector(
|
||||||
children: [
|
onTap: () => isOpen.toggle(),
|
||||||
Padding(
|
child: AnimatedContainer(
|
||||||
padding: EdgeInsets.fromLTRB(24, 28, 24, 13),
|
height: isOpen.value ? 320.h : 47.h,
|
||||||
child: Wrap(
|
duration: Duration(milliseconds: 500),
|
||||||
spacing: 50,
|
curve: Curves.linear,
|
||||||
runSpacing: 20,
|
child: userProfileInformation(data.value),
|
||||||
children: [
|
),
|
||||||
cardActionWidget(
|
);
|
||||||
title: 'تغییر رمز عبور',
|
}, controller.isUserInformationOpen),
|
||||||
selected: true,
|
|
||||||
cardColor: AppColor.blueLightActive,
|
Visibility(
|
||||||
cardIconColor: AppColor.blueNormal,
|
visible:
|
||||||
onPressed: () {
|
data.value.data?.unitName != null ||
|
||||||
Get.bottomSheet(
|
data.value.data?.unitAddress != null ||
|
||||||
changePasswordBottomSheet(),
|
data.value.data?.unitPostalCode != null ||
|
||||||
isScrollControlled: true,
|
data.value.data?.unitRegistrationNumber != null ||
|
||||||
);
|
data.value.data?.unitEconomicalNumber != null ||
|
||||||
},
|
data.value.data?.unitCity != null ||
|
||||||
icon: Assets.vec.lockSvg.path,
|
data.value.data?.unitProvince != null ||
|
||||||
),
|
data.value.data?.unitNationalId != null,
|
||||||
cardActionWidget(
|
|
||||||
title: 'خروج',
|
child: ObxValue((isOpen) {
|
||||||
selected: true,
|
return GestureDetector(
|
||||||
cardColor: Color(0xFFF6BDBD),
|
onTap: () => isOpen.toggle(),
|
||||||
cardIconColor: Color(0xFFEB5757),
|
child: AnimatedContainer(
|
||||||
textColor: AppColor.redDarkerText,
|
height: isOpen.value ? 320.h : 47.h,
|
||||||
onPressed: () {
|
duration: Duration(milliseconds: 500),
|
||||||
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
|
curve: Curves.linear,
|
||||||
},
|
child: unitInformation(data.value),
|
||||||
icon: Assets.vec.logoutSvg.path,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
);
|
||||||
),
|
}, controller.isUnitInformationOpen),
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
right: 10,
|
|
||||||
top: -15,
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'اطلاعات هویتی',
|
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return SizedBox.shrink();
|
||||||
|
}
|
||||||
|
}, controller.userProfile),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.bottomSheet(
|
||||||
|
changePasswordBottomSheet(),
|
||||||
|
isScrollControlled: true,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 47.h,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8.h),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
spacing: 6,
|
||||||
|
children: [
|
||||||
|
Assets.vec.lockSvg.svg(
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.h,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'تغییر رمز عبور',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.bottomSheet(
|
||||||
|
changePasswordBottomSheet(),
|
||||||
|
isScrollControlled: true,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 47.h,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
spacing: 6,
|
||||||
|
children: [
|
||||||
|
Assets.vec.logoutSvg.svg(
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.h,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.redNormal, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'خروج',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.redNormal),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
|
||||||
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 100),
|
SizedBox(height: 100),
|
||||||
],
|
],
|
||||||
@@ -157,130 +200,264 @@ class ProfilePage extends GetView<ProfileLogic> {
|
|||||||
|
|
||||||
Container invoiceIssuanceInformation() => Container();
|
Container invoiceIssuanceInformation() => Container();
|
||||||
|
|
||||||
Widget bankInformationWidget() => Column(
|
Widget bankInformationWidget() =>
|
||||||
spacing: 16,
|
Column(
|
||||||
children: [
|
spacing: 16,
|
||||||
itemList(title: 'نام بانک', content: 'سامان'),
|
children: [
|
||||||
itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'),
|
itemList(title: 'نام بانک', content: 'سامان'),
|
||||||
itemList(title: 'شماره کارت ', content: '54154545415'),
|
itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'),
|
||||||
itemList(title: 'شماره حساب', content: '62565263263652'),
|
itemList(title: 'شماره کارت ', content: '54154545415'),
|
||||||
itemList(title: 'شماره شبا', content: '62565263263652'),
|
itemList(title: 'شماره حساب', content: '62565263263652'),
|
||||||
],
|
itemList(title: 'شماره شبا', content: '62565263263652'),
|
||||||
);
|
],
|
||||||
|
);
|
||||||
|
|
||||||
Widget userProfileInformation() {
|
Widget userProfileInformation(Resource<UserProfile> value) {
|
||||||
return ObxValue((data) {
|
UserProfile item = value.data!;
|
||||||
if (data.value.status == ResourceStatus.loading) {
|
return Stack(
|
||||||
return LoadingWidget();
|
clipBehavior: Clip.none,
|
||||||
} else if (data.value.status == ResourceStatus.error) {
|
children: [
|
||||||
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
|
Positioned.fill(
|
||||||
} else if (data.value.status == ResourceStatus.success) {
|
child: ObxValue(
|
||||||
UserProfile item = data.value.data!;
|
(val) =>
|
||||||
return Stack(
|
Container(
|
||||||
clipBehavior: Clip.none,
|
height: val.value ? 320.h : 47.h,
|
||||||
children: [
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 8 : 0),
|
||||||
Positioned.fill(
|
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||||
child: Container(
|
decoration: BoxDecoration(
|
||||||
margin: const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
|
color: Colors.white,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
borderRadius: BorderRadius.circular(8),
|
||||||
decoration: BoxDecoration(
|
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
||||||
color: Colors.white,
|
),
|
||||||
borderRadius: BorderRadius.circular(8),
|
child: val.value
|
||||||
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
? Column(
|
||||||
),
|
spacing: 6,
|
||||||
child: Column(
|
children: [
|
||||||
spacing: 6,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.bottomSheet(
|
|
||||||
userInformationBottomSheet(),
|
|
||||||
isScrollControlled: true,
|
|
||||||
ignoreSafeArea: false,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Assets.vec.editSvg.svg(
|
|
||||||
width: 24.w,
|
|
||||||
height: 24.h,
|
|
||||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
itemList(
|
GestureDetector(
|
||||||
title: 'نام و نام خانوادگی',
|
onTap: () {
|
||||||
content: item.fullname ?? 'نامشخص',
|
Get.bottomSheet(
|
||||||
icon: Assets.vec.userSvg.path,
|
userInformationBottomSheet(),
|
||||||
hasColoredBox: true,
|
isScrollControlled: true,
|
||||||
),
|
ignoreSafeArea: false,
|
||||||
itemList(
|
);
|
||||||
title: 'موبایل',
|
},
|
||||||
content: item.mobile ?? 'نامشخص',
|
child: Assets.vec.editSvg.svg(
|
||||||
icon: Assets.vec.callSvg.path,
|
width: 24.w,
|
||||||
),
|
height: 24.h,
|
||||||
itemList(
|
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||||
title: 'کدملی',
|
),
|
||||||
content: item.nationalId ?? 'نامشخص',
|
|
||||||
icon: Assets.vec.tagUserSvg.path,
|
|
||||||
),
|
|
||||||
itemList(
|
|
||||||
title: 'شماره شناسنامه',
|
|
||||||
content: item.nationalCode ?? 'نامشخص',
|
|
||||||
icon: Assets.vec.userSquareSvg.path,
|
|
||||||
),
|
|
||||||
itemList(
|
|
||||||
title: 'تاریخ تولد',
|
|
||||||
content: item.birthday?.toJalali.formatCompactDate() ?? 'نامشخص',
|
|
||||||
icon: Assets.vec.calendarSvg.path,
|
|
||||||
),
|
|
||||||
itemList(
|
|
||||||
title: 'استان',
|
|
||||||
content: item.province ?? 'نامشخص',
|
|
||||||
icon: Assets.vec.pictureFrameSvg.path,
|
|
||||||
),
|
|
||||||
itemList(
|
|
||||||
title: 'شهر',
|
|
||||||
content: item.city ?? 'نامشخص',
|
|
||||||
icon: Assets.vec.mapSvg.path,
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
Positioned(
|
Padding(
|
||||||
right: 16,
|
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||||
top: -7,
|
child: Column(
|
||||||
child: Container(
|
children: [
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
itemList(
|
||||||
decoration: BoxDecoration(
|
title: 'نام و نام خانوادگی',
|
||||||
color: Colors.white,
|
content: item.fullname ?? 'نامشخص',
|
||||||
borderRadius: BorderRadius.circular(8),
|
icon: Assets.vec.userSvg.path,
|
||||||
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
hasColoredBox: true,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'کدملی',
|
||||||
|
content: item.nationalId ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.tagUserSvg.path,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'موبایل',
|
||||||
|
content: item.mobile ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.callSvg.path,
|
||||||
|
),
|
||||||
|
|
||||||
|
itemList(
|
||||||
|
title: 'شماره شناسنامه',
|
||||||
|
content: item.nationalCode ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.userSquareSvg.path,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'تاریخ تولد',
|
||||||
|
content: item.birthday?.toJalali.formatCompactDate() ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.calendarSvg.path,
|
||||||
|
),
|
||||||
|
//todo
|
||||||
|
itemList(
|
||||||
|
title: 'استان',
|
||||||
|
content: item.province ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.pictureFrameSvg.path,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'شهر',
|
||||||
|
content: item.city ?? 'نامشخص',
|
||||||
|
icon: Assets.vec.mapSvg.path,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
controller.isUserInformationOpen,
|
||||||
'اطلاعات هویتی',
|
),
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
),
|
||||||
|
ObxValue(
|
||||||
|
(isOpen) =>
|
||||||
|
AnimatedPositioned(
|
||||||
|
right: 16,
|
||||||
|
top: isOpen.value ? -7 : 11,
|
||||||
|
duration: Duration(milliseconds: 500),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
decoration: isOpen.value
|
||||||
|
? BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
child: Text(
|
||||||
|
'اطلاعات هویتی',
|
||||||
|
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
controller.isUserInformationOpen,
|
||||||
],
|
),
|
||||||
);
|
],
|
||||||
} else {
|
);
|
||||||
return SizedBox.shrink();
|
}
|
||||||
}
|
|
||||||
}, controller.userProfile);
|
Widget unitInformation(Resource<UserProfile> value) {
|
||||||
|
UserProfile item = value.data!;
|
||||||
|
return Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
children: [
|
||||||
|
Positioned.fill(
|
||||||
|
child: ObxValue(
|
||||||
|
(val) =>
|
||||||
|
Container(
|
||||||
|
height: val.value ? 320.h : 47.h,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 12 : 0),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 11.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
||||||
|
),
|
||||||
|
child: val.value
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 5.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.bottomSheet(
|
||||||
|
userInformationBottomSheet(),
|
||||||
|
isScrollControlled: true,
|
||||||
|
ignoreSafeArea: false,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: Assets.vec.editSvg.svg(
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.h,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||||
|
child: Column(
|
||||||
|
spacing: 2,
|
||||||
|
children: [
|
||||||
|
itemList(
|
||||||
|
title: 'نام صنفی',
|
||||||
|
content: item.unitName ?? 'نامشخص',
|
||||||
|
hasColoredBox: true,
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'شناسنامه ملی',
|
||||||
|
content: item.unitNationalId ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'شماره ثبت',
|
||||||
|
content: item.unitRegistrationNumber ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
|
||||||
|
itemList(
|
||||||
|
title: 'کد اقتصادی',
|
||||||
|
content: item.unitEconomicalNumber ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'کد پستی',
|
||||||
|
content: item.unitPostalCode ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
|
||||||
|
itemList(
|
||||||
|
title: 'استان',
|
||||||
|
content: item.province ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
itemList(
|
||||||
|
title: 'شهر',
|
||||||
|
content: item.city ?? 'نامشخص',
|
||||||
|
visible: item.unitName != null,
|
||||||
|
),
|
||||||
|
itemList(title: 'آدرس', content: item.unitAddress ?? 'نامشخص'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller.isUnitInformationOpen,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ObxValue(
|
||||||
|
(isOpen) =>
|
||||||
|
AnimatedPositioned(
|
||||||
|
right: 16,
|
||||||
|
top: isOpen.value ? -2 : 11,
|
||||||
|
duration: Duration(milliseconds: 500),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||||
|
decoration: isOpen.value
|
||||||
|
? BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
child: Text(
|
||||||
|
'اطلاعات صنفی',
|
||||||
|
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
controller.isUnitInformationOpen,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget itemList({
|
Widget itemList({
|
||||||
@@ -288,33 +465,38 @@ class ProfilePage extends GetView<ProfileLogic> {
|
|||||||
required String content,
|
required String content,
|
||||||
String? icon,
|
String? icon,
|
||||||
bool hasColoredBox = false,
|
bool hasColoredBox = false,
|
||||||
}) => Container(
|
bool? visible,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h),
|
}) =>
|
||||||
decoration: BoxDecoration(
|
Visibility(
|
||||||
color: hasColoredBox ? AppColor.greenLight : Colors.transparent,
|
visible: visible ?? true,
|
||||||
borderRadius: BorderRadius.circular(8),
|
child: Container(
|
||||||
border: hasColoredBox
|
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h),
|
||||||
? Border.all(width: 0.25, color: AppColor.bgDark)
|
decoration: BoxDecoration(
|
||||||
: Border.all(width: 0, color: Colors.transparent),
|
color: hasColoredBox ? AppColor.greenLight : Colors.transparent,
|
||||||
),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Row(
|
border: hasColoredBox
|
||||||
spacing: 4,
|
? Border.all(width: 0.25, color: AppColor.bgDark)
|
||||||
children: [
|
: Border.all(width: 0, color: Colors.transparent),
|
||||||
if (icon != null)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(left: 8.0),
|
|
||||||
child: SvgGenImage.vec(icon).svg(
|
|
||||||
width: 20.w,
|
|
||||||
height: 20.h,
|
|
||||||
colorFilter: ColorFilter.mode(AppColor.mediumGreyNormalActive, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyNormalActive)),
|
child: Row(
|
||||||
Spacer(),
|
spacing: 4,
|
||||||
Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.mediumGreyNormalHover)),
|
children: [
|
||||||
],
|
if (icon != null)
|
||||||
),
|
Padding(
|
||||||
);
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: SvgGenImage.vec(icon).svg(
|
||||||
|
width: 20.w,
|
||||||
|
height: 20.h,
|
||||||
|
colorFilter: ColorFilter.mode(AppColor.textColor, BlendMode.srcIn),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(title, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||||
|
Spacer(),
|
||||||
|
Text(content, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
Widget cardActionWidget({
|
Widget cardActionWidget({
|
||||||
required String title,
|
required String title,
|
||||||
@@ -458,11 +640,11 @@ class ProfilePage extends GetView<ProfileLogic> {
|
|||||||
child: Center(
|
child: Center(
|
||||||
child: data.value == null
|
child: data.value == null
|
||||||
? Padding(
|
? Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
controller.userProfile.value.data?.image ?? '',
|
controller.userProfile.value.data?.image ?? '',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: rasadyar_app
|
name: rasadyar_app
|
||||||
description: "A new Flutter project."
|
description: "A new Flutter project."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 1.3.25+22
|
version: 1.3.26+23
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.9.2
|
sdk: ^3.9.2
|
||||||
|
|||||||
Reference in New Issue
Block a user