mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 00:05:16 +00:00
Can generate a random account image
This commit is contained in:
@ -10,11 +10,19 @@ import 'package:meta/meta.dart';
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class BytesFile {
|
||||
final String filename;
|
||||
final List<int> bytes;
|
||||
|
||||
BytesFile(this.filename, this.bytes);
|
||||
}
|
||||
|
||||
class APIRequest {
|
||||
final String uri;
|
||||
final bool needLogin;
|
||||
Map<String, String> args;
|
||||
Map<String, File> files = Map();
|
||||
Map<String, BytesFile> bytesFiles = Map();
|
||||
|
||||
APIRequest({@required this.uri, this.needLogin = false, this.args})
|
||||
: assert(uri != null),
|
||||
@ -42,6 +50,11 @@ class APIRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
APIRequest addBytesFile(String name, BytesFile file) {
|
||||
this.bytesFiles[name] = file;
|
||||
return this;
|
||||
}
|
||||
|
||||
void addArgs(Map<String, String> newArgs) => args.addAll(newArgs);
|
||||
|
||||
/// Execute the request
|
||||
|
Reference in New Issue
Block a user