From 3b693c7e601e218c98be33066c433b0d2a39e2d5 Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sat, 19 Apr 2025 16:50:36 +0330 Subject: [PATCH] feat : action add supervisons --- assets/icons/calendar_search.svg | 4 + assets/icons/diagram.svg | 4 + assets/icons/logout.svg | 5 + assets/icons/profile_user.svg | 6 + assets/vec/calendar.svg.vec | Bin 0 -> 2687 bytes assets/vec/calendar_search.svg.vec | Bin 0 -> 703 bytes assets/vec/diagram.svg.vec | Bin 0 -> 651 bytes assets/vec/logout.svg.vec | Bin 0 -> 738 bytes assets/vec/profile_user.svg.vec | Bin 0 -> 817 bytes .../presentation/add_supervision/logic.dart | 7 +- .../presentation/add_supervision/view.dart | 115 +++-- .../display_information/logic.dart | 3 + .../display_information/view.dart | 421 ++++++++++++++++++ .../lib/presentation/filter/logic.dart | 2 +- .../lib/presentation/filter/view.dart | 9 +- .../registration_of_violation/logic.dart | 5 + .../registration_of_violation/view.dart | 105 +++++ .../lib/presentation/root/logic.dart | 3 +- .../lib/presentation/routes/app_pages.dart | 15 + .../lib/presentation/routes/app_routes.dart | 6 +- features/supervision/pubspec.lock | 8 + ios/Flutter/Debug.xcconfig | 1 + ios/Flutter/Release.xcconfig | 1 + ios/Podfile | 43 ++ .../presentations/common}/assets.dart | 12 + packages/core/lib/core.dart | 1 + .../lib/presentation/common/app_color.dart | 7 +- .../core/lib/presentation/common/assets.dart | 10 + .../widget/app_bar/r_app_bar.dart | 3 +- .../presentation/widget/buttons/elevated.dart | 39 +- .../presentation/widget/inputs/r_input.dart | 8 +- packages/core/pubspec.lock | 8 + packages/core/pubspec.yaml | 3 + pubspec.lock | 8 + 34 files changed, 797 insertions(+), 65 deletions(-) create mode 100644 assets/icons/calendar_search.svg create mode 100644 assets/icons/diagram.svg create mode 100644 assets/icons/logout.svg create mode 100644 assets/icons/profile_user.svg create mode 100644 assets/vec/calendar.svg.vec create mode 100644 assets/vec/calendar_search.svg.vec create mode 100644 assets/vec/diagram.svg.vec create mode 100644 assets/vec/logout.svg.vec create mode 100644 assets/vec/profile_user.svg.vec create mode 100644 features/supervision/lib/presentation/display_information/logic.dart create mode 100644 features/supervision/lib/presentation/display_information/view.dart create mode 100644 features/supervision/lib/presentation/registration_of_violation/logic.dart create mode 100644 features/supervision/lib/presentation/registration_of_violation/view.dart create mode 100644 ios/Podfile rename {core/lib/presentation/common/assets.dart => lib/presentations/common}/assets.dart (74%) diff --git a/assets/icons/calendar_search.svg b/assets/icons/calendar_search.svg new file mode 100644 index 0000000..59ed538 --- /dev/null +++ b/assets/icons/calendar_search.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/diagram.svg b/assets/icons/diagram.svg new file mode 100644 index 0000000..7e505bd --- /dev/null +++ b/assets/icons/diagram.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/icons/logout.svg b/assets/icons/logout.svg new file mode 100644 index 0000000..c5a263d --- /dev/null +++ b/assets/icons/logout.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/assets/icons/profile_user.svg b/assets/icons/profile_user.svg new file mode 100644 index 0000000..c9218f9 --- /dev/null +++ b/assets/icons/profile_user.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/vec/calendar.svg.vec b/assets/vec/calendar.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..17a6d46a90da54e7f840d7a5efc3ee723485d79a GIT binary patch literal 2687 zcmaJ@TWnNS6g{^?Un3&Q&=Lnqj3iD&BtyrD2u<&fPzrrar)nTjEg%e2By<`;k>|8C z#mb{&{7{hyr3Dj+ogWC)9|PqNO8k=k_(2mBl@d~cjv7hEwf4ObjKoQA);;I!z4qSg zoPB!NzuaxCa$_zDpP4!QJjUd5e#@95gI}JNhd)ml-;IIQpj|V1*CrbCt36mYplD35 zi$-yF*R?9guD8mlUvE`&x&ZzhPZq8du?Bl0{U;0g96Rzm@%)zcgj^Du%c=NBipFeL zU!ucBB=>fW<=8Pc{d%i1%aV%59B^|v;MxN}v3!}A+XTKM#cW`*;_b*(Ik7k@<;~M%<(l`f?vsN(>*e~ePrkpr zPBP1;%kTHs!hbsKTO=ASkuAk7(ll5iXQsU?p-`#(GV2}WT`F?|&Em_H%DRd*h+B&F z)!>@}|5b|faw`=V-gr~mD@){!fw0ES@2``Z(JAn+fq$WVaI+fmEcvN=ImS8r%(N9U zy6b_xuA&zC{AJTV8qL}#7B@&XaNnMn3rlnQu6^!SM6OJX+vGQ99OJhYow(!n^O0uc zc@MZ&c~~!b|Gu_C*i+jE`BAlPkmr2VHZ0*XY8#d#s%==Vst5`Thu;1)T;i*#9TdNE`LnpWdkvde>)P>d`5T0G{5V^G0iu#tkuoG zRqNU9+pP694Q|$YNBXy@9_^J|UH#jzU)0~x)oha!dJP*v*iieFqg=O}FBmu`XTT25ouAyw%hx zr{Yh`obUFbXY&-<)0}5df8$MRPv5~Fu&3u{Q`*zyVNcJ^@=hGL9sY5f@z~RhPafvO zp8g@)13M#gvpuN8smpH_Jh5(`d;0k@3$!lp$Rf9H+pT+vTX&6HcdgpDqeq;&8{N7a zVaK`~5tny)SeSRyU<1Y}AcA$oYOswgE zeL{-89a8DtFJBHPQ0qSF?@z#guT(@6h`UD?S0=E&8}Sm*a0hx~Kh9uW2Ef7m$sY>6 z4<2f@St6=ctMp7zs~E;SJ28xTc4BUxG1z~i>&%}$RqQ>a{?)$2%GWbN4IO>_R+006 z-?H!tVtGnby}13LZ5BBDpP7*pde(YXBoe*uqC422Ha&UmUF3Z2H>RE&8JiOh%d$MDcDh=+be z@&qyewL8wB?qitGU`#(Ec{qO>5A7KD@%Y{L=&n=n>BbYs`+3EO^*H`A%%cy!=fOcc#-SgPJl%FsKL~TVG7B?+JO}XY$k8MR R@*OB}pwIz+Rl=lL;UCk9UBdtX literal 0 HcmV?d00001 diff --git a/assets/vec/calendar_search.svg.vec b/assets/vec/calendar_search.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..199ea1a2a2db9ba4c977710457292ff69788fc22 GIT binary patch literal 703 zcmX|-ziSjx5Xa~35{Stm7YjLwL@fgb!mgkakT)+^34+Bvyh6l?yWs@?2EjC!E?qb= zB(YJJSZE=K7aI}9yIpfit})1gSc(w^ixfU*W;Z@|_rrI;^Xtv6nI@=dfYXNGla7uL z;M}AFC<7hkdBvlM{w4a=tqrkUx0*ROe5IpAnWb|*U5Urc`Qx`Rz^(sF9F>dZ` zU&D$WGZz+bU?m&?BV!rh~r`V-Xg_o+vk^H#fCn(N$s@=J5wg&Im9Cii7t zd^oMoMwdyCkha2^`J07qh`&&46!8rl-Fiv$_Wm=UzbA3GzwAg}w>A*Yrk@Kv6#wwP zlc3;uz7s`DQJxR79FM<#ogKJhM~n-W@VXsnCP2I326376hK`#n!YKJF3@8WSr*0+3 zOkgcC7wtd@;2G8cCGt3~Wb(X{$?KG;AJ;u1eGmI*X&+C7p2^Y=MBjwfl%13+ z;X7d~c_V%+d0oV}F>W3pOgzJ=j@j3Ts?i8cs8^Zou3}UX=$G`J`XtrI7KM;mhpnK%^nVsS-J2#~S F{{S-d_W}R_ literal 0 HcmV?d00001 diff --git a/assets/vec/diagram.svg.vec b/assets/vec/diagram.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..74ab0035f6344e80a8ce8aa1e23f464f5852c647 GIT binary patch literal 651 zcmZ8fO=uHA6rSC%Vx&tNu~bMY67&$HQcXZa!Tp9v4?Wm}D;_)vZlneAmXjbt>9!RQ zu?M@mrmYl_RJ~NNX!PJku_kCeM%Um$=ntevFS35K#*4GFeDmJ--Z$^P-77<`&~ic? zlIk6ZxDrA{QAQJ@M{sGnuJPec9HXgUFwm^^%hB3?sqmoF7vm_;KFH)sV;AJ z<4yTD-;}M%_g1rJO5<_G%5?U`=-a=c?A}YZrSMdcvs#n4Xd6~?%#QK+T&`;yF`pbW z;&_EBU!hm-kyQlL@9*BnT7)M0R6nYd|90ZCB7|7KsCwJMnWl&_)PGr8xQ*+xyH=^V zg-~x(^Cv#Ezgdpc#_-6FRmgrta^?o(=WzP_O^D7NoSb%1D!Q0hsXz;-u+RwL%`1F_ zl0AzJ@eH0@A^#Hj`~vMav>(Da_ZEfhGCrr@#W-GHhY-u;KT&6i{x8(6;&yhg^yY_f zzLS)`eFWFirYsc?Bgm(uS3ZiMnC3S)flW6p^ZBzFsHdb}AEEva-oJtguZ2Q-mAV^f zyn2CZsP0>%|1}(E4deAy_Vb*5Jb_n!%D6=|J}$Ce_ECO7o%_u58Gny;`KWg8vd)0~ p40WpXPmy2Z91pO+O+?eZ%-hD*-F@*~|IK-LP)$9G2KlcM{s8CH?Tr8c literal 0 HcmV?d00001 diff --git a/assets/vec/logout.svg.vec b/assets/vec/logout.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..8ea1d5f7bf3ab532127872f6cbbd61d459f8e2ea GIT binary patch literal 738 zcmX|qmxRWN%YEC_<2_ThG(XU=oE{LcS5&-0xBJ?FNq9}=2J z2$!U{%2dNDglRf8A?!j8%|eeF3lnRL3MWse(a~d(Niv|j!1o2w?T?>=SO=hkDB z?0e=HF`(ja(HswA+rAI*cZKj|qD&6UORAq;md?|uX`-xn?iNkctPV9F`~F22;vO<) z3dFkZ31-I3;%N6R70)VtgE=xZGQS?5&yQo{EY-(x>g#jeYmTDS&nYZo3GG$9VohDM z)vM(8MO8@MokqiN2eT%>0;#8OP?KM(IE7vHKHa}PkyYW7$1yP=vs#x$$dze}(%{sZ%>5XS%j literal 0 HcmV?d00001 diff --git a/assets/vec/profile_user.svg.vec b/assets/vec/profile_user.svg.vec new file mode 100644 index 0000000000000000000000000000000000000000..4d9a07dbbea25bb14df1ed4e38ea992f5d707bd0 GIT binary patch literal 817 zcmZvbPe>F|9LL|xYDCS5J`VrXzrusdIemb{AQ&yMTGJp2y+h4 zQ@bHzCA5fE>cc$oB-KBI-^FXRK7~~N7WJlpATdDyFHwHkLl51~Aob_H(q$$W6-8`Q zXGL$68UH<(V|E>%H9Zs~b-Wn+igCY&2c19gRD^iW|AU=L#zjo$-QFt3J%bOKi?~jG zjJwOEC!l-dBj tmpLs = ['دولتی', 'غیر دولتی', 'استیجاری', 'شخصی', 'سایر']; // The data for the segments final Map segments = { @@ -18,8 +23,6 @@ class AddSupervisionLogic extends GetxController { ), }; - - @override void onReady() { // TODO: implement onReady diff --git a/features/supervision/lib/presentation/add_supervision/view.dart b/features/supervision/lib/presentation/add_supervision/view.dart index 014c45b..483fc95 100644 --- a/features/supervision/lib/presentation/add_supervision/view.dart +++ b/features/supervision/lib/presentation/add_supervision/view.dart @@ -1,7 +1,9 @@ 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:rasadyar_core/presentation/widget/tabs/new_tab.dart'; +import 'package:supervision/supervision.dart'; import 'logic.dart'; @@ -21,42 +23,97 @@ class AddSupervisionPage extends GetView { height: 16, ), ), - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - spacing: 16, - children: [ - Padding( - padding: const EdgeInsets.fromLTRB(22, 13, 22, 4), - child: Text( + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + spacing: 16, + children: [ + Text( 'نوع پروانه کسب', textAlign: TextAlign.center, style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), ), - ), - ObxValue((data) { - return NewCupertinoSegmentedControl( - padding: EdgeInsetsDirectional.symmetric( - horizontal: 20, - vertical: 10, - ), - children: controller.segments, - groupValue: data.value, - selectedColor: AppColor.blueNormal, - unselectedColor: Colors.white, - borderColor: Colors.grey.shade300, - onValueChanged: (int value) { - data.value = value; + ObxValue((data) { + return NewCupertinoSegmentedControl( + padding: EdgeInsets.zero, + children: controller.segments, + groupValue: data.value, + selectedColor: AppColor.blueNormal, + unselectedColor: Colors.white, + borderColor: Colors.grey.shade300, + onValueChanged: (int value) { + data.value = value; + }, + ); + }, controller.selectedSegment), + + RTextField(label: 'صادر کننده پروانه'), + RTextField(label: 'شماره مجوز'), + RTextField(label: 'شماره ثبت'), + RTextField(label: 'کد اقتصادی'), + + optionWidget(controller.selectedTypeOfOwnership), + optionWidget(controller.selectedAccompanyingInspectors), + optionWidget(controller.selectedUnitType), + SizedBox(height: 25), + RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(SupervisionRoutes.supervisionRegistrationOfViolation); }, - ); - }, controller.selectedSegment), - - RTextField(label: 'صادر کننده پروانه'), - RTextField(label: 'شماره مجوز'), - RTextField(label: 'شماره ثبت'), - RTextField(label: 'کد اقتصادی'), - ], + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), ), ); } + + Column optionWidget(RxInt selected) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'نوع پروانه کسب', + textAlign: TextAlign.center, + style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal), + ), + + SizedBox( + height: 75, + child: ListView.separated( + shrinkWrap: true, + padding: EdgeInsets.all(16), + scrollDirection: Axis.horizontal, + itemBuilder: + (context, index) => ObxValue((data) { + return ChoiceChip( + onSelected: (value) { + selected.value = index; + }, + selectedColor: AppColor.blueNormal, + labelStyle: + data.value == index + ? AppFonts.yekan13.copyWith( + color: AppColor.whiteLight, + ) + : AppFonts.yekan12.copyWith( + color: AppColor.darkGreyNormalActive, + ), + checkmarkColor: Colors.white, + label: Text(controller.tmpLs[index]), + selected: index == data.value, + ); + }, selected), + + separatorBuilder: (context, index) => SizedBox(width: 8), + itemCount: controller.tmpLs.length, + ), + ), + ], + ); + } } diff --git a/features/supervision/lib/presentation/display_information/logic.dart b/features/supervision/lib/presentation/display_information/logic.dart new file mode 100644 index 0000000..e90fe4d --- /dev/null +++ b/features/supervision/lib/presentation/display_information/logic.dart @@ -0,0 +1,3 @@ +import 'package:rasadyar_core/core.dart'; + +class DisplayInformationLogic extends GetxController {} diff --git a/features/supervision/lib/presentation/display_information/view.dart b/features/supervision/lib/presentation/display_information/view.dart new file mode 100644 index 0000000..9b4ddca --- /dev/null +++ b/features/supervision/lib/presentation/display_information/view.dart @@ -0,0 +1,421 @@ +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:supervision/supervision.dart'; + +import 'logic.dart'; + +class DisplayInformationPage extends GetView { + const DisplayInformationPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: RAppBar( + title: 'نمایش اطلاعات', + leading: vecWidget( + Assets.vecMessageAddSvg, + color: AppColor.blueNormal, + width: 16, + height: 16, + ), + ), + + body: SingleChildScrollView( + child: Column( + spacing: 20, + children: [ + markerDetailsWidget(), + accompanyingInspectorsWidget(), + accompanyingInspectorsWidget(), + violationWidget(), + violationWidget(), + ratingbarWidget() + + ], + ), + ),); + } + + Widget ratingbarWidget() { + return Padding( + padding: const EdgeInsets.fromLTRB(35, 5, 35, 35), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Row( + children: [ Text('به این صنف امتیاز دهید',style: AppFonts.yekan12,),], + ), + + 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.offAllNamed(SupervisionRoutes.supervision); + })) + ], + ) + ], + ), + ); + } +} + +Widget violationWidget() { + return Container( + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 8, vertical: 12), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, 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, + + ), + 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, + + ), + + ], + ), + ); +} + +Widget markerDetailsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35, vertical: 10), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'ایجاد بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Container( + height: 32, + clipBehavior: Clip.antiAlias, + padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + ...List.generate( + 5, + (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, + ), + ), + ], + ), + ), + ], + ), + ); +} + +Widget accompanyingInspectorsWidget() { + return Container( + clipBehavior: Clip.antiAlias, + margin: EdgeInsets.symmetric(horizontal: 35), + padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10), + decoration: ShapeDecoration( + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + ), + child: Column( + spacing: 15, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 12, + children: [ + Text( + 'بازرس همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.bgDark), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'نام و نام خانوادگی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + 'آیدا گل محمدی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + 'تاریخ بازرسی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '1403/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + 'شماره همراه', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '0326598653', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'آخرین فعالیت', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + + Text( + '1409/12/12', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + + children: [ + Text( + 'موجودی', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + Text( + '5کیلوگرم', + textAlign: TextAlign.center, + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), + ), + ], + ), + ], + ), + ); +} diff --git a/features/supervision/lib/presentation/filter/logic.dart b/features/supervision/lib/presentation/filter/logic.dart index 55b7f5a..2eaec13 100644 --- a/features/supervision/lib/presentation/filter/logic.dart +++ b/features/supervision/lib/presentation/filter/logic.dart @@ -169,7 +169,7 @@ class SupervisionFilterLogic extends GetxController @override void onClose() { - // TODO: implement onClose + super.onClose(); } } diff --git a/features/supervision/lib/presentation/filter/view.dart b/features/supervision/lib/presentation/filter/view.dart index d18094e..16fefd7 100644 --- a/features/supervision/lib/presentation/filter/view.dart +++ b/features/supervision/lib/presentation/filter/view.dart @@ -182,12 +182,7 @@ class SupervisionFilterPage extends GetView { ), CustomSlidableAction( onPressed: (context) { - controller.sheetController.value.addBottomSheet( - child: LocationDetailsPage(), - initHeight: 500, - maxHeight: Get.height * 2, - minHeight: 0, - ); + Get.toNamed(SupervisionRoutes.supervisionAddSupervision); }, backgroundColor: AppColor.greenNormal, padding: EdgeInsets.all(16), @@ -473,6 +468,7 @@ class SupervisionFilterPage extends GetView { vecWidgetWithOnTap( assets: Assets.vecMapSvg, onTap: () { + Get.toNamed(SupervisionRoutes.supervisionLocationDetails); }, width: 24, @@ -485,6 +481,7 @@ class SupervisionFilterPage extends GetView { height: 24, color: AppColor.greenNormal, onTap: () { + Get.toNamed(SupervisionRoutes.supervisionAddSupervision); }, ), diff --git a/features/supervision/lib/presentation/registration_of_violation/logic.dart b/features/supervision/lib/presentation/registration_of_violation/logic.dart new file mode 100644 index 0000000..ba48ff1 --- /dev/null +++ b/features/supervision/lib/presentation/registration_of_violation/logic.dart @@ -0,0 +1,5 @@ +import 'package:rasadyar_core/core.dart'; + +class RegistrationOfViolationLogic extends GetxController { + RxInt countViolation = 1.obs; +} diff --git a/features/supervision/lib/presentation/registration_of_violation/view.dart b/features/supervision/lib/presentation/registration_of_violation/view.dart new file mode 100644 index 0000000..5ddb3ac --- /dev/null +++ b/features/supervision/lib/presentation/registration_of_violation/view.dart @@ -0,0 +1,105 @@ +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:supervision/presentation/registration_of_violation/logic.dart'; +import 'package:supervision/presentation/routes/app_routes.dart'; + +class RegistrationOfViolationPage + extends GetView { + const RegistrationOfViolationPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( +backgroundColor:AppColor.bgLight, + appBar: RAppBar( + title: 'ثبت تخلف', + leading: vecWidget( + Assets.vecMessageAddSvg, + color: AppColor.blueNormal, + width: 16, + height: 16, + ), + additionalActions: [ + RFab.smallAdd(onPressed: () => controller.countViolation.value++), + ], + ), + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10), + child: Column( + children: [ + 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: 1,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, + + ), + 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, + + ), + + ], + ), + ) , + separatorBuilder: (context, index) => SizedBox(height: 15,), + itemCount: data.value, + ); + },controller.countViolation), + ), + + RElevated( + text: 'مرحله بعد', + onPressed: () { + Get.toNamed(SupervisionRoutes.supervisionDisplayInformation); + }, + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + textStyle: AppFonts.yekan16.copyWith(color: Colors.white), + ), + ], + ), + ), + ); + } +} diff --git a/features/supervision/lib/presentation/root/logic.dart b/features/supervision/lib/presentation/root/logic.dart index a2f73b3..82d44bc 100644 --- a/features/supervision/lib/presentation/root/logic.dart +++ b/features/supervision/lib/presentation/root/logic.dart @@ -1,12 +1,13 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:supervision/presentation/actions/view.dart'; import 'package:supervision/presentation/filter/view.dart'; class RootLogic extends GetxController { RxInt currentIndex = 0.obs; List pages = [ SupervisionFilterPage(), - Placeholder(color: Colors.red), + ActionsPage(), Placeholder(color: Colors.amber), ]; diff --git a/features/supervision/lib/presentation/routes/app_pages.dart b/features/supervision/lib/presentation/routes/app_pages.dart index fc4fae2..d0fd20c 100644 --- a/features/supervision/lib/presentation/routes/app_pages.dart +++ b/features/supervision/lib/presentation/routes/app_pages.dart @@ -1,9 +1,14 @@ import 'package:rasadyar_core/core.dart'; +import 'package:supervision/presentation/actions/logic.dart'; import 'package:supervision/presentation/add_supervision/logic.dart'; import 'package:supervision/presentation/add_supervision/view.dart'; +import 'package:supervision/presentation/display_information/logic.dart'; +import 'package:supervision/presentation/display_information/view.dart'; import 'package:supervision/presentation/filter/logic.dart'; import 'package:supervision/presentation/location_details/logic.dart'; import 'package:supervision/presentation/location_details/view.dart'; +import 'package:supervision/presentation/registration_of_violation/logic.dart'; +import 'package:supervision/presentation/registration_of_violation/view.dart'; import 'package:supervision/presentation/root/logic.dart'; import 'package:supervision/presentation/root/view.dart'; import 'package:supervision/presentation/routes/app_routes.dart'; @@ -19,6 +24,7 @@ sealed class SupervisionPages { Get.put(RootLogic()); Get.put(SupervisionFilterLogic()); Get.lazyPut(() => LocationDetailsLogic(), fenix: true); + Get.lazyPut(() => ActionsLogic(), fenix: true); }), ), @@ -33,5 +39,14 @@ sealed class SupervisionPages { page: () => AddSupervisionPage(), binding: BindingsBuilder.put(() => AddSupervisionLogic()), ), + GetPage( + name: SupervisionRoutes.supervisionRegistrationOfViolation, + page: () => RegistrationOfViolationPage(), + binding: BindingsBuilder.put(() => RegistrationOfViolationLogic()), + ), GetPage( + name: SupervisionRoutes.supervisionDisplayInformation, + page: () => DisplayInformationPage(), + binding: BindingsBuilder.put(() => DisplayInformationLogic()), + ), ]; } diff --git a/features/supervision/lib/presentation/routes/app_routes.dart b/features/supervision/lib/presentation/routes/app_routes.dart index 87ea34d..011dee1 100644 --- a/features/supervision/lib/presentation/routes/app_routes.dart +++ b/features/supervision/lib/presentation/routes/app_routes.dart @@ -5,6 +5,8 @@ sealed class SupervisionRoutes { static const supervisionAction = '$supervision/action'; static const supervisionUserSetting = '$supervision/userSettings'; static const supervisionLocationDetails = '$supervision/locationDetails'; - static const supervisionAddSupervision = - '$supervisionLocationDetails/addSupervision'; + static const supervisionAddSupervision = '$supervisionLocationDetails/addSupervision'; + static const supervisionRegistrationOfViolation = '$supervisionAddSupervision/RegistrationOfViolation'; + static const supervisionDisplayInformation = '$supervisionRegistrationOfViolation/DisplayInformation'; + } diff --git a/features/supervision/pubspec.lock b/features/supervision/pubspec.lock index 24150a4..fa96362 100644 --- a/features/supervision/pubspec.lock +++ b/features/supervision/pubspec.lock @@ -110,6 +110,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: transitive description: diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile new file mode 100644 index 0000000..e549ee2 --- /dev/null +++ b/ios/Podfile @@ -0,0 +1,43 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/core/lib/presentation/common/assets.dart/assets.dart b/lib/presentations/common/assets.dart similarity index 74% rename from core/lib/presentation/common/assets.dart/assets.dart rename to lib/presentations/common/assets.dart index 9d075b7..de73abf 100644 --- a/core/lib/presentation/common/assets.dart/assets.dart +++ b/lib/presentations/common/assets.dart @@ -5,17 +5,23 @@ class Assets { static const String iconsAdd = 'assets/icons/add.svg'; static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; + static const String iconsCalendar = 'assets/icons/calendar.svg'; + static const String iconsCalendarSearch = 'assets/icons/calendar_search.svg'; static const String iconsCall = 'assets/icons/call.svg'; + static const String iconsDiagram = 'assets/icons/diagram.svg'; static const String iconsDownload = 'assets/icons/download.svg'; static const String iconsEdit = 'assets/icons/edit.svg'; static const String iconsFilter = 'assets/icons/filter.svg'; static const String iconsGps = 'assets/icons/gps.svg'; static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsLogout = 'assets/icons/logout.svg'; static const String iconsMap = 'assets/icons/map.svg'; static const String iconsMapMarker = 'assets/icons/map_marker.svg'; static const String iconsMessageAdd = 'assets/icons/message_add.svg'; static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; + static const String iconsProfileUser = 'assets/icons/profile_user.svg'; static const String iconsScan = 'assets/icons/scan.svg'; + static const String iconsScanBarcode = 'assets/icons/scan_barcode.svg'; static const String iconsSecurityTime = 'assets/icons/security_time.svg'; static const String iconsSetting = 'assets/icons/setting.svg'; static const String iconsTrash = 'assets/icons/trash.svg'; @@ -24,16 +30,22 @@ class Assets { static const String vecAddSvg = 'assets/vec/add.svg.vec'; static const String vecArrowLeftSvg = 'assets/vec/arrow_left.svg.vec'; static const String vecArrowRightSvg = 'assets/vec/arrow_right.svg.vec'; + static const String vecCalendarSearchSvg = 'assets/vec/calendar_search.svg.vec'; + static const String vecCalendarSvg = 'assets/vec/calendar.svg.vec'; static const String vecCallSvg = 'assets/vec/call.svg.vec'; + static const String vecDiagramSvg = 'assets/vec/diagram.svg.vec'; static const String vecDownloadSvg = 'assets/vec/download.svg.vec'; static const String vecEditSvg = 'assets/vec/edit.svg.vec'; static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; static const String vecGpsSvg = 'assets/vec/gps.svg.vec'; static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecLogoutSvg = 'assets/vec/logout.svg.vec'; static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; static const String vecMapSvg = 'assets/vec/map.svg.vec'; static const String vecMessageAddSvg = 'assets/vec/message_add.svg.vec'; static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; + static const String vecProfileUserSvg = 'assets/vec/profile_user.svg.vec'; + static const String vecScanBarcodeSvg = 'assets/vec/scan_barcode.svg.vec'; static const String vecScanSvg = 'assets/vec/scan.svg.vec'; static const String vecSecurityTimeSvg = 'assets/vec/security_time.svg.vec'; static const String vecSettingSvg = 'assets/vec/setting.svg.vec'; diff --git a/packages/core/lib/core.dart b/packages/core/lib/core.dart index 5388a48..d3ea5ec 100644 --- a/packages/core/lib/core.dart +++ b/packages/core/lib/core.dart @@ -8,5 +8,6 @@ export 'package:rasadyar_core/presentation/widget/widget.dart'; //other packages export 'package:flutter_slidable/flutter_slidable.dart'; export 'package:font_awesome_flutter/font_awesome_flutter.dart'; +export 'package:flutter_rating_bar/flutter_rating_bar.dart'; diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index 6505e83..8116ba2 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -84,7 +84,7 @@ class AppColor { static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) //endregion - //region ---Dark Grey Colors --- + //region --- Grey Colors --- static const Color darkGreyLight = Color( 0xFFeaeaea, ); // #eaeaea rgb(234, 234, 234) @@ -357,6 +357,11 @@ class AppColor { 0xFF0a4953, ); // #0a4953 rgb(10, 73, 83) static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) + + + + static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64) + static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64) //endregion //region --- category Colors --- diff --git a/packages/core/lib/presentation/common/assets.dart b/packages/core/lib/presentation/common/assets.dart index 5eeb4c1..de73abf 100644 --- a/packages/core/lib/presentation/common/assets.dart +++ b/packages/core/lib/presentation/common/assets.dart @@ -5,16 +5,21 @@ class Assets { static const String iconsAdd = 'assets/icons/add.svg'; static const String iconsArrowLeft = 'assets/icons/arrow_left.svg'; static const String iconsArrowRight = 'assets/icons/arrow_right.svg'; + static const String iconsCalendar = 'assets/icons/calendar.svg'; + static const String iconsCalendarSearch = 'assets/icons/calendar_search.svg'; static const String iconsCall = 'assets/icons/call.svg'; + static const String iconsDiagram = 'assets/icons/diagram.svg'; static const String iconsDownload = 'assets/icons/download.svg'; static const String iconsEdit = 'assets/icons/edit.svg'; static const String iconsFilter = 'assets/icons/filter.svg'; static const String iconsGps = 'assets/icons/gps.svg'; static const String iconsKey = 'assets/icons/key.svg'; + static const String iconsLogout = 'assets/icons/logout.svg'; static const String iconsMap = 'assets/icons/map.svg'; static const String iconsMapMarker = 'assets/icons/map_marker.svg'; static const String iconsMessageAdd = 'assets/icons/message_add.svg'; static const String iconsProfileCircle = 'assets/icons/profile_circle.svg'; + static const String iconsProfileUser = 'assets/icons/profile_user.svg'; static const String iconsScan = 'assets/icons/scan.svg'; static const String iconsScanBarcode = 'assets/icons/scan_barcode.svg'; static const String iconsSecurityTime = 'assets/icons/security_time.svg'; @@ -25,16 +30,21 @@ class Assets { static const String vecAddSvg = 'assets/vec/add.svg.vec'; static const String vecArrowLeftSvg = 'assets/vec/arrow_left.svg.vec'; static const String vecArrowRightSvg = 'assets/vec/arrow_right.svg.vec'; + static const String vecCalendarSearchSvg = 'assets/vec/calendar_search.svg.vec'; + static const String vecCalendarSvg = 'assets/vec/calendar.svg.vec'; static const String vecCallSvg = 'assets/vec/call.svg.vec'; + static const String vecDiagramSvg = 'assets/vec/diagram.svg.vec'; static const String vecDownloadSvg = 'assets/vec/download.svg.vec'; static const String vecEditSvg = 'assets/vec/edit.svg.vec'; static const String vecFilterSvg = 'assets/vec/filter.svg.vec'; static const String vecGpsSvg = 'assets/vec/gps.svg.vec'; static const String vecKeySvg = 'assets/vec/key.svg.vec'; + static const String vecLogoutSvg = 'assets/vec/logout.svg.vec'; static const String vecMapMarkerSvg = 'assets/vec/map_marker.svg.vec'; static const String vecMapSvg = 'assets/vec/map.svg.vec'; static const String vecMessageAddSvg = 'assets/vec/message_add.svg.vec'; static const String vecProfileCircleSvg = 'assets/vec/profile_circle.svg.vec'; + static const String vecProfileUserSvg = 'assets/vec/profile_user.svg.vec'; static const String vecScanBarcodeSvg = 'assets/vec/scan_barcode.svg.vec'; static const String vecScanSvg = 'assets/vec/scan.svg.vec'; static const String vecSecurityTimeSvg = 'assets/vec/security_time.svg.vec'; diff --git a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart index df74c72..6fdecfb 100644 --- a/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart +++ b/packages/core/lib/presentation/widget/app_bar/r_app_bar.dart @@ -42,6 +42,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { child: leading, ), actions: [ + if (additionalActions != null) ...additionalActions!, Padding( padding: const EdgeInsets.symmetric(horizontal: 8), child: IconButton( @@ -50,7 +51,7 @@ class RAppBar extends StatelessWidget implements PreferredSizeWidget { color: iconColor, ), ), - if (additionalActions != null) ...additionalActions!, + ], ); } diff --git a/packages/core/lib/presentation/widget/buttons/elevated.dart b/packages/core/lib/presentation/widget/buttons/elevated.dart index 1aa97d9..3e4e5ff 100644 --- a/packages/core/lib/presentation/widget/buttons/elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/elevated.dart @@ -2,25 +2,27 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/presentation/common/app_color.dart'; import 'package:rasadyar_core/presentation/common/app_fonts.dart'; -class RElevated extends StatefulWidget { +class RElevated extends StatelessWidget { RElevated({ super.key, required this.text, required this.onPressed, - foregroundColor, - backgroundColor, - disabledBackgroundColor, - disabledForegroundColor, - radius, - textStyle, + this.foregroundColor, + this.backgroundColor, + this.disabledBackgroundColor, + this.disabledForegroundColor, + this.radius, + this.textStyle, this.width = 150.0, this.height = 56.0, + this.isFullWidth, }); final String text; final VoidCallback? onPressed; final double width; final double height; + final bool? isFullWidth; Color? foregroundColor; Color? backgroundColor; Color? disabledForegroundColor; @@ -28,29 +30,24 @@ class RElevated extends StatefulWidget { double? radius; TextStyle? textStyle; - @override - State createState() => _RElevatedState(); -} - -class _RElevatedState extends State { @override Widget build(BuildContext context) { return ElevatedButton( - onPressed: widget.onPressed, + onPressed: onPressed, style: ElevatedButton.styleFrom( - backgroundColor: widget.backgroundColor ?? AppColor.blueNormal, - foregroundColor: widget.foregroundColor ?? Colors.white, + backgroundColor: backgroundColor ?? AppColor.blueNormal, + foregroundColor: foregroundColor ?? Colors.white, disabledBackgroundColor: - widget.disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), - disabledForegroundColor: widget.disabledForegroundColor ?? Colors.white, + disabledBackgroundColor ?? AppColor.blueNormal.withAlpha(38), + disabledForegroundColor: disabledForegroundColor ?? Colors.white, shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(widget.radius ?? 8), + borderRadius: BorderRadius.circular(radius ?? 8), ), - fixedSize: Size(widget.width, widget.height), + minimumSize: Size((isFullWidth ??false) ? double.infinity : width, height), padding: EdgeInsets.zero, - textStyle: widget.textStyle ?? AppFonts.yekan24, + textStyle: textStyle ?? AppFonts.yekan24, ), - child: Text(widget.text), + child: Text(text), ); } } diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart index 07edc2b..2d1b0f6 100644 --- a/packages/core/lib/presentation/widget/inputs/r_input.dart +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; @immutable class RTextField extends StatefulWidget { @@ -27,6 +28,7 @@ class RTextField extends StatefulWidget { this.minLines, this.radius, this.filled, + this.filledColor, this.enabled, this.errorStyle, this.labelStyle, @@ -61,6 +63,7 @@ class RTextField extends StatefulWidget { this.readonly = false, this.label, this.filled, + this.filledColor, this.errorStyle, this.labelStyle, this.enabled}) { @@ -95,6 +98,7 @@ class RTextField extends StatefulWidget { this.readonly = false, this.label, this.filled, + this.filledColor, this.errorStyle, this.labelStyle, this.enabled}) { @@ -132,6 +136,7 @@ class RTextField extends StatefulWidget { Widget? suffixIcon; Widget? prefixIcon; bool? filled; + Color? filledColor; bool _isPassword = false; final BoxConstraints? boxConstraints; @@ -204,8 +209,9 @@ class _RTextFieldState extends State { prefixIconConstraints: widget.boxConstraints, hintText: widget.hintText, labelText: widget.label, - labelStyle: widget.labelStyle, + labelStyle: widget.labelStyle??AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarkActive), filled: widget.filled, + fillColor: widget.filledColor, counter: widget.showCounter ? null : const SizedBox(), hintStyle: widget.hintStyle, enabledBorder: widget._inputBorder, diff --git a/packages/core/pubspec.lock b/packages/core/pubspec.lock index a78dfca..31270d6 100644 --- a/packages/core/pubspec.lock +++ b/packages/core/pubspec.lock @@ -230,6 +230,14 @@ packages: url: "https://pub.dev" source: hosted version: "5.0.0" + flutter_rating_bar: + dependency: "direct main" + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: "direct main" description: diff --git a/packages/core/pubspec.yaml b/packages/core/pubspec.yaml index 4e46e52..bcc2ec7 100644 --- a/packages/core/pubspec.yaml +++ b/packages/core/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: #UI cupertino_icons: ^1.0.8 flutter_slidable: ^4.0.0 + flutter_rating_bar: ^4.0.1 ##Log logger: ^2.5.0 @@ -42,6 +43,8 @@ dependencies: permission_handler: ^11.4.0 + + dev_dependencies: flutter_test: sdk: flutter diff --git a/pubspec.lock b/pubspec.lock index 106e938..91b7ffd 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -254,6 +254,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.9.0" + flutter_rating_bar: + dependency: transitive + description: + name: flutter_rating_bar + sha256: d2af03469eac832c591a1eba47c91ecc871fe5708e69967073c043b2d775ed93 + url: "https://pub.dev" + source: hosted + version: "4.0.1" flutter_slidable: dependency: transitive description: