chore: clean up unused imports, update routing for authentication pages, and enhance UI components in the profile and captcha widgets
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/features/auth/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -84,7 +85,10 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 30,
|
||||
vertical: 10,
|
||||
),
|
||||
child: userProfileInformation(),
|
||||
),
|
||||
),
|
||||
@@ -99,18 +103,27 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
title: 'تغییر رمز عبور',
|
||||
selected: true,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
|
||||
Get.bottomSheet(
|
||||
changePasswordBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
);
|
||||
},
|
||||
icon: Assets.vec.lockSvg.path,
|
||||
),
|
||||
cardActionWidget(
|
||||
title: 'خروج',
|
||||
selected: true,
|
||||
color: ColorFilter.mode(Colors.redAccent, BlendMode.srcIn),
|
||||
color: ColorFilter.mode(
|
||||
Colors.redAccent,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
cardColor: Color(0xFFEFEFEF),
|
||||
textColor: AppColor.redDarkerText,
|
||||
onPressed: () {
|
||||
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
|
||||
Get.bottomSheet(
|
||||
exitBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
);
|
||||
},
|
||||
icon: Assets.vec.logoutSvg.path,
|
||||
),
|
||||
@@ -157,7 +170,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'اطلاعات هویتی',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Container(width: 37.w, height: 1.h, color: AppColor.greenNormal),
|
||||
],
|
||||
@@ -199,7 +214,11 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
content: /*item.province ??*/ 'نامشخص',
|
||||
icon: Assets.vec.pictureFrameSvg.path,
|
||||
),
|
||||
itemList(title: 'شهر', content: /* item.city ?? */ 'نامشخص', icon: Assets.vec.mapSvg.path),
|
||||
itemList(
|
||||
title: 'شهر',
|
||||
content: /* item.city ?? */ 'نامشخص',
|
||||
icon: Assets.vec.mapSvg.path,
|
||||
),
|
||||
],
|
||||
);
|
||||
/* return ObxValue((data) {
|
||||
@@ -300,12 +319,25 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
child: SvgGenImage.vec(icon).svg(
|
||||
width: 20.w,
|
||||
height: 20.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.mediumGreyNormalActive, BlendMode.srcIn),
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.mediumGreyNormalActive,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyNormalActive)),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyNormalActive,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
Text(content, style: AppFonts.yekan13.copyWith(color: AppColor.mediumGreyNormalHover)),
|
||||
Text(
|
||||
content,
|
||||
style: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.mediumGreyNormalHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -330,7 +362,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: ShapeDecoration(
|
||||
color: cardColor ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: SvgGenImage.vec(icon).svg(
|
||||
width: 40,
|
||||
@@ -347,7 +381,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan10.copyWith(
|
||||
color: textColor ?? (selected ? AppColor.blueNormal : AppColor.blueLightActive),
|
||||
color:
|
||||
textColor ??
|
||||
(selected ? AppColor.blueNormal : AppColor.blueLightActive),
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
@@ -365,7 +401,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'ویرایش اطلاعات هویتی',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Container(
|
||||
@@ -437,7 +475,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'عکس پروفایل',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
ObxValue((data) {
|
||||
return Container(
|
||||
@@ -446,15 +486,26 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLight),
|
||||
border: Border.all(
|
||||
width: 1,
|
||||
color: AppColor.blackLight,
|
||||
),
|
||||
),
|
||||
child: Center(
|
||||
child: data.value == null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
30,
|
||||
10,
|
||||
10,
|
||||
30,
|
||||
),
|
||||
child: Image.network(''),
|
||||
)
|
||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
||||
: Image.file(
|
||||
File(data.value!.path),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}, controller.selectedImage),
|
||||
@@ -467,14 +518,18 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
text: 'گالری',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
textStyle: AppFonts.yekan20.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
controller.selectedImage.value = await controller
|
||||
.imagePicker
|
||||
.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
@@ -482,14 +537,18 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
text: 'دوربین',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal),
|
||||
textStyle: AppFonts.yekan20.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
controller.selectedImage.value = await controller
|
||||
.imagePicker
|
||||
.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
@@ -568,7 +627,9 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'تغییر رمز عبور',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
SizedBox(),
|
||||
RTextField(
|
||||
@@ -664,7 +725,10 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text('خروج', style: AppFonts.yekan16Bold.copyWith(color: AppColor.error)),
|
||||
Text(
|
||||
'خروج',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.error),
|
||||
),
|
||||
SizedBox(),
|
||||
Text(
|
||||
'آیا مطمئن هستید که میخواهید از حساب کاربری خود خارج شوید؟',
|
||||
@@ -687,7 +751,10 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
.deleteModuleTokens(Module.liveStocks)
|
||||
.then((value) {
|
||||
Get.back();
|
||||
Get.offAllNamed(LiveStockRoutes.auth, arguments: Module.chicken);
|
||||
Get.offAllNamed(
|
||||
AuthLiveStockRoutes.auth,
|
||||
arguments: Module.liveStocks,
|
||||
);
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,19 +1,4 @@
|
||||
import 'package:rasadyar_core/core.dart' hide BaseLogic;
|
||||
import 'package:rasadyar_livestock/presentation/page/auth/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/auth/view.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/map/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/map/widget/map_widget/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/profile/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/request_tagging/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/request_tagging/view.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/requests/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/root/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/root/view.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/tagging/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/tagging/view.dart';
|
||||
import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart';
|
||||
import 'package:rasadyar_livestock/presentation/widgets/captcha/logic.dart';
|
||||
|
||||
import 'package:rasadyar_livestock/features/auth/presentation/routes/pages.dart';
|
||||
|
||||
part 'app_routes.dart';
|
||||
|
||||
@@ -21,7 +6,13 @@ sealed class LiveStockPages {
|
||||
LiveStockPages._();
|
||||
|
||||
static final pages = [
|
||||
GetPage(
|
||||
|
||||
//region Auth Pages
|
||||
...AuthLiveStockPages.pages,
|
||||
//endregion
|
||||
|
||||
|
||||
/* GetPage(
|
||||
name: LiveStockRoutes.auth,
|
||||
page: () => AuthPage(),
|
||||
binding: BindingsBuilder(() {
|
||||
@@ -67,6 +58,6 @@ sealed class LiveStockPages {
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => TaggingLogic());
|
||||
}),
|
||||
),
|
||||
), */
|
||||
];
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@ part of 'app_pages.dart';
|
||||
sealed class LiveStockRoutes {
|
||||
LiveStockRoutes._();
|
||||
|
||||
static const auth = '/AuthLiveStock';
|
||||
static const auth = AuthLiveStockRoutes.auth;
|
||||
|
||||
static const init = '/liveStock';
|
||||
static const requests = '/requests';
|
||||
static const map = '/map';
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_livestock/presentation/page/auth/logic.dart';
|
||||
import 'package:rasadyar_livestock/features/auth/presentation/pages/logic.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
@@ -14,13 +13,13 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: controller.getCaptcha,
|
||||
child: Container(
|
||||
width: 135,
|
||||
height: 50,
|
||||
height: 50.h,
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.whiteNormalHover,
|
||||
@@ -28,38 +27,50 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: controller.obx(
|
||||
(state) => Image.memory(base64Decode(state?.captchaImage ?? ''), fit: BoxFit.cover),
|
||||
(state) => Image.memory(
|
||||
base64Decode(state?.captchaImage ?? ''),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
onLoading: const Center(
|
||||
child: CupertinoActivityIndicator(color: AppColor.blueNormal),
|
||||
),
|
||||
onError: (error) {
|
||||
return Center(
|
||||
child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)),
|
||||
child: Text(
|
||||
'خطا ',
|
||||
style: AppFonts.yekan13.copyWith(color: Colors.red),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 8),
|
||||
SizedBox(width: 2.w),
|
||||
|
||||
IconButton(
|
||||
onPressed: controller.getCaptcha,
|
||||
icon: Icon(Icons.refresh, color: AppColor.textColor),
|
||||
),
|
||||
|
||||
SizedBox(width: 2.w),
|
||||
|
||||
Expanded(
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: RTextField(
|
||||
height: 50.h,
|
||||
isFullHeight: true,
|
||||
label: 'کد امنیتی',
|
||||
controller: controller.textController,
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: AppColor.textColor, width: 1),
|
||||
borderColor: AppColor.textColor,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
decimal: false,
|
||||
signed: false,
|
||||
),
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: false, signed: false),
|
||||
maxLines: 1,
|
||||
maxLength: 6,
|
||||
suffixIcon: (controller.textController.text.trim().isNotEmpty ?? false)
|
||||
? clearButton(() => controller.textController.clear())
|
||||
: null,
|
||||
|
||||
suffix: clearButton(() => controller.textController.clear()),
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'کد امنیتی را وارد کنید';
|
||||
@@ -67,10 +78,8 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
|
||||
return null;
|
||||
},
|
||||
onChanged: (pass) {
|
||||
if (pass.length == 6) {
|
||||
if (controller.formKey.currentState?.validate() ?? false) {
|
||||
Get.find<AuthLogic>().isDisabled.value = false;
|
||||
}
|
||||
if (controller.formKey.currentState?.validate() ?? false) {
|
||||
Get.find<AuthLogic>().isDisabled.value = false;
|
||||
}
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
|
||||
Reference in New Issue
Block a user