brand theme, allot of features, allot of bug fixes
This commit is contained in:
@@ -98,7 +98,18 @@ final deliveriesProvider = FutureProvider.family<List<Delivery>, int>((ref, rout
|
||||
},
|
||||
);
|
||||
|
||||
return result.whenSuccess((deliveries) => deliveries) ?? [];
|
||||
// Log error if API call failed
|
||||
result.whenError((error) {
|
||||
print('ERROR fetching deliveries for route $routeFragmentId: ${error.message}');
|
||||
if (error.originalException != null) {
|
||||
print('Original exception: ${error.originalException}');
|
||||
}
|
||||
});
|
||||
|
||||
final deliveries = result.whenSuccess((deliveries) => deliveries) ?? [];
|
||||
|
||||
// Always append the warehouse delivery at the end
|
||||
return [...deliveries, Delivery.createWarehouseDelivery()];
|
||||
});
|
||||
|
||||
/// Provider to get all deliveries from all routes
|
||||
|
||||
Reference in New Issue
Block a user