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

View File

@@ -15,7 +15,7 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
title: 'ایجاد بازرسی', title: 'ایجاد بازرسی',
leading: vecWidget( leading: vecWidget(
Assets.vecMessageAddSvg, Assets.vecMessageAddSvg,
color: AppColor.blueNormal, color: Colors.white,
width: 16, width: 16,
height: 16, height: 16,
), ),
@@ -136,14 +136,14 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
), ),
Padding( Padding(
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20), padding: const EdgeInsets.fromLTRB(20, 0, 20, 25),
child: RElevated( child: RElevated(
text: 'مرحله بعد', text: 'مرحله بعد',
onPressed: () { onPressed: () {
Get.toNamed(controller.routes.first); Get.toNamed(controller.routes.first);
}, },
height: 50, height: 40,
isFullWidth: true, isFullWidth: true,
backgroundColor: AppColor.greenNormal, backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white), textStyle: AppFonts.yekan16.copyWith(color: Colors.white),

View File

@@ -1,8 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:rasadyar_core/core.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:inspection/inspection.dart';
import 'logic.dart'; import 'logic.dart';
@@ -12,6 +9,7 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: AppColor.bgLight,
appBar: RAppBar( appBar: RAppBar(
title: 'نمایش اطلاعات', title: 'نمایش اطلاعات',
leading: vecWidget( leading: vecWidget(
@@ -22,66 +20,77 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
), ),
), ),
body: SingleChildScrollView( body: Column(
child: Column( children: [
spacing: 20, Expanded(
children: [ child: SingleChildScrollView(
markerDetailsWidget(), physics: BouncingScrollPhysics(),
accompanyingInspectorsWidget(), child: Column(
accompanyingInspectorsWidget(), spacing: 20,
violationWidget(), children: [
violationWidget(), ratingbarWidget(),
ratingbarWidget() markerDetailsWidget(),
accompanyingInspectorsWidget(),
accompanyingInspectorsWidget(),
violationWidget(),
violationWidget(),
SizedBox(height: 30,)
],
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(20, 4, 20, 25),
child: Row(
children: [
Expanded(
child: RElevated(height: 40, text: 'ثبت', onPressed: () {}),
),
SizedBox(width: 8),
Expanded(
child: ROutlinedElevated(
height: 40,
text: 'انصراف',
onPressed: () {
Get.until((route) => route.isFirst);
},
),
),
],
),
),
], ],
), ),
),); );
} }
Widget ratingbarWidget() { Widget ratingbarWidget() {
return Padding( return Padding(
padding: const EdgeInsets.fromLTRB(35, 5, 35, 35), padding: const EdgeInsets.fromLTRB(35, 35, 35,0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Row( Row(
children: [ Text('به این صنف امتیاز دهید',style: AppFonts.yekan12,),], children: [Text('به این صنف امتیاز دهید', style: AppFonts.yekan12)],
), ),
SizedBox(height: 12,), SizedBox(height: 12),
RatingBar.builder( RatingBar.builder(
initialRating: 3, initialRating: 3,
minRating: 1, minRating: 1,
direction: Axis.horizontal, direction: Axis.horizontal,
allowHalfRating: true, allowHalfRating: true,
itemCount: 5, itemCount: 5,
wrapAlignment: WrapAlignment.center, wrapAlignment: WrapAlignment.center,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0), itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
itemBuilder: (context, _) => itemBuilder: (context, _) => Icon(Icons.star, color: Colors.amber),
Icon( onRatingUpdate: (rating) {},
Icons.star, ),
color: Colors.amber,
),
onRatingUpdate: (rating) {
},
),
Row(
children: [
Expanded(
child: RElevated(
height: 40,
text: 'ثبت', onPressed: (){})),
SizedBox(width: 8,),
Expanded(child: ROutlinedElevated(
height: 40,
text: 'انصراف', onPressed: (){
Get.until((route) => route.isFirst);
}))
],
)
], ],
), ),
); );
@@ -94,48 +103,40 @@ Widget violationWidget() {
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
border: Border.all(width: 1, color: AppColor.bgDark), border: Border.all(width: 0.7, color: AppColor.bgDark),
), ),
child: Column( child: Column(
spacing: 16, spacing: 16,
children: [ children: [
RTextField( RTextField(
label: 'عنوان تخلف', label: 'عنوان تخلف',
filled: true, filled: true,
filledColor: AppColor.whiteLight, filledColor: AppColor.whiteLight,
), ),
RTextField( RTextField(
label: 'توضیحات تخلف', label: 'توضیحات تخلف',
filled: true, filled: true,
filledColor: AppColor.whiteLight, filledColor: AppColor.whiteLight,
maxLines: 5, maxLines: 3,
minLines: 5, minLines: 3,
), ),
RTextField( RTextField(
label: 'عنوان تخلف', label: 'عنوان تخلف',
filled: true, filled: true,
filledColor: AppColor.whiteLight, filledColor: AppColor.whiteLight,
), ),
RTextField( RTextField(
label: 'عنوان تخلف', label: 'عنوان تخلف',
filled: true, filled: true,
filledColor: AppColor.whiteLight, filledColor: AppColor.whiteLight,
), ),
RTextField( RTextField(
label: 'توضیحات تخلف', label: 'توضیحات تخلف',
filled: true, filled: true,
filledColor: AppColor.whiteLight, filledColor: AppColor.whiteLight,
maxLines: 5, maxLines: 3,
minLines: 5, minLines: 3,
), ),
], ],
), ),
); );
@@ -261,28 +262,27 @@ Widget markerDetailsWidget() {
...List.generate( ...List.generate(
5, 5,
(index) => (index) => Row(
Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text( Text(
'فروش رفته', 'فروش رفته',
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith( style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover, color: AppColor.darkGreyDarkHover,
), ),
),
Text(
'0 کیلوگرم',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
), ),
Text(
'0 کیلوگرم',
textAlign: TextAlign.center,
style: AppFonts.yekan14.copyWith(
color: AppColor.darkGreyDarkHover,
),
),
],
),
), ),
], ],
), ),

View File

@@ -16,7 +16,7 @@ class RegistrationOfViolationPage
title: 'ثبت تخلف', title: 'ثبت تخلف',
leading: vecWidget( leading: vecWidget(
Assets.vecMessageAddSvg, Assets.vecMessageAddSvg,
color: AppColor.blueNormal, color: Colors.white,
width: 16, width: 16,
height: 16, height: 16,
), ),
@@ -31,93 +31,86 @@ class RegistrationOfViolationPage
Expanded( Expanded(
child: ObxValue((data) { child: ObxValue((data) {
return ListView.separated( return ListView.separated(
itemBuilder: itemBuilder: (context, index) => violationWidget(),
(context, index) => Container(
padding: EdgeInsets.symmetric(
horizontal: 8,
vertical: 12,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
border: Border.all(width: 0.75, color: AppColor.bgDark),
),
child: Column(
spacing: 16,
children: [
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(
child: RElevated(
text: 'ثبت',
onPressed: () {},
),
),
Expanded(
child: ROutlinedElevated(
text: 'انصراف',
onPressed: () {},
),
),
],
),
),
],
),
),
separatorBuilder: (context, index) => SizedBox(height: 15), separatorBuilder: (context, index) => SizedBox(height: 15),
itemCount: data.value, itemCount: data.value,
); );
}, controller.countViolation), }, controller.countViolation),
), ),
RElevated( Padding(
text: 'مرحله بعد', padding: const EdgeInsets.fromLTRB(0, 4, 0, 25),
onPressed: () { child: RElevated(
Get.toNamed(InspectionRoutes.inspectionDisplayInformation); text: 'مرحله بعد',
}, onPressed: () {
isFullWidth: true, Get.toNamed(InspectionRoutes.inspectionDisplayInformation);
height: 40, },
backgroundColor: AppColor.greenNormal, isFullWidth: true,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white), height: 40,
backgroundColor: AppColor.greenNormal,
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
),
), ),
SizedBox(height: 25),
], ],
), ),
), ),
); );
} }
} }
Container violationWidget() {
return Container(
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
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,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'عنوان تخلف',
filled: true,
filledColor: AppColor.whiteLight,
),
RTextField(
label: 'توضیحات تخلف',
filled: true,
filledColor: AppColor.whiteLight,
maxLines: 3,
minLines: 3,
),
SizedBox(
height: 40,
child: Row(
spacing: 16,
children: [
Expanded(child: RElevated(text: 'ثبت', onPressed: () {})),
Expanded(
child: ROutlinedElevated(text: 'انصراف', onPressed: () {}),
),
],
),
),
],
),
);
}

View File

@@ -16,8 +16,8 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
const RAppBar({ const RAppBar({
super.key, super.key,
required this.title, required this.title,
this.backgroundColor = AppColor.lightGreyLight, this.backgroundColor = AppColor.blueNormal,
this.iconColor = AppColor.blueNormal, this.iconColor = Colors.white,
this.titleTextStyle, this.titleTextStyle,
this.onBackPressed, this.onBackPressed,
this.additionalActions, this.additionalActions,
@@ -34,13 +34,13 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
scrolledUnderElevation: 0, scrolledUnderElevation: 0,
titleTextStyle: titleTextStyle:
titleTextStyle ?? titleTextStyle ??
AppFonts.yekan16.copyWith(color: AppColor.blueNormal), AppFonts.yekan16.copyWith(color:Colors.white),
title: Text(title), title: Text(title),
leading:Padding( leading:leading!=null ? Padding(
padding: const EdgeInsets.only(right: 16), padding: const EdgeInsets.only(right: 16),
child: leading, child: leading,
), ) : null,
actions: [ actions: [
if (additionalActions != null) ...additionalActions!, if (additionalActions != null) ...additionalActions!,
Padding( Padding(