1
0
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:
2020-04-17 08:44:57 +02:00
parent 7bb805bffd
commit 7e01947da9
6 changed files with 84 additions and 3 deletions

View File

@ -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