feat : add supervision

This commit is contained in:
2025-04-16 15:53:58 +03:30
parent 8f93a5c893
commit a413aa47ea
6 changed files with 119 additions and 5 deletions

View File

@@ -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<int, Widget> 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();
}
}

View File

@@ -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<AddSupervisionLogic> {
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<int>(
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: 'کد اقتصادی'),
],
),
);
}
}

View File

@@ -473,7 +473,6 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
vecWidgetWithOnTap(
assets: Assets.vecMapSvg,
onTap: () {
eLog('vecWidgetWithOnTap ==> Assets.vecMapSvg');
Get.toNamed(SupervisionRoutes.supervisionLocationDetails);
},
width: 24,
@@ -485,7 +484,9 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
width: 24,
height: 24,
color: AppColor.greenNormal,
onTap: () {},
onTap: () {
Get.toNamed(SupervisionRoutes.supervisionAddSupervision);
},
),
vecWidgetWithOnTap(

View File

@@ -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()),
),
];
}

View File

@@ -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';
}

View File

@@ -11,6 +11,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
final TextStyle? titleTextStyle;
final VoidCallback? onBackPressed;
final List<Widget>? 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),