diff --git a/lib/res/assets_res.dart b/lib/res/assets_res.dart deleted file mode 100644 index 18ff89e..0000000 --- a/lib/res/assets_res.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Generated file. Do not edit. -// This file is generated by the iFlutter - -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars -class AssetsRes { - AssetsRes._(); - - static const String PROJECT_NAME = 'rasadyar_app'; - static const String PROJECT_VERSION = '1.2.0+2'; - static const String INSIDE = 'assets/icons/inside.svg'; - static const String OUTSIDE = 'assets/icons/outside.svg'; - static const String WHARE_HOUSE = 'assets/icons/whare_house.svg'; -} diff --git a/lib/res/font_res.dart b/lib/res/font_res.dart deleted file mode 100644 index 38a512e..0000000 --- a/lib/res/font_res.dart +++ /dev/null @@ -1,12 +0,0 @@ -// Generated file. Do not edit. -// This file is generated by the iFlutter - -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars -class FontRes { - FontRes._(); - - static const String PROJECT_NAME = 'rasadyar_app'; - static const String PROJECT_VERSION = '1.2.0+2'; - static const String IRANYEKANREGULARFANUM = 'iranyekanregularfanum'; -} diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart index 79a07a6..8ce5813 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/view.dart @@ -52,14 +52,17 @@ class SalesOutOfProvincePage extends GetView { ), ), SizedBox(width: 8), - GestureDetector( - onTap: () { - // Get.bottomSheet(filterBottomSheet()); - }, - child: Assets.vec.filterOutlineSvg.svg( - width: 20, - height: 20, - colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + Visibility( + visible: controller.currentIndex.value==0, + child: GestureDetector( + onTap: () { + // Get.bottomSheet(filterBottomSheet()); + }, + child: Assets.vec.filterOutlineSvg.svg( + width: 20, + height: 20, + colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), ), ), SizedBox(width: 8), @@ -800,35 +803,5 @@ class SalesOutOfProvincePage extends GetView { ); } - ObxValue _buildSearchWidget() { - return ObxValue((data) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - padding: EdgeInsets.only(top: 5), - curve: Curves.easeInOut, - height: data.value ? 50 : 0, - child: Visibility( - visible: data.value, - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: RTextField( - suffixIcon: Padding( - padding: const EdgeInsets.all(12.0), - child: Assets.vec.searchSvg.svg( - width: 10, - height: 10, - colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), - ), - ), - hintText: 'جستجو', - onChanged: (value) { - controller.searchedValue.value = value; - }, - controller: TextEditingController(), - ), - ), - ), - ); - }, controller.searchIsSelected); - } + } diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/buyers_page.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/buyers_page.dart index c61749a..c196c6c 100644 --- a/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/buyers_page.dart +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/buyers_page.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart'; import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart'; import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/widgets/search_widget.dart'; import 'package:rasadyar_core/core.dart'; import 'empty_widget.dart'; @@ -13,10 +14,22 @@ class BuyersPage extends GetView { @override Widget build(BuildContext context) { return Scaffold( - body: buyerListWidget(), + body: Column( + children: [ + searchWidget(controller.searchIsSelected, (data) { + controller.searchedValue.value = data; + controller.getOutProvinceCarcassesBuyer(); + }), + + buyerListWidget(), + ], + ), floatingActionButton: RFab.add( onPressed: () { - Get.bottomSheet(addOrEditBuyerBottomSheet(), isScrollControlled: true); + Get.bottomSheet( + addOrEditBuyerBottomSheet(), + isScrollControlled: true, + ); }, ), floatingActionButtonLocation: FloatingActionButtonLocation.startFloat, @@ -36,7 +49,11 @@ class BuyersPage extends GetView { padding: EdgeInsets.fromLTRB(8, 8, 18, 80), itemBuilder: (context, index) { return ObxValue( - (expandList) => buyerListItem(expandList: expandList, index: index, item: data.value.data![index]), + (expandList) => buyerListItem( + expandList: expandList, + index: index, + item: data.value.data![index], + ), controller.isExpandedList, ); }, @@ -84,7 +101,10 @@ class BuyersPage extends GetView { decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.circular(8), - border: Border.all(width: 0.5, color: AppColor.darkGreyNormal), + border: Border.all( + width: 0.5, + color: AppColor.darkGreyNormal, + ), ), child: AnimatedCrossFade( alignment: Alignment.center, @@ -102,14 +122,18 @@ class BuyersPage extends GetView { Text( item.buyer?.fullname ?? 'N/A', textAlign: TextAlign.center, - style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + style: AppFonts.yekan14.copyWith( + color: AppColor.blueNormal, + ), ), SizedBox(height: 2), Text( item.buyer?.mobile ?? 'N/A', textAlign: TextAlign.center, - style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + style: AppFonts.yekan14.copyWith( + color: AppColor.bgDark, + ), ), ], ), @@ -121,7 +145,9 @@ class BuyersPage extends GetView { child: Text( '${item.unitName}', textAlign: TextAlign.center, - style: AppFonts.yekan12.copyWith(color: AppColor.bgDark), + style: AppFonts.yekan12.copyWith( + color: AppColor.bgDark, + ), ), ), Expanded( @@ -129,7 +155,9 @@ class BuyersPage extends GetView { child: Text( '${item.buyer?.province}\n${item.buyer?.city}', textAlign: TextAlign.center, - style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDark), + style: AppFonts.yekan12.copyWith( + color: AppColor.darkGreyDark, + ), ), ), @@ -141,7 +169,10 @@ class BuyersPage extends GetView { secondChild: Container( padding: EdgeInsets.fromLTRB(8, 12, 14, 12), - decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), child: Column( spacing: 8, children: [ @@ -151,23 +182,29 @@ class BuyersPage extends GetView { GestureDetector( onTap: () { controller.setEditData(item); - Get.bottomSheet(addOrEditBuyerBottomSheet(true), isScrollControlled: true).whenComplete( - () { - controller.resetSubmitForm(); - }, - ); + Get.bottomSheet( + addOrEditBuyerBottomSheet(true), + isScrollControlled: true, + ).whenComplete(() { + controller.resetSubmitForm(); + }); }, child: Assets.vec.editSvg.svg( width: 20, height: 20, - colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + colorFilter: ColorFilter.mode( + AppColor.blueNormal, + BlendMode.srcIn, + ), ), ), Text( '${item.province}-${item.city}', textAlign: TextAlign.center, - style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + style: AppFonts.yekan16.copyWith( + color: AppColor.greenDark, + ), ), SizedBox(), @@ -176,12 +213,20 @@ class BuyersPage extends GetView { buildRow('مشخصات خریدار', item.fullname ?? 'N/A'), buildRow('نام واحد', item.unitName ?? 'N/A'), - buildRow('تعداد درخواست ها', '${item.requestsInfo?.numberOfRequests.separatedByComma}'), - buildRow('وزن', '${item.requestsInfo?.totalWeight.separatedByComma}'), + buildRow( + 'تعداد درخواست ها', + '${item.requestsInfo?.numberOfRequests.separatedByComma}', + ), + buildRow( + 'وزن', + '${item.requestsInfo?.totalWeight.separatedByComma}', + ), ], ), ), - crossFadeState: expandList.contains(index) ? CrossFadeState.showSecond : CrossFadeState.showFirst, + crossFadeState: expandList.contains(index) + ? CrossFadeState.showSecond + : CrossFadeState.showFirst, duration: Duration(milliseconds: 300), ), ), @@ -195,10 +240,16 @@ class BuyersPage extends GetView { decoration: BoxDecoration( color: AppColor.greenLightHover, borderRadius: BorderRadius.circular(4), - border: Border.all(width: 0.50, color: AppColor.greenDarkActive), + border: Border.all( + width: 0.50, + color: AppColor.greenDarkActive, + ), ), alignment: Alignment.center, - child: Text((index + 1).toString(), style: AppFonts.yekan12.copyWith(color: Colors.black)), + child: Text( + (index + 1).toString(), + style: AppFonts.yekan12.copyWith(color: Colors.black), + ), ), ), ], @@ -218,7 +269,9 @@ class BuyersPage extends GetView { child: Text( title, textAlign: TextAlign.right, - style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), ), ), Flexible( @@ -227,7 +280,9 @@ class BuyersPage extends GetView { value, textAlign: TextAlign.left, - style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), + style: AppFonts.yekan14.copyWith( + color: AppColor.darkGreyDarkHover, + ), ), ), ], @@ -246,7 +301,9 @@ class BuyersPage extends GetView { children: [ Text( isOnEdit ? 'ویرایش خریدار' : 'افزودن خریدار', - style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), + style: AppFonts.yekan16Bold.copyWith( + color: AppColor.darkGreyDarkHover, + ), ), RTextField( diff --git a/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/search_widget.dart b/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/search_widget.dart new file mode 100644 index 0000000..ca5518d --- /dev/null +++ b/packages/chicken/lib/presentation/pages/sales_out_of_province/widgets/search_widget.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_core/core.dart'; + +ObxValue searchWidget( + RxBool searchIsSelected, + void Function(String) onChanged, +) { + return ObxValue((data) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + padding: EdgeInsets.only(top: 5), + curve: Curves.easeInOut, + height: data.value ? 50 : 0, + child: Visibility( + visible: data.value, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: RTextField( + suffixIcon: Padding( + padding: const EdgeInsets.all(12.0), + child: Assets.vec.searchSvg.svg( + width: 10, + height: 10, + colorFilter: ColorFilter.mode( + AppColor.blueNormal, + BlendMode.srcIn, + ), + ), + ), + hintText: 'جستجو', + onChanged: onChanged, + controller: TextEditingController(), + ), + ), + ), + ); + }, searchIsSelected); +}