fix : change app architecture

feat : add some method to local storage
This commit is contained in:
2025-05-14 09:42:44 +03:30
parent e11ef1990c
commit feb3df6a06
50 changed files with 1007 additions and 70 deletions

View File

@@ -0,0 +1,17 @@
import 'package:rasadyar_core/core.dart';
class AddMobileInspectorLogic extends GetxController {
RxInt countInspector = 1.obs;
@override
void onReady() {
// TODO: implement onReady
super.onReady();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
}
}

View File

@@ -0,0 +1,123 @@
import 'package:flutter/material.dart';
import 'package:inspection/presentation/routes/app_routes.dart';
import 'package:rasadyar_core/core.dart';
import 'package:rasadyar_core/presentation/widget/buttons/fab.dart';
import 'logic.dart';
class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
const AddMobileInspectorPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: RAppBar(
title: 'افزودن بازرس همراه',
leading: vecWidget(
Assets.vecMessageAddSvg,
color: Colors.white,
width: 16,
height: 16,
),
additionalActions: [
RFab.smallAdd(onPressed: () => controller.countInspector.value++),
],
),
body: Column(
children: [
Expanded(
child: ObxValue((data) {
return ListView.separated(
padding: const EdgeInsets.fromLTRB(25, 10, 25, 0),
itemBuilder: (context, index) => mobileInspectorWidget(),
separatorBuilder: (context, index) => SizedBox(height: 15),
itemCount: data.value,
);
}, controller.countInspector),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 4, 20, 25),
child: RElevated(
text: 'مرحله بعد',
onPressed: () {
Get.toNamed(InspectionRoutes.inspectionRegistrationOfViolation);
},
height: 40,
isFullWidth: true,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
),
),
],
),
);
}
}
Container mobileInspectorWidget() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.7, color: AppColor.bgDark),
),
child: Column(
spacing: 16,
children: [
RTextField(
label: 'نام و نام خانوادگی',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'شماره مجوز',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'شماره ثبت',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
RTextField(
label: 'کد اقتصادی',
filled: true,
filledColor: AppColor.whiteLight,
padding: EdgeInsets.zero,
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 12),
child: SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(
child: RElevated(
text: 'ثبت',
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
onPressed: () {},
),
),
Expanded(
child: ROutlinedElevated(
text: 'انصراف',
textStyle: AppFonts.yekan16,
onPressed: () {},
),
),
],
),
),
),
],
),
);
}