|
|
|
@ -32,28 +32,33 @@ class MyRequestsFragment extends StatelessWidget {
|
|
|
|
|
),
|
|
|
|
|
8.height,
|
|
|
|
|
Expanded(
|
|
|
|
|
child: RefreshIndicator(
|
|
|
|
|
onRefresh: () async => await requestsVM.getRequests(isNeedToRebuild: true, appType: AppType.customer),
|
|
|
|
|
child: requestsVM.state == ViewState.busy
|
|
|
|
|
? const Center(child: CircularProgressIndicator())
|
|
|
|
|
: requestsVM.myFilteredRequests.isEmpty
|
|
|
|
|
? Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
"No Requests to show.".toText(fontSize: 16, color: MyColors.lightTextColor),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return RequestItem(request: requestsVM.myFilteredRequests[index], appType: AppType.customer);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return 16.height;
|
|
|
|
|
},
|
|
|
|
|
itemCount: requestsVM.myFilteredRequests.length,
|
|
|
|
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8),
|
|
|
|
|
),
|
|
|
|
|
))
|
|
|
|
|
child: RefreshIndicator(
|
|
|
|
|
onRefresh: () async => await requestsVM.getRequests(isNeedToRebuild: true, appType: AppType.customer),
|
|
|
|
|
child: requestsVM.state == ViewState.busy
|
|
|
|
|
? const Center(child: CircularProgressIndicator())
|
|
|
|
|
: requestsVM.myFilteredRequests.isEmpty
|
|
|
|
|
? Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
|
|
|
|
"No Requests to show.".toText(fontSize: 16, color: MyColors.lightTextColor),
|
|
|
|
|
],
|
|
|
|
|
)
|
|
|
|
|
: ListView.separated(
|
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|
return RequestItem(
|
|
|
|
|
request: requestsVM.myFilteredRequests[index],
|
|
|
|
|
appType: AppType.customer,
|
|
|
|
|
requestIndex: index,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
separatorBuilder: (context, index) {
|
|
|
|
|
return 16.height;
|
|
|
|
|
},
|
|
|
|
|
itemCount: requestsVM.myFilteredRequests.length,
|
|
|
|
|
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 16, top: 8),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}),
|
|
|
|
|