Compare commits

..

No commits in common. 'c4f4af7e63e884429cab75340bc0a347c6324419' and '92e704a1b42caedc8e9820e30c47b710e78ec9ed' have entirely different histories.

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

@ -1553,7 +1553,6 @@ class _ResourcesFleetScreenState extends State<ResourcesFleetScreen> {
onTap: (){ onTap: (){
setState(() { setState(() {
selectedFilter = "Maintenance"; selectedFilter = "Maintenance";
}); });
}, },
child: SmallMetricBox( child: SmallMetricBox(

@ -88,7 +88,6 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
int selectedTab = 2; int selectedTab = 2;
String search = ''; String search = '';
bool isLoading = false; bool isLoading = false;
String selectedWaterFilter = "all";
List<SourceLocationsModel> sourceLocationsList = []; List<SourceLocationsModel> sourceLocationsList = [];
// ---------- Form state (bottom sheet) ---------- // ---------- Form state (bottom sheet) ----------
@ -717,16 +716,6 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
bool matchesFilter = true; bool matchesFilter = true;
// Top metric filter
if(selectedWaterFilter != "all"){
matchesFilter =
it.water_type.toLowerCase().trim() ==
selectedWaterFilter;
}
// Menu filter
if(selectedFilter!=null){ if(selectedFilter!=null){
matchesFilter = matchesFilter =
@ -824,58 +813,29 @@ class _ResourcesSourceScreenState extends State<ResourcesSourceScreen> {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
Expanded( Expanded(
child: GestureDetector( child: SmallMetricBox(
onTap: (){ title: 'Drinking water',
setState(() { value: drinkingCount.toString(),
selectedWaterFilter = "drinking water";
selectedFilter = null;
});
},
child: SmallMetricBox(
title: 'Drinking water',
value: drinkingCount.toString(),
),
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Expanded( Expanded(
child: GestureDetector( child: SmallMetricBox(
onTap: (){ title: 'Bore water',
setState(() { value: boreCount.toString(),
selectedWaterFilter = "bore water";
selectedFilter = null;
});
},
child: SmallMetricBox(
title: 'Bore water',
value: boreCount.toString(),
),
), ),
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
Expanded( Expanded(
child: GestureDetector( child: SmallMetricBox(
onTap: (){ title: 'Both',
setState(() { value: bothCount.toString(),
selectedWaterFilter = "both";
selectedFilter = null;
});
},
child: SmallMetricBox(
title: 'Both',
value: bothCount.toString(),
),
), ),
), ),
], ],
), ),
), ),
], ],
), ),

Loading…
Cancel
Save