mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-21 20:39:22 +00:00
Fix a few notices
This commit is contained in:
parent
5398970868
commit
06312512a6
@ -36,8 +36,7 @@ class _JoinGroupPaneBody extends StatefulWidget {
|
||||
const _JoinGroupPaneBody({
|
||||
Key? key,
|
||||
required this.onUpdated,
|
||||
}) : assert(onUpdated != null),
|
||||
super(key: key);
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
JoinGroupPaneBodyState createState() => JoinGroupPaneBodyState();
|
||||
|
@ -26,8 +26,7 @@ class ForezMemberProfileRoute extends StatefulWidget {
|
||||
const ForezMemberProfileRoute({
|
||||
Key? key,
|
||||
required this.userID,
|
||||
}) : assert(userID != null),
|
||||
super(key: key);
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_ForezMemberProfileRouteState createState() =>
|
||||
|
@ -210,7 +210,5 @@ class _Tab {
|
||||
required this.title,
|
||||
required this.widget,
|
||||
this.isUnread,
|
||||
}) : assert(icon != null),
|
||||
assert(title != null),
|
||||
assert(widget != null);
|
||||
});
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ Future<User?> searchUser(BuildContext context, UsersList users) async {
|
||||
class _SearchDelegate extends SearchDelegate<User?> {
|
||||
final UsersList _usersList;
|
||||
|
||||
_SearchDelegate(this._usersList) : assert(_usersList != null);
|
||||
_SearchDelegate(this._usersList);
|
||||
|
||||
@override
|
||||
List<Widget>? buildActions(BuildContext context) => null;
|
||||
|
@ -207,12 +207,7 @@ class _MembershipButton extends StatelessWidget {
|
||||
required this.onTap,
|
||||
required this.color,
|
||||
required this.icon,
|
||||
}) : assert(user != null),
|
||||
assert(action != null),
|
||||
assert(onTap != null),
|
||||
assert(color != null),
|
||||
assert(icon != null),
|
||||
super(key: key);
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => ElevatedButton(
|
||||
|
@ -122,9 +122,7 @@ class NewCallSignalEvent {
|
||||
required this.peerID,
|
||||
this.sessionDescription,
|
||||
this.candidate,
|
||||
}) : assert(callID != null),
|
||||
assert(peerID != null),
|
||||
assert(sessionDescription != null || candidate != null);
|
||||
}) : assert(sessionDescription != null || candidate != null);
|
||||
}
|
||||
|
||||
/// Call peer ready event
|
||||
|
@ -51,7 +51,7 @@ class GetAdvancedInfoResult {
|
||||
final GetAdvancedInfoStatus status;
|
||||
final AdvancedGroupInfo? info;
|
||||
|
||||
GetAdvancedInfoResult(this.status, this.info) : assert(status != null);
|
||||
GetAdvancedInfoResult(this.status, this.info);
|
||||
}
|
||||
|
||||
/// Groups helper
|
||||
|
@ -15,8 +15,7 @@ class ConversationsMessagesSerializationHelper
|
||||
final int convID;
|
||||
|
||||
ConversationsMessagesSerializationHelper._(int convID)
|
||||
: convID = convID,
|
||||
assert(convID != null);
|
||||
: convID = convID;
|
||||
|
||||
factory ConversationsMessagesSerializationHelper(int? convID) {
|
||||
if (_instances == null) _instances = HashMap();
|
||||
|
@ -26,8 +26,6 @@ class SurveyHelper {
|
||||
/// Send the response of a user to a survey
|
||||
Future<bool> respondToSurvey(
|
||||
{required Survey survey, required SurveyChoice choice}) async {
|
||||
assert(survey != null);
|
||||
assert(choice != null);
|
||||
|
||||
return (await APIRequest(
|
||||
uri: "surveys/send_response",
|
||||
|
@ -13,7 +13,7 @@ class VirtualDirectoryResult {
|
||||
const VirtualDirectoryResult({
|
||||
required this.type,
|
||||
this.id,
|
||||
}) : assert(type != null);
|
||||
});
|
||||
}
|
||||
|
||||
class VirtualDirectoryHelper {
|
||||
|
@ -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";
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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 => {
|
||||
|
@ -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) ||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user