feat : persian calendar and date picker
This commit is contained in:
@@ -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,13 +30,36 @@ 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) =>
|
separatorBuilder: (context, index) => SizedBox(height: 15),
|
||||||
Container(
|
itemCount: data.value,
|
||||||
padding: EdgeInsets.symmetric(
|
);
|
||||||
horizontal: 12,
|
}, controller.countInspector),
|
||||||
vertical: 16,
|
|
||||||
),
|
),
|
||||||
|
|
||||||
|
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(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(width: 0.7, color: AppColor.bgDark),
|
border: Border.all(width: 0.7, color: AppColor.bgDark),
|
||||||
@@ -81,14 +102,14 @@ class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: RElevated(
|
child: RElevated(
|
||||||
text: 'ثبت',
|
text: 'ثبت',
|
||||||
textStyle:AppFonts.yekan16.copyWith(color: Colors.white),
|
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: ROutlinedElevated(
|
child: ROutlinedElevated(
|
||||||
text: 'انصراف',
|
text: 'انصراف',
|
||||||
textStyle:AppFonts.yekan16,
|
textStyle: AppFonts.yekan16,
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -98,29 +119,5 @@ class AddMobileInspectorPage extends GetView<AddMobileInspectorLogic> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 15),
|
|
||||||
itemCount: data.value,
|
|
||||||
);
|
);
|
||||||
}, controller.countInspector),
|
|
||||||
),
|
|
||||||
|
|
||||||
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.fromLTRB(20, 4, 20, 20),
|
|
||||||
child: RElevated(
|
|
||||||
text: 'مرحله بعد',
|
|
||||||
onPressed: () {
|
|
||||||
Get.toNamed(InspectionRoutes.inspectionRegistrationOfViolation);
|
|
||||||
},
|
|
||||||
height: 50,
|
|
||||||
isFullWidth: true,
|
|
||||||
backgroundColor: AppColor.greenNormal,
|
|
||||||
textStyle: AppFonts.yekan16.copyWith(color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -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),
|
||||||
|
|||||||
@@ -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,33 +20,66 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
body: SingleChildScrollView(
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 20,
|
spacing: 20,
|
||||||
children: [
|
children: [
|
||||||
|
ratingbarWidget(),
|
||||||
markerDetailsWidget(),
|
markerDetailsWidget(),
|
||||||
accompanyingInspectorsWidget(),
|
accompanyingInspectorsWidget(),
|
||||||
accompanyingInspectorsWidget(),
|
accompanyingInspectorsWidget(),
|
||||||
violationWidget(),
|
violationWidget(),
|
||||||
violationWidget(),
|
violationWidget(),
|
||||||
ratingbarWidget()
|
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,
|
||||||
@@ -57,31 +88,9 @@ class DisplayInformationPage extends GetView<DisplayInformationLogic> {
|
|||||||
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,8 +262,7 @@ Widget markerDetailsWidget() {
|
|||||||
|
|
||||||
...List.generate(
|
...List.generate(
|
||||||
5,
|
5,
|
||||||
(index) =>
|
(index) => Row(
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
|
||||||
|
|||||||
@@ -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,15 +31,39 @@ class RegistrationOfViolationPage
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: ObxValue((data) {
|
child: ObxValue((data) {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
itemBuilder:
|
itemBuilder: (context, index) => violationWidget(),
|
||||||
(context, index) => Container(
|
separatorBuilder: (context, index) => SizedBox(height: 15),
|
||||||
padding: EdgeInsets.symmetric(
|
itemCount: data.value,
|
||||||
horizontal: 8,
|
);
|
||||||
vertical: 12,
|
}, controller.countViolation),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Container violationWidget() {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(width: 0.75, color: AppColor.bgDark),
|
border: Border.all(width: 0.7, color: AppColor.bgDark),
|
||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
@@ -55,7 +79,6 @@ class RegistrationOfViolationPage
|
|||||||
filledColor: AppColor.whiteLight,
|
filledColor: AppColor.whiteLight,
|
||||||
maxLines: 3,
|
maxLines: 3,
|
||||||
minLines: 3,
|
minLines: 3,
|
||||||
|
|
||||||
),
|
),
|
||||||
RTextField(
|
RTextField(
|
||||||
label: 'عنوان تخلف',
|
label: 'عنوان تخلف',
|
||||||
@@ -80,44 +103,14 @@ class RegistrationOfViolationPage
|
|||||||
child: Row(
|
child: Row(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
children: [
|
children: [
|
||||||
|
Expanded(child: RElevated(text: 'ثبت', onPressed: () {})),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: RElevated(
|
child: ROutlinedElevated(text: 'انصراف', onPressed: () {}),
|
||||||
text: 'ثبت',
|
|
||||||
onPressed: () {},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: ROutlinedElevated(
|
|
||||||
text: 'انصراف',
|
|
||||||
onPressed: () {},
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
SizedBox(height: 25),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
Reference in New Issue
Block a user