feat : add supervision
This commit is contained in:
@@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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: 'کد اقتصادی'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -473,7 +473,6 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
|
|||||||
vecWidgetWithOnTap(
|
vecWidgetWithOnTap(
|
||||||
assets: Assets.vecMapSvg,
|
assets: Assets.vecMapSvg,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
eLog('vecWidgetWithOnTap ==> Assets.vecMapSvg');
|
|
||||||
Get.toNamed(SupervisionRoutes.supervisionLocationDetails);
|
Get.toNamed(SupervisionRoutes.supervisionLocationDetails);
|
||||||
},
|
},
|
||||||
width: 24,
|
width: 24,
|
||||||
@@ -485,7 +484,9 @@ class SupervisionFilterPage extends GetView<SupervisionFilterLogic> {
|
|||||||
width: 24,
|
width: 24,
|
||||||
height: 24,
|
height: 24,
|
||||||
color: AppColor.greenNormal,
|
color: AppColor.greenNormal,
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(SupervisionRoutes.supervisionAddSupervision);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
vecWidgetWithOnTap(
|
vecWidgetWithOnTap(
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import 'package:rasadyar_core/core.dart';
|
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/filter/logic.dart';
|
||||||
import 'package:supervision/presentation/location_details/logic.dart';
|
import 'package:supervision/presentation/location_details/logic.dart';
|
||||||
import 'package:supervision/presentation/location_details/view.dart';
|
import 'package:supervision/presentation/location_details/view.dart';
|
||||||
@@ -25,5 +27,11 @@ sealed class SupervisionPages {
|
|||||||
page: () => LocationDetailsPage(),
|
page: () => LocationDetailsPage(),
|
||||||
bindings: [BindingsBuilder.put(() => LocationDetailsLogic())],
|
bindings: [BindingsBuilder.put(() => LocationDetailsLogic())],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
GetPage(
|
||||||
|
name: SupervisionRoutes.supervisionAddSupervision,
|
||||||
|
page: () => AddSupervisionPage(),
|
||||||
|
binding: BindingsBuilder.put(() => AddSupervisionLogic()),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ sealed class SupervisionRoutes {
|
|||||||
SupervisionRoutes._();
|
SupervisionRoutes._();
|
||||||
|
|
||||||
static const supervision = '/supervision';
|
static const supervision = '/supervision';
|
||||||
static const supervisionAction = '/supervision/action';
|
static const supervisionAction = '$supervision/action';
|
||||||
static const supervisionUserSetting = '/supervision/userSettings';
|
static const supervisionUserSetting = '$supervision/userSettings';
|
||||||
static const supervisionLocationDetails= '/supervision/locationDetails';
|
static const supervisionLocationDetails = '$supervision/locationDetails';
|
||||||
|
static const supervisionAddSupervision =
|
||||||
|
'$supervisionLocationDetails/addSupervision';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
final TextStyle? titleTextStyle;
|
final TextStyle? titleTextStyle;
|
||||||
final VoidCallback? onBackPressed;
|
final VoidCallback? onBackPressed;
|
||||||
final List<Widget>? additionalActions;
|
final List<Widget>? additionalActions;
|
||||||
|
final Widget? leading;
|
||||||
|
|
||||||
const RAppBar({
|
const RAppBar({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -20,6 +21,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
this.titleTextStyle,
|
this.titleTextStyle,
|
||||||
this.onBackPressed,
|
this.onBackPressed,
|
||||||
this.additionalActions,
|
this.additionalActions,
|
||||||
|
this.leading,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -34,6 +36,11 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
titleTextStyle ??
|
titleTextStyle ??
|
||||||
AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
||||||
title: Text(title),
|
title: Text(title),
|
||||||
|
|
||||||
|
leading:Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 16),
|
||||||
|
child: leading,
|
||||||
|
),
|
||||||
actions: [
|
actions: [
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||||
|
|||||||
Reference in New Issue
Block a user