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:
21
lib/models/account_image_settings.dart
Normal file
21
lib/models/account_image_settings.dart
Normal 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);
|
||||
}
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user