feat : persian calendar and date picker

This commit is contained in:
2025-04-27 12:01:32 +03:30
parent b77e4e9095
commit 74c56d1c10
5 changed files with 233 additions and 243 deletions

View File

@@ -1,9 +1,7 @@
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/buttons/fab.dart';
import 'package:rasadyar_core/presentation/widget/inputs/r_input.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';
@@ -18,7 +16,7 @@ class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
title: 'افزودن بازرس همراه',
leading: vecWidget(
Assets.vecMessageAddSvg,
color: AppColor.blueNormal,
color: Colors.white,
width: 16,
height: 16,
),
@@ -32,88 +30,21 @@ class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
child: ObxValue((data) {
return ListView.separated(
padding: const EdgeInsets.fromLTRB(25, 10, 25, 0),
itemBuilder:
(context, index) =>
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: () {},
),
),
],
),
),
),
],
),
),
itemBuilder: (context, index) => mobileInspectorWidget(),
separatorBuilder: (context, index) => SizedBox(height: 15),
itemCount: data.value,
);
}, controller.countInspector),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 4, 20, 20),
padding: const EdgeInsets.fromLTRB(20, 4, 20, 25),
child: RElevated(
text: 'مرحله بعد',
onPressed: () {
Get.toNamed(InspectionRoutes.inspectionRegistrationOfViolation);
},
height: 50,
height: 40,
isFullWidth: true,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
@@ -123,4 +54,70 @@ class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
),
);
}
}
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: () {},
),
),
],
),
),
),
],
),
);
}