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],
onTap: () {
controller.updateSelectedIndex(index);
},
isSelected: controller.selectedIndex.value == index,
);
@@ -67,8 +66,9 @@ class ActionPage extends GetView<ActionLogic> {
child: ROutlinedElevated(
text: 'خیر',
onPressed: () {
controller.updateSelectedIndex(controller.previousIndex.value);
controller.updateSelectedIndex(
controller.previousIndex.value,
);
Get.back();
},
@@ -101,7 +101,7 @@ class ActionPage extends GetView<ActionLogic> {
Container statisticsWidget() => Container(
margin: EdgeInsets.only(top: 50),
padding: EdgeInsets.symmetric(horizontal: 35, vertical: 50),
padding: EdgeInsets.symmetric(vertical: 50),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
@@ -113,8 +113,7 @@ class ActionPage extends GetView<ActionLogic> {
children: [
Container(
height: 32,
margin: EdgeInsets.only(top: 10, left: 22, right: 22),
margin: EdgeInsets.symmetric(horizontal: 22,vertical: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
@@ -143,6 +142,7 @@ class ActionPage extends GetView<ActionLogic> {
],
),
),
optionWidget(
selected: controller.filter1Index,
title: 'فیلترتراکنش ها',
@@ -155,28 +155,30 @@ class ActionPage extends GetView<ActionLogic> {
),
SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
vecWidgetWithOnTap(
assets: Assets.vecPdfDownloadSvg,
onTap: () {},
width: 64,
height: 64,
),
vecWidgetWithOnTap(
assets: Assets.vecExcelDownloadSvg,
onTap: () {},
width: 64,
height: 64,
),
],
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
vecWidgetWithOnTap(
assets: Assets.vecPdfDownloadSvg,
onTap: () {},
width: 64,
height: 64,
),
vecWidgetWithOnTap(
assets: Assets.vecExcelDownloadSvg,
onTap: () {},
width: 64,
height: 64,
),
],
),
),
SizedBox(height: 16),
Row(
mainAxisAlignment: MainAxisAlignment.center,
spacing: 25,
spacing: 20,
children: [
headerInfo(title: 'تعداد تراکنش ها', description: '183 '),
headerInfo(
@@ -645,39 +647,46 @@ class ActionPage extends GetView<ActionLogic> {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
Row(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 22,vertical: 10),
child: Text(
title,
textAlign: TextAlign.center,
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
),
),
Wrap(
runSpacing: 8,
spacing: 8,
children:
options
.map(
(e) => ObxValue((data) {
return ChoiceChip(
onSelected: (value) {
selected.value = options.indexOf(e);
},
selectedColor: AppColor.blueNormal,
labelStyle:
data.value == options.indexOf(e)
? AppFonts.yekan13.copyWith(
color: AppColor.whiteLight,
)
: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyNormalActive,
),
checkmarkColor: Colors.white,
label: Text(e),
selected: options.indexOf(e) == data.value,
);
}, selected),
)
.toList(),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 30),
child: Wrap(
runSpacing: 8,
spacing: 8,
children:
options
.map(
(e) => ObxValue((data) {
return ChoiceChip(
onSelected: (value) {
selected.value = options.indexOf(e);
},
selectedColor: AppColor.blueNormal,
labelStyle:
data.value == options.indexOf(e)
? AppFonts.yekan13.copyWith(
color: AppColor.whiteLight,
)
: AppFonts.yekan12.copyWith(
color: AppColor.darkGreyNormalActive,
),
checkmarkColor: Colors.white,
label: Text(e),
selected: options.indexOf(e) == data.value,
);
}, selected),
)
.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

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

View File

@@ -47,14 +47,14 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
children: [
TileLayer(
urlTemplate:
"https://map.ir/shiveh/xyz/1.0.0/Shiveh:Shiveh@EPSG:3857@png/{z}/{x}/{y}.png"
"https://map.ir/shiveh/xyz/1.0.0/Shiveh:Shiveh@EPSG:3857@png/{z}/{x}/{y}.png"
"?x-api-key=$token",
),
ObxValue((markers) {
return MarkerLayer(
markers:
markers.map((marker) => markerWidget(marker)).toList(),
markers.map((marker) => markerWidget(marker)).toList(),
);
}, controller.markers),
],
@@ -72,9 +72,9 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
onPressed: () {
controller.isLoading.value = true;
controller.determineCurrentPosition().then(
(value) =>
controller.isLoading.value =
!controller.isLoading.value,
(value) =>
controller.isLoading.value =
!controller.isLoading.value,
);
},
);
@@ -87,21 +87,21 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
backgroundColor: AppColor.blueNormal,
icon: vecWidget(Assets.vecFilterSvg, width: 24, height: 24),
onPressed: () {
if (controller.bottomSheetStep.value !=
BottomSheetStep.filter) {
controller.bottomSheetStep.value = BottomSheetStep.filter;
}
controller.sheetController.value.toggle();
controller.sheetController.value.addBottomSheet(child: filterWidget(),
initHeight: 400,
maxHeight: 470,
minHeight: 350);
},
),
),
Obx(
() => Stack(
children:
() =>
Stack(
children:
controller.sheetController.value.bottomSheets
.map((sheet) => sheet)
.toList(),
),
),
),
],
),
@@ -567,27 +567,28 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
...List.generate(
5,
(index) => Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
(index) =>
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'فروش رفته',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
children: [
Text(
'فروش رفته',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
Text(
'0 کیلوگرم',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
Text(
'0 کیلوگرم',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
),
],
),
@@ -611,17 +612,17 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
color: isSelected ? AppColor.blueNormal : AppColor.whiteGreyNormal,
borderRadius: BorderRadius.circular(8),
border:
isSelected
? Border.fromBorderSide(BorderSide.none)
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
isSelected
? Border.fromBorderSide(BorderSide.none)
: Border.all(width: 0.25, color: const Color(0xFFB0B0B0)),
),
child: Text(
title,
textAlign: TextAlign.center,
style:
isSelected
? AppFonts.yekan10.copyWith(color: AppColor.whiteLight)
: AppFonts.yekan10,
isSelected
? AppFonts.yekan10.copyWith(color: AppColor.whiteLight)
: AppFonts.yekan10,
),
),
);

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);
},
isFullWidth: true,
height: 40,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
),
SizedBox(height: 25,)
],
),
),

View File

@@ -1,5 +1,7 @@
import 'package:rasadyar_core/core.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/view.dart';
import 'package:supervision/presentation/display_information/logic.dart';
@@ -58,5 +60,10 @@ sealed class SupervisionPages {
page: () => ProfilePage(),
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 supervisionUserProfile = '$supervision/userSettings';
static const supervisionLocationDetails = '$supervision/locationDetails';
static const supervisionAddSupervision = '$supervisionLocationDetails/addSupervision';
static const supervisionRegistrationOfViolation = '$supervisionAddSupervision/RegistrationOfViolation';
static const supervisionDisplayInformation = '$supervisionRegistrationOfViolation/DisplayInformation';
static const supervisionAddSupervision =
'$supervisionLocationDetails/addSupervision';
static const supervisionAddMobileInspector =
'$supervisionLocationDetails/addMobileInspector';
static const supervisionRegistrationOfViolation =
'$supervisionAddSupervision/RegistrationOfViolation';
static const supervisionDisplayInformation =
'$supervisionRegistrationOfViolation/DisplayInformation';
}