diff --git a/features/supervision/lib/presentation/add_supervision/logic.dart b/features/supervision/lib/presentation/add_supervision/logic.dart new file mode 100644 index 0000000..c818ce8 --- /dev/null +++ b/features/supervision/lib/presentation/add_supervision/logic.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +class AddSupervisionLogic extends GetxController { + RxInt selectedSegment = 0.obs; + + // The data for the segments + final Map segments = { + 0: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('دائم', style: AppFonts.yekan13), + ), + 1: Container( + padding: EdgeInsets.all(10), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(50)), + child: Text('موقت', style: AppFonts.yekan13), + ), + }; + + + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } +} diff --git a/features/supervision/lib/presentation/add_supervision/view.dart b/features/supervision/lib/presentation/add_supervision/view.dart new file mode 100644 index 0000000..014c45b --- /dev/null +++ b/features/supervision/lib/presentation/add_supervision/view.dart @@ -0,0 +1,62 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_core/presentation/widget/inputs/r_input.dart'; +import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart'; + +import 'logic.dart'; + +class AddSupervisionPage extends GetView { + const AddSupervisionPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.lightGreyLight, + appBar: RAppBar( + title: 'ایجاد بازرسی', + leading: vecWidget( + Assets.vecMessageAddSvg, + color: AppColor.blueNormal, + width: 16, + height: 16, + ), + ), + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 16, + children: [ + Padding( + padding: const EdgeInsets.fromLTRB(22, 13, 22, 4), + child: 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; + }, + ); + }, controller.selectedSegment), + + RTextField(label: 'صادر کننده پروانه'), + RTextField(label: 'شماره مجوز'), + RTextField(label: 'شماره ثبت'), + RTextField(label: 'کد اقتصادی'), + ], + ), + ); + } +} diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart index 932f5d7..d18094e 100644 --- a/features/supervision/lib/presentation/filter/view.dart +++ b/features/supervision/lib/presentation/filter/view.dart @@ -473,7 +473,6 @@ class SupervisionFilterPage extends GetView { vecWidgetWithOnTap( assets: Assets.vecMapSvg, onTap: () { - eLog('vecWidgetWithOnTap ==> Assets.vecMapSvg'); Get.toNamed(SupervisionRoutes.supervisionLocationDetails); }, width: 24, @@ -485,7 +484,9 @@ class SupervisionFilterPage extends GetView { width: 24, height: 24, color: AppColor.greenNormal, - onTap: () {}, + onTap: () { + Get.toNamed(SupervisionRoutes.supervisionAddSupervision); + }, ), vecWidgetWithOnTap( diff --git a/features/supervision/lib/presentation/routes/app_pages.dart b/features/supervision/lib/presentation/routes/app_pages.dart index 590f04b..fc4fae2 100644 --- a/features/supervision/lib/presentation/routes/app_pages.dart +++ b/features/supervision/lib/presentation/routes/app_pages.dart @@ -1,4 +1,6 @@ import 'package:rasadyar_core/core.dart'; +import 'package:supervision/presentation/add_supervision/logic.dart'; +import 'package:supervision/presentation/add_supervision/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'; @@ -25,5 +27,11 @@ sealed class SupervisionPages { page: () => LocationDetailsPage(), bindings: [BindingsBuilder.put(() => LocationDetailsLogic())], ), + + GetPage( + name: SupervisionRoutes.supervisionAddSupervision, + page: () => AddSupervisionPage(), + binding: BindingsBuilder.put(() => AddSupervisionLogic()), + ), ]; } diff --git a/features/supervision/lib/presentation/routes/app_routes.dart b/features/supervision/lib/presentation/routes/app_routes.dart index f5b027a..87ea34d 100644 --- a/features/supervision/lib/presentation/routes/app_routes.dart +++ b/features/supervision/lib/presentation/routes/app_routes.dart @@ -2,7 +2,9 @@ sealed class SupervisionRoutes { SupervisionRoutes._(); static const supervision = '/supervision'; - static const supervisionAction = '/supervision/action'; - static const supervisionUserSetting = '/supervision/userSettings'; - static const supervisionLocationDetails= '/supervision/locationDetails'; + static const supervisionAction = '$supervision/action'; + static const supervisionUserSetting = '$supervision/userSettings'; + static const supervisionLocationDetails = '$supervision/locationDetails'; + static const supervisionAddSupervision = + '$supervisionLocationDetails/addSupervision'; } 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 df1a0b9..df74c72 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 @@ -11,6 +11,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { final TextStyle? titleTextStyle; final VoidCallback? onBackPressed; final List? additionalActions; + final Widget? leading; const RAppBar({ super.key, @@ -20,6 +21,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { this.titleTextStyle, this.onBackPressed, this.additionalActions, + this.leading, }); @override @@ -34,6 +36,11 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { titleTextStyle ?? AppFonts.yekan16.copyWith(color: AppColor.blueNormal), title: Text(title), + + leading:Padding( + padding: const EdgeInsets.only(right: 16), + child: leading, + ), actions: [ Padding( padding: const EdgeInsets.symmetric(horizontal: 8),