1 - add mobile inspector
fix :
1 - fix ui onTap location
2 - fix ui action
This commit is contained in:
2025-04-22 14:42:42 +03:30
parent 0c750e1c01
commit 9751c5cee4
12 changed files with 326 additions and 381 deletions

View File

@@ -27,7 +27,6 @@ class ActionPage extends GetView<ActionLogic> {
title: controller.headersTitle[index], title: controller.headersTitle[index],
onTap: () { onTap: () {
controller.updateSelectedIndex(index); controller.updateSelectedIndex(index);
}, },
isSelected: controller.selectedIndex.value == index, isSelected: controller.selectedIndex.value == index,
); );
@@ -67,8 +66,9 @@ class ActionPage extends GetView<ActionLogic> {
child: ROutlinedElevated( child: ROutlinedElevated(
text: 'خیر', text: 'خیر',
onPressed: () { onPressed: () {
controller.updateSelectedIndex(
controller.updateSelectedIndex(controller.previousIndex.value); controller.previousIndex.value,
);
Get.back(); Get.back();
}, },
@@ -101,7 +101,7 @@ class ActionPage extends GetView<ActionLogic> {
Container statisticsWidget() => Container( Container statisticsWidget() => Container(
margin: EdgeInsets.only(top: 50), margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.symmetric(horizontal: 35, vertical: 50), padding: EdgeInsets.symmetric(vertical: 50),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
@@ -113,8 +113,7 @@ class ActionPage extends GetView<ActionLogic> {
children: [ children: [
Container( Container(
height: 32, height: 32,
margin: EdgeInsets.only(top: 10, left: 22, right: 22), margin: EdgeInsets.symmetric(horizontal: 22,vertical: 10),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@@ -143,6 +142,7 @@ class ActionPage extends GetView<ActionLogic> {
], ],
), ),
), ),
optionWidget( optionWidget(
selected: controller.filter1Index, selected: controller.filter1Index,
title: 'فیلترتراکنش ها', title: 'فیلترتراکنش ها',
@@ -155,9 +155,10 @@ class ActionPage extends GetView<ActionLogic> {
), ),
SizedBox(height: 10), SizedBox(height: 10),
Row( Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
vecWidgetWithOnTap( vecWidgetWithOnTap(
assets: Assets.vecPdfDownloadSvg, assets: Assets.vecPdfDownloadSvg,
@@ -173,10 +174,11 @@ class ActionPage extends GetView<ActionLogic> {
), ),
], ],
), ),
),
SizedBox(height: 16), SizedBox(height: 16),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
spacing: 25, spacing: 20,
children: [ children: [
headerInfo(title: 'تعداد تراکنش ها', description: '183 '), headerInfo(title: 'تعداد تراکنش ها', description: '183 '),
headerInfo( headerInfo(
@@ -645,13 +647,19 @@ class ActionPage extends GetView<ActionLogic> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 22,vertical: 10),
child: Text(
title, title,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
), ),
),
Wrap( Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Wrap(
runSpacing: 8, runSpacing: 8,
spacing: 8, spacing: 8,
children: children:
@@ -679,6 +687,7 @@ class ActionPage extends GetView<ActionLogic> {
) )
.toList(), .toList(),
), ),
),
], ],
); );
} }
@@ -711,5 +720,4 @@ class ActionPage extends GetView<ActionLogic> {
), ),
); );
} }
} }

View File

@@ -1,15 +0,0 @@
import 'package:rasadyar_core/core.dart';
class ActionsLogic extends GetxController with GetTickerProviderStateMixin{
RxInt currentIndex = 0.obs;
late Rx<SlidableController> slidController;
@override
void onInit() {
super.onInit();
slidController = SlidableController(this).obs;
}
}

View File

@@ -1,209 +0,0 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:supervision/presentation/actions/logic.dart';
class ActionsPage extends GetView<ActionsLogic> {
const ActionsPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Column(
children: [
SizedBox(height: 10),
ObxValue((data) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
cardActionWidget(
title: 'کاربران',
onPressed: () {
controller.currentIndex.value = 0;
},
icon: Assets.vecProfileUserSvg,
selected: data.value == 0,
),
cardActionWidget(
title: 'سوابق بازرسی من',
onPressed: () {
controller.currentIndex.value = 1;
},
icon: Assets.vecCalendarSearchSvg,
selected: data.value == 1,
),
cardActionWidget(
title: 'آمار',
onPressed: () {
controller.currentIndex.value = 2;
},
icon: Assets.vecDiagramSvg,
selected: data.value == 2,
),
cardActionWidget(
title: 'خروج از سامانه',
onPressed: () {
controller.currentIndex.value = 3;
},
icon: Assets.vecLogoutSvg,
selected: data.value == 3,
),
],
);
}, controller.currentIndex),
SizedBox(height: 20),
Expanded(
child: Column(
spacing: 13,
children: [
selectedLocationWidget(),
selectedLocationWidget(),
selectedLocationWidget(),
],
),
),
],
),
),
);
}
Widget selectedLocationWidget() {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Slidable(
key: Key('selectedLocationWidget'),
controller: controller.slidController.value,
endActionPane: ActionPane(
motion: StretchMotion(),
children: [
CustomSlidableAction(
onPressed: (context) {},
backgroundColor: AppColor.redNormal,
foregroundColor: AppColor.whiteLight,
padding: EdgeInsets.all(16),
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(8),
topRight: Radius.circular(8),
),
child: vecWidget(Assets.vecTrashSvg, width: 24, height: 24),
),
],
),
child: GestureDetector(
onTap: () {},
child: Container(
height: 58,
alignment: AlignmentDirectional.center,
padding: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.blackLightHover),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
spacing: 4,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'داود خرم مهری پور',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'03295224154',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'باقی مانده',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'0 کیلوگرم',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Column(
spacing: 4,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'باقی مانده',
style: AppFonts.yekan10.copyWith(
color: AppColor.blueNormal,
),
),
Text(
'0 کیلوگرم',
style: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
],
),
),
),
),
);
}
}
Widget cardActionWidget({
required String title,
required VoidCallback onPressed,
required String icon,
bool selected = false,
}) {
return GestureDetector(
onTap: onPressed,
child: Column(
children: [
Container(
width: 48,
height: 48,
padding: EdgeInsets.all(4),
decoration: ShapeDecoration(
color: selected ? AppColor.blueLightActive : AppColor.blueLight,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: vecWidget(
icon,
width: 40,
height: 40,
color: selected ? AppColor.blueNormalActive : AppColor.blueNormal,
),
),
SizedBox(height: 2),
Text(
title,
style: AppFonts.yekan10.copyWith(
color: selected ? AppColor.blueNormal : AppColor.blueLightActive,
),
),
],
),
);
}

View File

@@ -0,0 +1,17 @@
import 'package:rasadyar_core/core.dart';
class AddMobileInspectorLogic extends GetxController {
RxInt countInspector = 1.obs;
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@@ -0,0 +1,122 @@
import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/elevated.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart';
import 'package:supervision/presentation/routes/app_routes.dart';
import 'logic.dart';
class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
const AddMobileInspectorPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: RAppBar(
title: 'افزودن بازرس همراه',
leading: vecWidget(
Assets.vecMessageAddSvg,
color: AppColor.blueNormal,
width: 16,
height: 16,
),
additionalActions: [
RFab.smallAdd(onPressed: () => controller.countInspector.value++),
],
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: Column(
children: [
Expanded(
child: ObxValue((data) {
return ListView.separated(
itemBuilder:
(context, index) => Container(
padding: EdgeInsets.symmetric(
horizontal: 12,
vertical: 16,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.bgDark),
),
child: Column(
spacing: 16,
children: [
RTextField(
label: 'نام و نام خانوادگی',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'شماره مجوز',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'شماره ثبت',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'کد اقتصادی',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(
child: RElevated(
text: 'ثبت',
onPressed: () {},
),
),
Expanded(
child: ROutlinedElevated(
text: 'انصراف',
onPressed: () {},
),
),
],
),
),
),
],
),
),
separatorBuilder: (context, index) => SizedBox(height: 15),
itemCount: data.value,
);
}, controller.countInspector),
),
RElevated(
text: 'مرحله بعد',
onPressed: () {
Get.toNamed(SupervisionRoutes.supervisionRegistrationOfViolation);
},
isFullWidth: true,
height: 40,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
),
SizedBox(height: 25),
],
),
),
);
}
}

View File

@@ -27,11 +27,19 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
spacing: 16, spacing: 16,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 12,
children: [ children: [
Text( Text(
'نوع پروانه کسب', 'نوع پروانه کسب',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), style: AppFonts.yekan12.copyWith(
color: AppColor.blueNormal,
),
), ),
ObxValue((data) { ObxValue((data) {
@@ -52,20 +60,26 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
RTextField(label: 'شماره مجوز'), RTextField(label: 'شماره مجوز'),
RTextField(label: 'شماره ثبت'), RTextField(label: 'شماره ثبت'),
RTextField(label: 'کد اقتصادی'), RTextField(label: 'کد اقتصادی'),
],
),
),
optionWidget(controller.selectedTypeOfOwnership), optionWidget(controller.selectedTypeOfOwnership),
optionWidget(controller.selectedAccompanyingInspectors), optionWidget(controller.selectedAccompanyingInspectors),
optionWidget(controller.selectedUnitType), optionWidget(controller.selectedUnitType),
SizedBox(height: 25),
RElevated( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: RElevated(
text: 'مرحله بعد', text: 'مرحله بعد',
onPressed: () { onPressed: () {
Get.toNamed(SupervisionRoutes.supervisionRegistrationOfViolation); Get.toNamed(SupervisionRoutes.supervisionAddMobileInspector);
}, },
height: 40,
isFullWidth: true, isFullWidth: true,
backgroundColor: AppColor.greenNormal, backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white), textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
), ),
),
], ],
), ),
), ),
@@ -76,17 +90,20 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Text(
'نوع پروانه کسب', 'نوع پروانه کسب',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
), ),
),
SizedBox( SizedBox(
height: 75, height: 75,
child: ListView.separated( child: ListView.separated(
shrinkWrap: true, shrinkWrap: true,
padding: EdgeInsets.all(16), padding: EdgeInsets.all(20),
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: itemBuilder:
(context, index) => ObxValue((data) { (context, index) => ObxValue((data) {

View File

@@ -87,16 +87,16 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
backgroundColor: AppColor.blueNormal, backgroundColor: AppColor.blueNormal,
icon: vecWidget(Assets.vecFilterSvg, width: 24, height: 24), icon: vecWidget(Assets.vecFilterSvg, width: 24, height: 24),
onPressed: () { onPressed: () {
if (controller.bottomSheetStep.value != controller.sheetController.value.addBottomSheet(child: filterWidget(),
BottomSheetStep.filter) { initHeight: 400,
controller.bottomSheetStep.value = BottomSheetStep.filter; maxHeight: 470,
} minHeight: 350);
controller.sheetController.value.toggle();
}, },
), ),
), ),
Obx( Obx(
() => Stack( () =>
Stack(
children: children:
controller.sheetController.value.bottomSheets controller.sheetController.value.bottomSheets
.map((sheet) => sheet) .map((sheet) => sheet)
@@ -567,7 +567,8 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
...List.generate( ...List.generate(
5, 5,
(index) => Row( (index) =>
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,

View File

@@ -1,5 +0,0 @@
import 'package:get/get.dart';
class RdsLogic extends GetxController {
}

View File

@@ -1,15 +0,0 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'logic.dart';
class RdsPage extends StatelessWidget {
RdsPage({Key? key}) : super(key: key);
final RdsLogic logic = Get.put(RdsLogic());
@override
Widget build(BuildContext context) {
return Container();
}
}

View File

@@ -79,6 +79,18 @@ backgroundColor:AppColor.bgLight,
), ),
SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(child: RElevated(text: 'ثبت', onPressed: (){})),
Expanded(child:ROutlinedElevated(text: 'انصراف',onPressed: (){},) ),
],
),
)
], ],
), ),
) , ) ,
@@ -94,9 +106,11 @@ backgroundColor:AppColor.bgLight,
Get.toNamed(SupervisionRoutes.supervisionDisplayInformation); Get.toNamed(SupervisionRoutes.supervisionDisplayInformation);
}, },
isFullWidth: true, isFullWidth: true,
height: 40,
backgroundColor: AppColor.greenNormal, backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white), textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
), ),
SizedBox(height: 25,)
], ],
), ),
), ),

View File

@@ -1,5 +1,7 @@
import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_core/core.dart';
import 'package:supervision/presentation/action/logic.dart'; import 'package:supervision/presentation/action/logic.dart';
import 'package:supervision/presentation/add_mobile_inspector/logic.dart';
import 'package:supervision/presentation/add_mobile_inspector/view.dart';
import 'package:supervision/presentation/add_supervision/logic.dart'; import 'package:supervision/presentation/add_supervision/logic.dart';
import 'package:supervision/presentation/add_supervision/view.dart'; import 'package:supervision/presentation/add_supervision/view.dart';
import 'package:supervision/presentation/display_information/logic.dart'; import 'package:supervision/presentation/display_information/logic.dart';
@@ -58,5 +60,10 @@ sealed class SupervisionPages {
page: () => ProfilePage(), page: () => ProfilePage(),
binding: BindingsBuilder.put(() => ProfileLogic()), binding: BindingsBuilder.put(() => ProfileLogic()),
), ),
GetPage(
name: SupervisionRoutes.supervisionAddMobileInspector,
page: () => AddMobileInspectorPage(),
binding: BindingsBuilder.put(() => AddMobileInspectorLogic()),
),
]; ];
} }

View File

@@ -5,9 +5,12 @@ sealed class SupervisionRoutes {
static const supervisionAction = '$supervision/action'; static const supervisionAction = '$supervision/action';
static const supervisionUserProfile = '$supervision/userSettings'; static const supervisionUserProfile = '$supervision/userSettings';
static const supervisionLocationDetails = '$supervision/locationDetails'; static const supervisionLocationDetails = '$supervision/locationDetails';
static const supervisionAddSupervision = '$supervisionLocationDetails/addSupervision'; static const supervisionAddSupervision =
static const supervisionRegistrationOfViolation = '$supervisionAddSupervision/RegistrationOfViolation'; '$supervisionLocationDetails/addSupervision';
static const supervisionDisplayInformation = '$supervisionRegistrationOfViolation/DisplayInformation'; static const supervisionAddMobileInspector =
'$supervisionLocationDetails/addMobileInspector';
static const supervisionRegistrationOfViolation =
'$supervisionAddSupervision/RegistrationOfViolation';
static const supervisionDisplayInformation =
'$supervisionRegistrationOfViolation/DisplayInformation';
} }