feat : action

add supervisons
This commit is contained in:
2025-04-19 16:50:36 +03:30
parent a413aa47ea
commit 3b693c7e60
34 changed files with 797 additions and 65 deletions

View File

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