1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-06-19 00:05:16 +00:00

Can upload new account image

This commit is contained in:
2020-04-16 19:16:44 +02:00
parent 7071600c3f
commit 8feea380a4
6 changed files with 243 additions and 10 deletions

View File

@ -0,0 +1,21 @@
import 'package:flutter/widgets.dart';
/// Account image settings
///
/// @author Pierre Hubert
enum AccountImageVisibilityLevels { EVERYONE, COMUNIC_USERS, FRIENDS_ONLY }
class AccountImageSettings {
final bool hasImage;
final String imageURL;
final AccountImageVisibilityLevels visibility;
const AccountImageSettings({
@required this.hasImage,
@required this.imageURL,
@required this.visibility,
}) : assert(hasImage != null),
assert(imageURL != null),
assert(visibility != null);
}

View File

@ -22,14 +22,25 @@ class APIRequest {
if (this.args == null) this.args = Map();
}
void addString(String name, String value) => args[name] = value;
APIRequest addString(String name, String value) {
args[name] = value;
return this;
}
void addInt(String name, int value) => args[name] = value.toString();
APIRequest addInt(String name, int value) {
args[name] = value.toString();
return this;
}
void addBool(String name, bool value) =>
args[name] = value ? "true" : "false";
APIRequest addBool(String name, bool value) {
args[name] = value ? "true" : "false";
return this;
}
void addFile(String name, File file) => files[name] = file;
APIRequest addFile(String name, File file) {
files[name] = file;
return this;
}
void addArgs(Map<String, String> newArgs) => args.addAll(newArgs);