feat: add Flutter web build support
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:uuid/uuid.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
import '../../domain/models/service_models.dart';
|
||||
import '../services/api_client.dart';
|
||||
@@ -86,14 +87,17 @@ class ServiceRepository {
|
||||
|
||||
Future<void> arrive(String identity) async {
|
||||
final point = await _location.current();
|
||||
await _api.post('$root/delivery/orders/$identity/arrive', body: _pointJson(point));
|
||||
await _api.post(
|
||||
'$root/delivery/orders/$identity/arrive',
|
||||
body: _pointJson(point),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> submitDeliveryReceipt({
|
||||
required String identity,
|
||||
required String recipientName,
|
||||
required String recipientPhone,
|
||||
required String proofFile,
|
||||
required XFile proofFile,
|
||||
}) async {
|
||||
final proofUri = await _api.upload(proofFile);
|
||||
await _api.post(
|
||||
@@ -118,7 +122,7 @@ class ServiceRepository {
|
||||
final uploaded = <Map<String, Object?>>[];
|
||||
for (final item in evidence) {
|
||||
final uri = await _api.upload(
|
||||
item.filePath,
|
||||
item.file,
|
||||
contentType: item.mediaType == 'video' ? 'video/mp4' : 'image/jpeg',
|
||||
);
|
||||
uploaded.add({
|
||||
@@ -153,14 +157,14 @@ class EvidenceInput {
|
||||
const EvidenceInput({
|
||||
required this.evidenceType,
|
||||
required this.mediaType,
|
||||
required this.filePath,
|
||||
required this.file,
|
||||
required this.capturedAt,
|
||||
required this.requestNo,
|
||||
});
|
||||
|
||||
final String evidenceType;
|
||||
final String mediaType;
|
||||
final String filePath;
|
||||
final XFile file;
|
||||
final DateTime capturedAt;
|
||||
final String requestNo;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user