diff --git a/assets/icons/calendar_search.svg b/assets/icons/calendar_search.svg new file mode 100644 index 0000000..59ed538 --- /dev/null +++ b/assets/icons/calendar_search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/diagram.svg b/assets/icons/diagram.svg new file mode 100644 index 0000000..7e505bd --- /dev/null +++ b/assets/icons/diagram.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/logout.svg b/assets/icons/logout.svg new file mode 100644 index 0000000..c5a263d --- /dev/null +++ b/assets/icons/logout.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/profile_user.svg b/assets/icons/profile_user.svg new file mode 100644 index 0000000..c9218f9 --- /dev/null +++ b/assets/icons/profile_user.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/vec/calendar.svg.vec b/assets/vec/calendar.svg.vec new file mode 100644 index 0000000..17a6d46 Binary files /dev/null and b/assets/vec/calendar.svg.vec differ diff --git a/assets/vec/calendar_search.svg.vec b/assets/vec/calendar_search.svg.vec new file mode 100644 index 0000000..199ea1a Binary files /dev/null and b/assets/vec/calendar_search.svg.vec differ diff --git a/assets/vec/diagram.svg.vec b/assets/vec/diagram.svg.vec new file mode 100644 index 0000000..74ab003 Binary files /dev/null and b/assets/vec/diagram.svg.vec differ diff --git a/assets/vec/logout.svg.vec b/assets/vec/logout.svg.vec new file mode 100644 index 0000000..8ea1d5f Binary files /dev/null and b/assets/vec/logout.svg.vec differ diff --git a/assets/vec/profile_user.svg.vec b/assets/vec/profile_user.svg.vec new file mode 100644 index 0000000..4d9a07d Binary files /dev/null and b/assets/vec/profile_user.svg.vec differ diff --git a/features/supervision/lib/presentation/add_supervision/logic.dart b/features/supervision/lib/presentation/add_supervision/logic.dart index c818ce8..9717b08 100644 --- a/features/supervision/lib/presentation/add_supervision/logic.dart +++ b/features/supervision/lib/presentation/add_supervision/logic.dart @@ -3,6 +3,11 @@ import 'package:rasadyar_core/core.dart'; class AddSupervisionLogic extends GetxController { RxInt selectedSegment = 0.obs; + RxInt selectedTypeOfOwnership = 0.obs; + RxInt selectedUnitType = 0.obs; + RxInt selectedAccompanyingInspectors = 0.obs; + + List tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر']; // The data for the segments final Map segments = { @@ -18,8 +23,6 @@ class AddSupervisionLogic extends GetxController { ), }; - - @override void onReady() { // TODO: implement onReady diff --git a/features/supervision/lib/presentation/add_supervision/view.dart b/features/supervision/lib/presentation/add_supervision/view.dart index 014c45b..483fc95 100644 --- a/features/supervision/lib/presentation/add_supervision/view.dart +++ b/features/supervision/lib/presentation/add_supervision/view.dart @@ -1,7 +1,9 @@ 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/inputs/r_input.dart'; import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart'; +import 'package:supervision/supervision.dart'; import 'logic.dart'; @@ -21,42 +23,97 @@ class AddSupervisionPage extends GetView { height: 16, ), ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - spacing: 16, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(22, 13, 22, 4), - child: Text( + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 16, + children: [ + Text( 'نوع پروانه کسب', textAlign: TextAlign.center, style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), ), - ), - ObxValue((data) { - return NewCupertinoSegmentedControl( - padding: EdgeInsetsDirectional.symmetric( - horizontal: 20, - vertical: 10, - ), - children: controller.segments, - groupValue: data.value, - selectedColor: AppColor.blueNormal, - unselectedColor: Colors.white, - borderColor: Colors.grey.shade300, - onValueChanged: (int value) { - data.value = value; + ObxValue((data) { + return NewCupertinoSegmentedControl( + 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); }, - ); - }, controller.selectedSegment), - - RTextField(label: 'صادر کننده پروانه'), - RTextField(label: 'شماره مجوز'), - RTextField(label: 'شماره ثبت'), - RTextField(label: 'کد اقتصادی'), - ], + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), ), ); } + + Column optionWidget(RxInt selected) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'نوع پروانه کسب', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + + SizedBox( + height: 75, + child: ListView.separated( + shrinkWrap: true, + padding: EdgeInsets.all(16), + scrollDirection: Axis.horizontal, + itemBuilder: + (context, index) => ObxValue((data) { + return ChoiceChip( + onSelected: (value) { + selected.value = index; + }, + selectedColor: AppColor.blueNormal, + labelStyle: + data.value == index + ? AppFonts.yekan13.copyWith( + color: AppColor.whiteLight, + ) + : AppFonts.yekan12.copyWith( + color: AppColor.darkGreyNormalActive, + ), + checkmarkColor: Colors.white, + label: Text(controller.tmpLs[index]), + selected: index == data.value, + ); + }, selected), + + separatorBuilder: (context, index) => SizedBox(width: 8), + itemCount: controller.tmpLs.length, + ), + ), + ], + ); + } } diff --git a/features/supervision/lib/presentation/display_information/logic.dart b/features/supervision/lib/presentation/display_information/logic.dart new file mode 100644 index 0000000..e90fe4d --- /dev/null +++ b/features/supervision/lib/presentation/display_information/logic.dart @@ -0,0 +1,3 @@ +import 'package:rasadyar_core/core.dart'; + +class DisplayInformationLogic extends GetxController {} diff --git a/features/supervision/lib/presentation/display_information/view.dart b/features/supervision/lib/presentation/display_information/view.dart new file mode 100644 index 0000000..9b4ddca --- /dev/null +++ b/features/supervision/lib/presentation/display_information/view.dart @@ -0,0 +1,421 @@ +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/inputs/r_input.dart'; +import 'package:supervision/supervision.dart'; + +import 'logic.dart'; + +class DisplayInformationPage extends GetView { + const DisplayInformationPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: RAppBar( + title: 'نمایش اطلاعات', + leading: vecWidget( + Assets.vecMessageAddSvg, + color: AppColor.blueNormal, + width: 16, + height: 16, + ), + ), + + body: SingleChildScrollView( + child: Column( + spacing: 20, + children: [ + markerDetailsWidget(), + accompanyingInspectorsWidget(), + accompanyingInspectorsWidget(), + violationWidget(), + violationWidget(), + ratingbarWidget() + + ], + ), + ),); + } + + Widget ratingbarWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(35, 5, 35, 35), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ Text('به این صنف امتیاز دهید',style: AppFonts.yekan12,),], + ), + + SizedBox(height: 12,), + RatingBar.builder( + initialRating: 3, + minRating: 1, + direction: Axis.horizontal, + allowHalfRating: true, + itemCount: 5, + wrapAlignment: WrapAlignment.center, + itemPadding: EdgeInsets.symmetric(horizontal: 4.0), + itemBuilder: (context, _) => + Icon( + Icons.star, + color: Colors.amber, + ), + onRatingUpdate: (rating) { + + }, + ), + + + Row( + children: [ + Expanded( + child: RElevated( + height: 40, + text: 'ثبت', onPressed: (){})), + SizedBox(width: 8,), + Expanded(child: ROutlinedElevated( + height: 40, + text: 'انصراف', onPressed: (){ + Get.offAllNamed(SupervisionRoutes.supervision); + })) + ], + ) + ], + ), + ); + } +} + +Widget violationWidget() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + 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, + + ), + RTextField( + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 5, + minLines: 5, + + ), + RTextField( + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + + ), + RTextField( + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + + ), + RTextField( + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 5, + minLines: 5, + + ), + + ], + ), + ); +} + +Widget markerDetailsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'ایجاد بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + ...List.generate( + 5, + (index) => + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'فروش رفته', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0 کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + ], + ), + ); +} + +Widget accompanyingInspectorsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'بازرس همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'نام و نام خانوادگی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + 'آیدا گل محمدی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ], + ), + ); +} diff --git a/features/supervision/lib/presentation/filter/logic.dart b/features/supervision/lib/presentation/filter/logic.dart index 55b7f5a..2eaec13 100644 --- a/features/supervision/lib/presentation/filter/logic.dart +++ b/features/supervision/lib/presentation/filter/logic.dart @@ -169,7 +169,7 @@ class SupervisionFilterLogic extends GetxController @override void onClose() { - // TODO: implement onClose + super.onClose(); } } diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart index d18094e..16fefd7 100644 --- a/features/supervision/lib/presentation/filter/view.dart +++ b/features/supervision/lib/presentation/filter/view.dart @@ -182,12 +182,7 @@ class SupervisionFilterPage extends GetView { ), CustomSlidableAction( onPressed: (context) { - controller.sheetController.value.addBottomSheet( - child: LocationDetailsPage(), - initHeight: 500, - maxHeight: Get.height * 2, - minHeight: 0, - ); + Get.toNamed(SupervisionRoutes.supervisionAddSupervision); }, backgroundColor: AppColor.greenNormal, padding: EdgeInsets.all(16), @@ -473,6 +468,7 @@ class SupervisionFilterPage extends GetView { vecWidgetWithOnTap( assets: Assets.vecMapSvg, onTap: () { + Get.toNamed(SupervisionRoutes.supervisionLocationDetails); }, width: 24, @@ -485,6 +481,7 @@ class SupervisionFilterPage extends GetView { height: 24, color: AppColor.greenNormal, onTap: () { + Get.toNamed(SupervisionRoutes.supervisionAddSupervision); }, ), diff --git a/features/supervision/lib/presentation/registration_of_violation/logic.dart b/features/supervision/lib/presentation/registration_of_violation/logic.dart new file mode 100644 index 0000000..ba48ff1 --- /dev/null +++ b/features/supervision/lib/presentation/registration_of_violation/logic.dart @@ -0,0 +1,5 @@ +import 'package:rasadyar_core/core.dart'; + +class RegistrationOfViolationLogic extends GetxController { + RxInt countViolation = 1.obs; +} diff --git a/features/supervision/lib/presentation/registration_of_violation/view.dart b/features/supervision/lib/presentation/registration_of_violation/view.dart new file mode 100644 index 0000000..5ddb3ac --- /dev/null +++ b/features/supervision/lib/presentation/registration_of_violation/view.dart @@ -0,0 +1,105 @@ +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/registration_of_violation/logic.dart'; +import 'package:supervision/presentation/routes/app_routes.dart'; + +class RegistrationOfViolationPage + extends GetView { + const RegistrationOfViolationPage({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.countViolation.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: 8,vertical: 12), + 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, + + ), + RTextField( + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 5, + minLines: 5, + + ), + RTextField( + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + + ), + RTextField( + label: 'عنوان تخلف', + filled: true, + filledColor: AppColor.whiteLight, + + ), + RTextField( + label: 'توضیحات تخلف', + filled: true, + filledColor: AppColor.whiteLight, + maxLines: 5, + minLines: 5, + + ), + + ], + ), + ) , + separatorBuilder: (context, index) => SizedBox(height: 15,), + itemCount: data.value, + ); + },controller.countViolation), + ), + + RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(SupervisionRoutes.supervisionDisplayInformation); + }, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), + ), + ); + } +} diff --git a/features/supervision/lib/presentation/root/logic.dart b/features/supervision/lib/presentation/root/logic.dart index a2f73b3..82d44bc 100644 --- a/features/supervision/lib/presentation/root/logic.dart +++ b/features/supervision/lib/presentation/root/logic.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:supervision/presentation/actions/view.dart'; import 'package:supervision/presentation/filter/view.dart'; class RootLogic extends GetxController { RxInt currentIndex = 0.obs; List pages = [ SupervisionFilterPage(), - Placeholder(color: Colors.red), + ActionsPage(), Placeholder(color: Colors.amber), ]; diff --git a/features/supervision/lib/presentation/routes/app_pages.dart b/features/supervision/lib/presentation/routes/app_pages.dart index fc4fae2..d0fd20c 100644 --- a/features/supervision/lib/presentation/routes/app_pages.dart +++ b/features/supervision/lib/presentation/routes/app_pages.dart @@ -1,9 +1,14 @@ import 'package:rasadyar_core/core.dart'; +import 'package:supervision/presentation/actions/logic.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'; +import 'package:supervision/presentation/display_information/view.dart'; import 'package:supervision/presentation/filter/logic.dart'; import 'package:supervision/presentation/location_details/logic.dart'; import 'package:supervision/presentation/location_details/view.dart'; +import 'package:supervision/presentation/registration_of_violation/logic.dart'; +import 'package:supervision/presentation/registration_of_violation/view.dart'; import 'package:supervision/presentation/root/logic.dart'; import 'package:supervision/presentation/root/view.dart'; import 'package:supervision/presentation/routes/app_routes.dart'; @@ -19,6 +24,7 @@ sealed class SupervisionPages { Get.put(RootLogic()); Get.put(SupervisionFilterLogic()); Get.lazyPut(() => LocationDetailsLogic(), fenix: true); + Get.lazyPut(() => ActionsLogic(), fenix: true); }), ), @@ -33,5 +39,14 @@ sealed class SupervisionPages { page: () => AddSupervisionPage(), binding: BindingsBuilder.put(() => AddSupervisionLogic()), ), + GetPage( + name: SupervisionRoutes.supervisionRegistrationOfViolation, + page: () => RegistrationOfViolationPage(), + binding: BindingsBuilder.put(() => RegistrationOfViolationLogic()), + ), GetPage( + name: SupervisionRoutes.supervisionDisplayInformation, + page: () => DisplayInformationPage(), + binding: BindingsBuilder.put(() => DisplayInformationLogic()), + ), ]; } diff --git a/features/supervision/lib/presentation/routes/app_routes.dart b/features/supervision/lib/presentation/routes/app_routes.dart index 87ea34d..011dee1 100644 --- a/features/supervision/lib/presentation/routes/app_routes.dart +++ b/features/supervision/lib/presentation/routes/app_routes.dart @@ -5,6 +5,8 @@ sealed class SupervisionRoutes { static const supervisionAction = '$supervision/action'; static const supervisionUserSetting = '$supervision/userSettings'; static const supervisionLocationDetails = '$supervision/locationDetails'; - static const supervisionAddSupervision = - '$supervisionLocationDetails/addSupervision'; + static const supervisionAddSupervision = '$supervisionLocationDetails/addSupervision'; + static const supervisionRegistrationOfViolation = '$supervisionAddSupervision/RegistrationOfViolation'; + static const supervisionDisplayInformation = '$supervisionRegistrationOfViolation/DisplayInformation'; + } diff --git a/features/supervision/pubspec.lock b/features/supervision/pubspec.lock index 24150a4..fa96362 100644 --- a/features/supervision/pubspec.lock +++ b/features/supervision/pubspec.lock @@ -110,6 +110,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: transitive description: diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..e549ee2 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/core/lib/presentation/common/assets.dart/assets.dart b/lib/presentations/common/assets.dart similarity index 74% rename from core/lib/presentation/common/assets.dart/assets.dart rename to lib/presentations/common/assets.dart index 9d075b7..de73abf 100644 --- a/core/lib/presentation/common/assets.dart/assets.dart +++ b/lib/presentations/common/assets.dart @@ -5,17 +5,23 @@ class Assets { static const String iconsAdd = 'assets/icons/add.svg'; static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; + static const String iconsCalendar = 'assets/icons/calendar.svg'; + static const String iconsCalendarSearch = 'assets/icons/calendar_search.svg'; static const String iconsCall = 'assets/icons/call.svg'; + static const String iconsDiagram = 'assets/icons/diagram.svg'; static const String iconsDownload = 'assets/icons/download.svg'; static const String iconsEdit = 'assets/icons/edit.svg'; static const String iconsFilter = 'assets/icons/filter.svg'; static const String iconsGps = 'assets/icons/gps.svg'; static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsLogout = 'assets/icons/logout.svg'; static const String iconsMap = 'assets/icons/map.svg'; static const String iconsMapMarker = 'assets/icons/map_marker.svg'; static const String iconsMessageAdd = 'assets/icons/message_add.svg'; static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; + static const String iconsProfileUser = 'assets/icons/profile_user.svg'; static const String iconsScan = 'assets/icons/scan.svg'; + static const String iconsScanBarcode = 'assets/icons/scan_barcode.svg'; static const String iconsSecurityTime = 'assets/icons/security_time.svg'; static const String iconsSetting = 'assets/icons/setting.svg'; static const String iconsTrash = 'assets/icons/trash.svg'; @@ -24,16 +30,22 @@ class Assets { static const String vecAddSvg = 'assets/vec/add.svg.vec'; static const String vecArrowLeftSvg = 'assets/vec/arrow_left.svg.vec'; static const String vecArrowRightSvg = 'assets/vec/arrow_right.svg.vec'; + static const String vecCalendarSearchSvg = 'assets/vec/calendar_search.svg.vec'; + static const String vecCalendarSvg = 'assets/vec/calendar.svg.vec'; static const String vecCallSvg = 'assets/vec/call.svg.vec'; + static const String vecDiagramSvg = 'assets/vec/diagram.svg.vec'; static const String vecDownloadSvg = 'assets/vec/download.svg.vec'; static const String vecEditSvg = 'assets/vec/edit.svg.vec'; static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; static const String vecGpsSvg = 'assets/vec/gps.svg.vec'; static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecLogoutSvg = 'assets/vec/logout.svg.vec'; static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; static const String vecMapSvg = 'assets/vec/map.svg.vec'; static const String vecMessageAddSvg = 'assets/vec/message_add.svg.vec'; static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; + static const String vecProfileUserSvg = 'assets/vec/profile_user.svg.vec'; + static const String vecScanBarcodeSvg = 'assets/vec/scan_barcode.svg.vec'; static const String vecScanSvg = 'assets/vec/scan.svg.vec'; static const String vecSecurityTimeSvg = 'assets/vec/security_time.svg.vec'; static const String vecSettingSvg = 'assets/vec/setting.svg.vec'; diff --git a/packages/core/lib/core.dart b/packages/core/lib/core.dart index 5388a48..d3ea5ec 100644 --- a/packages/core/lib/core.dart +++ b/packages/core/lib/core.dart @@ -8,5 +8,6 @@ export 'package:rasadyar_core/presentation/widget/widget.dart'; //other packages export 'package:flutter_slidable/flutter_slidable.dart'; export 'package:font_awesome_flutter/font_awesome_flutter.dart'; +export 'package:flutter_rating_bar/flutter_rating_bar.dart'; diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index 6505e83..8116ba2 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -84,7 +84,7 @@ class AppColor { static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) //endregion - //region ---Dark Grey Colors --- + //region --- Grey Colors --- static const Color darkGreyLight = Color( 0xFFeaeaea, ); // #eaeaea rgb(234, 234, 234) @@ -357,6 +357,11 @@ class AppColor { 0xFF0a4953, ); // #0a4953 rgb(10, 73, 83) static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) + + + + static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64) + static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64) //endregion //region --- category Colors --- diff --git a/packages/core/lib/presentation/common/assets.dart b/packages/core/lib/presentation/common/assets.dart index 5eeb4c1..de73abf 100644 --- a/packages/core/lib/presentation/common/assets.dart +++ b/packages/core/lib/presentation/common/assets.dart @@ -5,16 +5,21 @@ class Assets { static const String iconsAdd = 'assets/icons/add.svg'; static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; + static const String iconsCalendar = 'assets/icons/calendar.svg'; + static const String iconsCalendarSearch = 'assets/icons/calendar_search.svg'; static const String iconsCall = 'assets/icons/call.svg'; + static const String iconsDiagram = 'assets/icons/diagram.svg'; static const String iconsDownload = 'assets/icons/download.svg'; static const String iconsEdit = 'assets/icons/edit.svg'; static const String iconsFilter = 'assets/icons/filter.svg'; static const String iconsGps = 'assets/icons/gps.svg'; static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsLogout = 'assets/icons/logout.svg'; static const String iconsMap = 'assets/icons/map.svg'; static const String iconsMapMarker = 'assets/icons/map_marker.svg'; static const String iconsMessageAdd = 'assets/icons/message_add.svg'; static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; + static const String iconsProfileUser = 'assets/icons/profile_user.svg'; static const String iconsScan = 'assets/icons/scan.svg'; static const String iconsScanBarcode = 'assets/icons/scan_barcode.svg'; static const String iconsSecurityTime = 'assets/icons/security_time.svg'; @@ -25,16 +30,21 @@ class Assets { static const String vecAddSvg = 'assets/vec/add.svg.vec'; static const String vecArrowLeftSvg = 'assets/vec/arrow_left.svg.vec'; static const String vecArrowRightSvg = 'assets/vec/arrow_right.svg.vec'; + static const String vecCalendarSearchSvg = 'assets/vec/calendar_search.svg.vec'; + static const String vecCalendarSvg = 'assets/vec/calendar.svg.vec'; static const String vecCallSvg = 'assets/vec/call.svg.vec'; + static const String vecDiagramSvg = 'assets/vec/diagram.svg.vec'; static const String vecDownloadSvg = 'assets/vec/download.svg.vec'; static const String vecEditSvg = 'assets/vec/edit.svg.vec'; static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; static const String vecGpsSvg = 'assets/vec/gps.svg.vec'; static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecLogoutSvg = 'assets/vec/logout.svg.vec'; static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; static const String vecMapSvg = 'assets/vec/map.svg.vec'; static const String vecMessageAddSvg = 'assets/vec/message_add.svg.vec'; static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; + static const String vecProfileUserSvg = 'assets/vec/profile_user.svg.vec'; static const String vecScanBarcodeSvg = 'assets/vec/scan_barcode.svg.vec'; static const String vecScanSvg = 'assets/vec/scan.svg.vec'; static const String vecSecurityTimeSvg = 'assets/vec/security_time.svg.vec'; diff --git a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart index df74c72..6fdecfb 100644 --- a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart +++ b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart @@ -42,6 +42,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { child: leading, ), actions: [ + if (additionalActions != null) ...additionalActions!, Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: IconButton( @@ -50,7 +51,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { color: iconColor, ), ), - if (additionalActions != null) ...additionalActions!, + ], ); } diff --git a/packages/core/lib/presentation/widget/buttons/elevated.dart b/packages/core/lib/presentation/widget/buttons/elevated.dart index 1aa97d9..3e4e5ff 100644 --- a/packages/core/lib/presentation/widget/buttons/elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/elevated.dart @@ -2,25 +2,27 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/presentation/common/app_color.dart'; import 'package:rasadyar_core/presentation/common/app_fonts.dart'; -class RElevated extends StatefulWidget { +class RElevated extends StatelessWidget { RElevated({ super.key, required this.text, required this.onPressed, - foregroundColor, - backgroundColor, - disabledBackgroundColor, - disabledForegroundColor, - radius, - textStyle, + this.foregroundColor, + this.backgroundColor, + this.disabledBackgroundColor, + this.disabledForegroundColor, + this.radius, + this.textStyle, this.width = 150.0, this.height = 56.0, + this.isFullWidth, }); final String text; final VoidCallback? onPressed; final double width; final double height; + final bool? isFullWidth; Color? foregroundColor; Color? backgroundColor; Color? disabledForegroundColor; @@ -28,29 +30,24 @@ class RElevated extends StatefulWidget { double? radius; TextStyle? textStyle; - @override - State createState() => _RElevatedState(); -} - -class _RElevatedState extends State { @override Widget build(BuildContext context) { return ElevatedButton( - onPressed: widget.onPressed, + onPressed: onPressed, style: ElevatedButton.styleFrom( - backgroundColor: widget.backgroundColor ?? AppColor.blueNormal, - foregroundColor: widget.foregroundColor ?? Colors.white, + backgroundColor: backgroundColor ?? AppColor.blueNormal, + foregroundColor: foregroundColor ?? Colors.white, disabledBackgroundColor: - widget.disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), - disabledForegroundColor: widget.disabledForegroundColor ?? Colors.white, + disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), + disabledForegroundColor: disabledForegroundColor ?? Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(widget.radius ?? 8), + borderRadius: BorderRadius.circular(radius ?? 8), ), - fixedSize: Size(widget.width, widget.height), + minimumSize: Size((isFullWidth ??false) ? double.infinity : width, height), padding: EdgeInsets.zero, - textStyle: widget.textStyle ?? AppFonts.yekan24, + textStyle: textStyle ?? AppFonts.yekan24, ), - child: Text(widget.text), + child: Text(text), ); } } diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart index 07edc2b..2d1b0f6 100644 --- a/packages/core/lib/presentation/widget/inputs/r_input.dart +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; @immutable class RTextField extends StatefulWidget { @@ -27,6 +28,7 @@ class RTextField extends StatefulWidget { this.minLines, this.radius, this.filled, + this.filledColor, this.enabled, this.errorStyle, this.labelStyle, @@ -61,6 +63,7 @@ class RTextField extends StatefulWidget { this.readonly = false, this.label, this.filled, + this.filledColor, this.errorStyle, this.labelStyle, this.enabled}) { @@ -95,6 +98,7 @@ class RTextField extends StatefulWidget { this.readonly = false, this.label, this.filled, + this.filledColor, this.errorStyle, this.labelStyle, this.enabled}) { @@ -132,6 +136,7 @@ class RTextField extends StatefulWidget { Widget? suffixIcon; Widget? prefixIcon; bool? filled; + Color? filledColor; bool _isPassword = false; final BoxConstraints? boxConstraints; @@ -204,8 +209,9 @@ class _RTextFieldState extends State { prefixIconConstraints: widget.boxConstraints, hintText: widget.hintText, labelText: widget.label, - labelStyle: widget.labelStyle, + labelStyle: widget.labelStyle??AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarkActive), filled: widget.filled, + fillColor: widget.filledColor, counter: widget.showCounter ? null : const SizedBox(), hintStyle: widget.hintStyle, enabledBorder: widget._inputBorder, diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock index a78dfca..31270d6 100644 --- a/packages/core/pubspec.lock +++ b/packages/core/pubspec.lock @@ -230,6 +230,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_rating_bar: + dependency: "direct main" + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: "direct main" description: diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 4e46e52..bcc2ec7 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: #UI cupertino_icons: ^1.0.8 flutter_slidable: ^4.0.0 + flutter_rating_bar: ^4.0.1 ##Log logger: ^2.5.0 @@ -42,6 +43,8 @@ dependencies: permission_handler: ^11.4.0 + + dev_dependencies: flutter_test: sdk: flutter diff --git a/pubspec.lock b/pubspec.lock index 106e938..91b7ffd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -254,6 +254,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: transitive description: