|
|
|
|
@ -24,7 +24,7 @@ class _MyRequestsPageState extends State<MyRequestsPage> {
|
|
|
|
|
SearchAllRequestsModel _search;
|
|
|
|
|
|
|
|
|
|
List<String> requestsList;
|
|
|
|
|
int selectedRequest=0;
|
|
|
|
|
int selectedRequest = 0;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
@ -89,58 +89,62 @@ class _MyRequestsPageState extends State<MyRequestsPage> {
|
|
|
|
|
],
|
|
|
|
|
).paddingOnly(start: 16, end: 16),
|
|
|
|
|
),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (_filterIsEmpty())
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50.toScreenHeight,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
padding: const EdgeInsets.only(top: 16, right: 16, left: 16),
|
|
|
|
|
itemBuilder: (cxt, index) => Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
foregroundDecoration: selectedRequest != index
|
|
|
|
|
? null
|
|
|
|
|
: ShapeDecoration(
|
|
|
|
|
color: (context.isDark ? AppColor.neutral30 : AppColor.neutral50).withOpacity(0.1),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(width: 1, color: AppColor.blueStatus(context)),
|
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
|
body: Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
|
|
|
|
|
return Column(
|
|
|
|
|
children: [
|
|
|
|
|
if (_filterIsEmpty())
|
|
|
|
|
SizedBox(
|
|
|
|
|
height: 50.toScreenHeight,
|
|
|
|
|
child: ListView.separated(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
padding: const EdgeInsets.only(top: 16, right: 16, left: 16),
|
|
|
|
|
itemBuilder: (cxt, index) => Container(
|
|
|
|
|
alignment: Alignment.center,
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 8),
|
|
|
|
|
foregroundDecoration: selectedRequest != index
|
|
|
|
|
? null
|
|
|
|
|
: ShapeDecoration(
|
|
|
|
|
color: (context.isDark ? AppColor.neutral30 : AppColor.neutral50).withOpacity(0.1),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: BorderSide(width: 1, color: AppColor.blueStatus(context)),
|
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: selectedRequest == index ? AppColor.selectedButtonColor(context) : AppColor.unSelectedButtonColor(context),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: selectedRequest == index ? BorderSide(width: 1, color: AppColor.blueStatus(context)) : BorderSide.none,
|
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: selectedRequest == index ? AppColor.selectedButtonColor(context) : AppColor.unSelectedButtonColor(context).withOpacity(snapshot.isAllLoading ? 0.7 : 1),
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
side: selectedRequest == index ? BorderSide(width: 1, color: AppColor.blueStatus(context)) : BorderSide.none,
|
|
|
|
|
borderRadius: BorderRadius.circular(7),
|
|
|
|
|
),
|
|
|
|
|
shadows: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 14, offset: const Offset(0, 0), spreadRadius: 0)],
|
|
|
|
|
),
|
|
|
|
|
shadows: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 14, offset: const Offset(0, 0), spreadRadius: 0)],
|
|
|
|
|
),
|
|
|
|
|
child: Text(requestsList[index], style: AppTextStyles.bodyText2.copyWith(height: 1, color: AppColor.filterButtonTextColor(context))),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
if (selectedRequest != index) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedRequest = index;
|
|
|
|
|
});
|
|
|
|
|
_provider.reset();
|
|
|
|
|
_provider.getAllRequests(context, typeTransaction: selectedRequest == 0 ? null : selectedRequest);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
separatorBuilder: (cxt, index) => 8.width,
|
|
|
|
|
itemCount: requestsList.length),
|
|
|
|
|
),
|
|
|
|
|
Consumer<AllRequestsProvider>(builder: (context, snapshot, _) {
|
|
|
|
|
return LazyLoading(
|
|
|
|
|
child: Text(requestsList[index], style: AppTextStyles.bodyText2.copyWith(height: 1, color: AppColor.filterButtonTextColor(context))),
|
|
|
|
|
).onPress(() {
|
|
|
|
|
if (snapshot.isAllLoading) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (selectedRequest != index) {
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedRequest = index;
|
|
|
|
|
});
|
|
|
|
|
_provider.reset();
|
|
|
|
|
_provider.getAllRequests(context, typeTransaction: selectedRequest == 0 ? null : selectedRequest);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
separatorBuilder: (cxt, index) => 8.width,
|
|
|
|
|
itemCount: requestsList.length),
|
|
|
|
|
),
|
|
|
|
|
LazyLoading(
|
|
|
|
|
child: RequestItemViewList(snapshot.allRequestsAndCount?.requestsDetails ?? [], snapshot.isAllLoading),
|
|
|
|
|
nextPage: snapshot.nextPage,
|
|
|
|
|
onLazyLoad: (){
|
|
|
|
|
print(selectedRequest);
|
|
|
|
|
snapshot.getAllRequests(context, typeTransaction: selectedRequest == 0 ? null : selectedRequest);},
|
|
|
|
|
);
|
|
|
|
|
}).expanded,
|
|
|
|
|
],
|
|
|
|
|
));
|
|
|
|
|
onLazyLoad: () {
|
|
|
|
|
snapshot.getAllRequests(context, typeTransaction: selectedRequest == 0 ? null : selectedRequest);
|
|
|
|
|
},
|
|
|
|
|
).expanded,
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool _filterIsEmpty() {
|
|
|
|
|
|