add paginator
This commit is contained in:
43
lib/data/provider/shipment_data_provider.dart
Normal file
43
lib/data/provider/shipment_data_provider.dart
Normal file
@@ -0,0 +1,43 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fcs/domain/entities/shipment.dart';
|
||||
import 'package:fcs/helpers/api_helper.dart';
|
||||
import 'package:fcs/helpers/firebase_helper.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
|
||||
class ShipmentDataProvider {
|
||||
final log = Logger('ShipmentDataProvider');
|
||||
|
||||
static final ShipmentDataProvider instance = ShipmentDataProvider._();
|
||||
ShipmentDataProvider._();
|
||||
|
||||
Future<void> createShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipments", "POST",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> updateShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipments", "PUT",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> cancelShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipment_cancel", "PUT",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> confirmShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipment_confirm", "PUT",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> pickupShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipment_pickup", "PUT",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
|
||||
Future<void> receiveShipment(Shipment shipment) async {
|
||||
return await requestAPI("/shipment_receive", "PUT",
|
||||
payload: shipment.toMap(), token: await getToken());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user