feat : persian calendar and date picker
This commit is contained in:
@@ -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: () {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
|
||||
title: 'ایجاد بازرسی',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
color: Colors.white,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
@@ -136,14 +136,14 @@ class AddSupervisionPage extends GetView<AddSupervisionLogic> {
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 20, 20),
|
||||
padding: const EdgeInsets.fromLTRB(20, 0, 20, 25),
|
||||
child: RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(controller.routes.first);
|
||||
|
||||
},
|
||||
height: 50,
|
||||
height: 40,
|
||||
isFullWidth: true,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
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:inspection/inspection.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
@@ -12,6 +9,7 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.bgLight,
|
||||
appBar: RAppBar(
|
||||
title: 'نمایش اطلاعات',
|
||||
leading: vecWidget(
|
||||
@@ -22,66 +20,77 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
|
||||
),
|
||||
),
|
||||
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
spacing: 20,
|
||||
children: [
|
||||
markerDetailsWidget(),
|
||||
accompanyingInspectorsWidget(),
|
||||
accompanyingInspectorsWidget(),
|
||||
violationWidget(),
|
||||
violationWidget(),
|
||||
ratingbarWidget()
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
spacing: 20,
|
||||
children: [
|
||||
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() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(35, 5, 35, 35),
|
||||
padding: const EdgeInsets.fromLTRB(35, 35, 35,0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
children: [ Text('به این صنف امتیاز دهید',style: AppFonts.yekan12,),],
|
||||
children: [Text('به این صنف امتیاز دهید', style: AppFonts.yekan12)],
|
||||
),
|
||||
|
||||
SizedBox(height: 12,),
|
||||
SizedBox(height: 12),
|
||||
RatingBar.builder(
|
||||
initialRating: 3,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
allowHalfRating: true,
|
||||
itemCount: 5,
|
||||
wrapAlignment: WrapAlignment.center,
|
||||
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
|
||||
itemBuilder: (context, _) =>
|
||||
Icon(
|
||||
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);
|
||||
}))
|
||||
],
|
||||
)
|
||||
initialRating: 3,
|
||||
minRating: 1,
|
||||
direction: Axis.horizontal,
|
||||
allowHalfRating: true,
|
||||
itemCount: 5,
|
||||
wrapAlignment: WrapAlignment.center,
|
||||
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
|
||||
itemBuilder: (context, _) => Icon(Icons.star, color: Colors.amber),
|
||||
onRatingUpdate: (rating) {},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -94,48 +103,40 @@ Widget violationWidget() {
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.bgDark),
|
||||
|
||||
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: 5,
|
||||
minLines: 5,
|
||||
|
||||
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: 5,
|
||||
minLines: 5,
|
||||
|
||||
maxLines: 3,
|
||||
minLines: 3,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -261,28 +262,27 @@ Widget markerDetailsWidget() {
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) =>
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -16,7 +16,7 @@ class RegistrationOfViolationPage
|
||||
title: 'ثبت تخلف',
|
||||
leading: vecWidget(
|
||||
Assets.vecMessageAddSvg,
|
||||
color: AppColor.blueNormal,
|
||||
color: Colors.white,
|
||||
width: 16,
|
||||
height: 16,
|
||||
),
|
||||
@@ -31,93 +31,86 @@ class RegistrationOfViolationPage
|
||||
Expanded(
|
||||
child: ObxValue((data) {
|
||||
return ListView.separated(
|
||||
itemBuilder:
|
||||
(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: () {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
itemBuilder: (context, index) => violationWidget(),
|
||||
separatorBuilder: (context, index) => SizedBox(height: 15),
|
||||
itemCount: data.value,
|
||||
);
|
||||
}, controller.countViolation),
|
||||
),
|
||||
|
||||
RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionDisplayInformation);
|
||||
},
|
||||
isFullWidth: true,
|
||||
height: 40,
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 4, 0, 25),
|
||||
child: RElevated(
|
||||
text: 'مرحله بعد',
|
||||
onPressed: () {
|
||||
Get.toNamed(InspectionRoutes.inspectionDisplayInformation);
|
||||
},
|
||||
isFullWidth: true,
|
||||
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: () {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
const RAppBar({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.backgroundColor = AppColor.lightGreyLight,
|
||||
this.iconColor = AppColor.blueNormal,
|
||||
this.backgroundColor = AppColor.blueNormal,
|
||||
this.iconColor = Colors.white,
|
||||
this.titleTextStyle,
|
||||
this.onBackPressed,
|
||||
this.additionalActions,
|
||||
@@ -34,13 +34,13 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget {
|
||||
scrolledUnderElevation: 0,
|
||||
titleTextStyle:
|
||||
titleTextStyle ??
|
||||
AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
||||
AppFonts.yekan16.copyWith(color:Colors.white),
|
||||
title: Text(title),
|
||||
|
||||
leading:Padding(
|
||||
leading:leading!=null ? Padding(
|
||||
padding: const EdgeInsets.only(right: 16),
|
||||
child: leading,
|
||||
),
|
||||
) : null,
|
||||
actions: [
|
||||
if (additionalActions != null) ...additionalActions!,
|
||||
Padding(
|
||||
|
||||
Reference in New Issue
Block a user