|
|
|
|
@ -51,7 +51,7 @@ class _ResourcesDriverScreenState extends State<ResourcesDriverScreen> {
|
|
|
|
|
String search = '';
|
|
|
|
|
bool isLoading = false;
|
|
|
|
|
List<DriversModel> driversList = [];
|
|
|
|
|
|
|
|
|
|
String selectedStatus = "all";
|
|
|
|
|
// ---------- form (bottom sheet) ----------
|
|
|
|
|
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
|
|
@ -1319,6 +1319,27 @@ class _ResourcesDriverScreenState extends State<ResourcesDriverScreen> {
|
|
|
|
|
|
|
|
|
|
bool matchesFilter = true;
|
|
|
|
|
|
|
|
|
|
// Top metric click filter
|
|
|
|
|
if(selectedStatus != "all"){
|
|
|
|
|
|
|
|
|
|
if(selectedStatus == "delivery"){
|
|
|
|
|
matchesFilter =
|
|
|
|
|
it.status.toLowerCase().trim() == "on delivery";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(selectedStatus == "available"){
|
|
|
|
|
matchesFilter =
|
|
|
|
|
it.status.toLowerCase().trim() == "available";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(selectedStatus == "offline"){
|
|
|
|
|
matchesFilter =
|
|
|
|
|
it.status.toLowerCase().trim() == "offline";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Menu filter
|
|
|
|
|
if(selectedFilter!=null){
|
|
|
|
|
|
|
|
|
|
matchesFilter =
|
|
|
|
|
@ -1408,29 +1429,58 @@ class _ResourcesDriverScreenState extends State<ResourcesDriverScreen> {
|
|
|
|
|
child: IntrinsicHeight(
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'On delivery',
|
|
|
|
|
value: onDeliveryCount.toString(),
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedStatus = "delivery";
|
|
|
|
|
selectedFilter = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'On delivery',
|
|
|
|
|
value: onDeliveryCount.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'Available',
|
|
|
|
|
value: availableCount.toString(),
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedStatus = "available";
|
|
|
|
|
selectedFilter = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'Available',
|
|
|
|
|
value: availableCount.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'Offline',
|
|
|
|
|
value: offlineCount.toString(),
|
|
|
|
|
child: GestureDetector(
|
|
|
|
|
onTap: (){
|
|
|
|
|
setState(() {
|
|
|
|
|
selectedStatus = "offline";
|
|
|
|
|
selectedFilter = null;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
child: SmallMetricBox(
|
|
|
|
|
title: 'Offline',
|
|
|
|
|
value: offlineCount.toString(),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
|