file picker
This commit is contained in:
parent
5c4a28765c
commit
4ac218b065
|
@ -0,0 +1,27 @@
|
|||
import 'package:http/http.dart';
|
||||
|
||||
class FileUpload {
|
||||
final MultipartFile data;
|
||||
String description;
|
||||
final String path;
|
||||
|
||||
// media id for identity,
|
||||
// gets set after first sucessfully uploading
|
||||
Map<String, String> ids = {};
|
||||
|
||||
FileUpload({
|
||||
required this.data,
|
||||
required this.description,
|
||||
required this.path,
|
||||
this.ids = const {},
|
||||
});
|
||||
|
||||
static Future<FileUpload> fromPath(String path, String description) async {
|
||||
final data = await MultipartFile.fromPath("file", path);
|
||||
return FileUpload(
|
||||
data: data,
|
||||
description: description,
|
||||
path: path,
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue