feat : search and filter in buyer out of the province
This commit is contained in:
@@ -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';
|
|
||||||
}
|
|
||||||
@@ -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';
|
|
||||||
}
|
|
||||||
@@ -52,14 +52,17 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
GestureDetector(
|
Visibility(
|
||||||
onTap: () {
|
visible: controller.currentIndex.value==0,
|
||||||
// Get.bottomSheet(filterBottomSheet());
|
child: GestureDetector(
|
||||||
},
|
onTap: () {
|
||||||
child: Assets.vec.filterOutlineSvg.svg(
|
// Get.bottomSheet(filterBottomSheet());
|
||||||
width: 20,
|
},
|
||||||
height: 20,
|
child: Assets.vec.filterOutlineSvg.svg(
|
||||||
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: const ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 8),
|
SizedBox(width: 8),
|
||||||
@@ -800,35 +803,5 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObxValue<RxBool> _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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/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/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/logic.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/sales_out_of_province/widgets/search_widget.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'empty_widget.dart';
|
import 'empty_widget.dart';
|
||||||
@@ -13,10 +14,22 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: buyerListWidget(),
|
body: Column(
|
||||||
|
children: [
|
||||||
|
searchWidget(controller.searchIsSelected, (data) {
|
||||||
|
controller.searchedValue.value = data;
|
||||||
|
controller.getOutProvinceCarcassesBuyer();
|
||||||
|
}),
|
||||||
|
|
||||||
|
buyerListWidget(),
|
||||||
|
],
|
||||||
|
),
|
||||||
floatingActionButton: RFab.add(
|
floatingActionButton: RFab.add(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.bottomSheet(addOrEditBuyerBottomSheet(), isScrollControlled: true);
|
Get.bottomSheet(
|
||||||
|
addOrEditBuyerBottomSheet(),
|
||||||
|
isScrollControlled: true,
|
||||||
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||||
@@ -36,7 +49,11 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return ObxValue(
|
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,
|
controller.isExpandedList,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -84,7 +101,10 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
border: Border.all(width: 0.5, color: AppColor.darkGreyNormal),
|
border: Border.all(
|
||||||
|
width: 0.5,
|
||||||
|
color: AppColor.darkGreyNormal,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: AnimatedCrossFade(
|
child: AnimatedCrossFade(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
@@ -102,14 +122,18 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
Text(
|
Text(
|
||||||
item.buyer?.fullname ?? 'N/A',
|
item.buyer?.fullname ?? 'N/A',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
style: AppFonts.yekan14.copyWith(
|
||||||
|
color: AppColor.blueNormal,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(height: 2),
|
SizedBox(height: 2),
|
||||||
Text(
|
Text(
|
||||||
item.buyer?.mobile ?? 'N/A',
|
item.buyer?.mobile ?? 'N/A',
|
||||||
textAlign: TextAlign.center,
|
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<SalesOutOfProvinceLogic> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${item.unitName}',
|
'${item.unitName}',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
style: AppFonts.yekan12.copyWith(
|
||||||
|
color: AppColor.bgDark,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@@ -129,7 +155,9 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${item.buyer?.province}\n${item.buyer?.city}',
|
'${item.buyer?.province}\n${item.buyer?.city}',
|
||||||
textAlign: TextAlign.center,
|
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<SalesOutOfProvinceLogic> {
|
|||||||
secondChild: Container(
|
secondChild: Container(
|
||||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
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(
|
child: Column(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
@@ -151,23 +182,29 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.setEditData(item);
|
controller.setEditData(item);
|
||||||
Get.bottomSheet(addOrEditBuyerBottomSheet(true), isScrollControlled: true).whenComplete(
|
Get.bottomSheet(
|
||||||
() {
|
addOrEditBuyerBottomSheet(true),
|
||||||
controller.resetSubmitForm();
|
isScrollControlled: true,
|
||||||
},
|
).whenComplete(() {
|
||||||
);
|
controller.resetSubmitForm();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Assets.vec.editSvg.svg(
|
child: Assets.vec.editSvg.svg(
|
||||||
width: 20,
|
width: 20,
|
||||||
height: 20,
|
height: 20,
|
||||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
colorFilter: ColorFilter.mode(
|
||||||
|
AppColor.blueNormal,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
'${item.province}-${item.city}',
|
'${item.province}-${item.city}',
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
style: AppFonts.yekan16.copyWith(
|
||||||
|
color: AppColor.greenDark,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
SizedBox(),
|
SizedBox(),
|
||||||
@@ -176,12 +213,20 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
|
|
||||||
buildRow('مشخصات خریدار', item.fullname ?? 'N/A'),
|
buildRow('مشخصات خریدار', item.fullname ?? 'N/A'),
|
||||||
buildRow('نام واحد', item.unitName ?? 'N/A'),
|
buildRow('نام واحد', item.unitName ?? 'N/A'),
|
||||||
buildRow('تعداد درخواست ها', '${item.requestsInfo?.numberOfRequests.separatedByComma}'),
|
buildRow(
|
||||||
buildRow('وزن', '${item.requestsInfo?.totalWeight.separatedByComma}'),
|
'تعداد درخواست ها',
|
||||||
|
'${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),
|
duration: Duration(milliseconds: 300),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -195,10 +240,16 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: AppColor.greenLightHover,
|
color: AppColor.greenLightHover,
|
||||||
borderRadius: BorderRadius.circular(4),
|
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,
|
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<SalesOutOfProvinceLogic> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
title,
|
title,
|
||||||
textAlign: TextAlign.right,
|
textAlign: TextAlign.right,
|
||||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
style: AppFonts.yekan14.copyWith(
|
||||||
|
color: AppColor.darkGreyDarkHover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Flexible(
|
Flexible(
|
||||||
@@ -227,7 +280,9 @@ class BuyersPage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
value,
|
value,
|
||||||
textAlign: TextAlign.left,
|
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<SalesOutOfProvinceLogic> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
isOnEdit ? 'ویرایش خریدار' : 'افزودن خریدار',
|
isOnEdit ? 'ویرایش خریدار' : 'افزودن خریدار',
|
||||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
style: AppFonts.yekan16Bold.copyWith(
|
||||||
|
color: AppColor.darkGreyDarkHover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
RTextField(
|
RTextField(
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
|
ObxValue<RxBool> 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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user