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

Fix a few notices

This commit is contained in:
2022-03-11 16:27:01 +01:00
parent 5398970868
commit 06312512a6
15 changed files with 19 additions and 52 deletions

View File

@ -37,8 +37,7 @@ class AdvancedGroupInfo extends Group implements LikeElement {
required this.userLike,
required this.conversations,
required this.isForezGroup,
}) : assert(isForezGroup != null),
super(
}) : super(
id: id,
name: name,
iconURL: iconURL,
@ -53,8 +52,7 @@ class AdvancedGroupInfo extends Group implements LikeElement {
@override
LikesType likeType = LikesType.GROUP;
get hasURL => url != null && url.isNotEmpty && url != "null";
get hasURL => url.isNotEmpty && url != "null";
get hasDescription =>
description != null && description.isNotEmpty && description != "null";
get hasDescription => description.isNotEmpty && description != "null";
}

View File

@ -32,21 +32,15 @@ class APIRequest {
Map<String, File> files = Map();
Map<String, BytesFile?> bytesFiles = Map();
APIRequest({required this.uri, this.needLogin = false, this.args})
: assert(uri != null),
assert(needLogin != null) {
APIRequest({required this.uri, this.needLogin = false, this.args}) {
if (this.args == null) this.args = Map();
}
APIRequest.withLogin(this.uri, {this.args})
: needLogin = true,
assert(uri != null) {
APIRequest.withLogin(this.uri, {this.args}) : needLogin = true {
if (args == null) this.args = Map();
}
APIRequest.withoutLogin(this.uri, {this.args})
: needLogin = false,
assert(uri != null) {
APIRequest.withoutLogin(this.uri, {this.args}) : needLogin = false {
if (args == null) this.args = Map();
}

View File

@ -1,5 +1,3 @@
/// Call configuration
///
/// @author Pierre Hubert
@ -9,7 +7,7 @@ class CallConfig {
const CallConfig({
required this.iceServers,
}) : assert(iceServers != null);
});
/// Turn this call configuration into the right for the WebRTC plugin
Map<String, dynamic> get pluginConfig => {

View File

@ -112,8 +112,7 @@ class ConversationServerMessage {
required this.userAdded,
required this.userWhoRemoved,
required this.userRemoved,
}) : assert(type != null),
assert(userID != null ||
}) : assert(userID != null ||
(type != ConversationServerMessageType.USER_CREATED_CONVERSATION &&
type != ConversationServerMessageType.USER_LEFT_CONV)),
assert((userWhoAdded != null && userAdded != null) ||

View File

@ -24,17 +24,9 @@ class Survey {
required this.userChoice,
required this.choices,
required this.allowNewChoicesCreation,
}) : assert(id != null),
assert(userID != null),
assert(postID != null),
assert(creationTime != null),
assert(question != null),
assert(userChoice != null),
assert(choices != null),
assert(choices.length > 0),
assert(allowNewChoicesCreation != null);
}) : assert(choices.length > 0);
bool get hasResponded => this.userChoice != null && this.userChoice > 0;
bool get hasResponded => this.userChoice > 0;
bool get hasResponses =>
this.choices.where((f) => f.responses > 0).length > 0;