mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 04:49:21 +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({
|
const _JoinGroupPaneBody({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.onUpdated,
|
required this.onUpdated,
|
||||||
}) : assert(onUpdated != null),
|
}) : super(key: key);
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
JoinGroupPaneBodyState createState() => JoinGroupPaneBodyState();
|
JoinGroupPaneBodyState createState() => JoinGroupPaneBodyState();
|
||||||
|
@ -26,8 +26,7 @@ class ForezMemberProfileRoute extends StatefulWidget {
|
|||||||
const ForezMemberProfileRoute({
|
const ForezMemberProfileRoute({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.userID,
|
required this.userID,
|
||||||
}) : assert(userID != null),
|
}) : super(key: key);
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
_ForezMemberProfileRouteState createState() =>
|
_ForezMemberProfileRouteState createState() =>
|
||||||
|
@ -210,7 +210,5 @@ class _Tab {
|
|||||||
required this.title,
|
required this.title,
|
||||||
required this.widget,
|
required this.widget,
|
||||||
this.isUnread,
|
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?> {
|
class _SearchDelegate extends SearchDelegate<User?> {
|
||||||
final UsersList _usersList;
|
final UsersList _usersList;
|
||||||
|
|
||||||
_SearchDelegate(this._usersList) : assert(_usersList != null);
|
_SearchDelegate(this._usersList);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
List<Widget>? buildActions(BuildContext context) => null;
|
List<Widget>? buildActions(BuildContext context) => null;
|
||||||
|
@ -207,12 +207,7 @@ class _MembershipButton extends StatelessWidget {
|
|||||||
required this.onTap,
|
required this.onTap,
|
||||||
required this.color,
|
required this.color,
|
||||||
required this.icon,
|
required this.icon,
|
||||||
}) : assert(user != null),
|
}) : super(key: key);
|
||||||
assert(action != null),
|
|
||||||
assert(onTap != null),
|
|
||||||
assert(color != null),
|
|
||||||
assert(icon != null),
|
|
||||||
super(key: key);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) => ElevatedButton(
|
Widget build(BuildContext context) => ElevatedButton(
|
||||||
|
@ -122,9 +122,7 @@ class NewCallSignalEvent {
|
|||||||
required this.peerID,
|
required this.peerID,
|
||||||
this.sessionDescription,
|
this.sessionDescription,
|
||||||
this.candidate,
|
this.candidate,
|
||||||
}) : assert(callID != null),
|
}) : assert(sessionDescription != null || candidate != null);
|
||||||
assert(peerID != null),
|
|
||||||
assert(sessionDescription != null || candidate != null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Call peer ready event
|
/// Call peer ready event
|
||||||
|
@ -51,7 +51,7 @@ class GetAdvancedInfoResult {
|
|||||||
final GetAdvancedInfoStatus status;
|
final GetAdvancedInfoStatus status;
|
||||||
final AdvancedGroupInfo? info;
|
final AdvancedGroupInfo? info;
|
||||||
|
|
||||||
GetAdvancedInfoResult(this.status, this.info) : assert(status != null);
|
GetAdvancedInfoResult(this.status, this.info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Groups helper
|
/// Groups helper
|
||||||
|
@ -15,8 +15,7 @@ class ConversationsMessagesSerializationHelper
|
|||||||
final int convID;
|
final int convID;
|
||||||
|
|
||||||
ConversationsMessagesSerializationHelper._(int convID)
|
ConversationsMessagesSerializationHelper._(int convID)
|
||||||
: convID = convID,
|
: convID = convID;
|
||||||
assert(convID != null);
|
|
||||||
|
|
||||||
factory ConversationsMessagesSerializationHelper(int? convID) {
|
factory ConversationsMessagesSerializationHelper(int? convID) {
|
||||||
if (_instances == null) _instances = HashMap();
|
if (_instances == null) _instances = HashMap();
|
||||||
|
@ -26,8 +26,6 @@ class SurveyHelper {
|
|||||||
/// Send the response of a user to a survey
|
/// Send the response of a user to a survey
|
||||||
Future<bool> respondToSurvey(
|
Future<bool> respondToSurvey(
|
||||||
{required Survey survey, required SurveyChoice choice}) async {
|
{required Survey survey, required SurveyChoice choice}) async {
|
||||||
assert(survey != null);
|
|
||||||
assert(choice != null);
|
|
||||||
|
|
||||||
return (await APIRequest(
|
return (await APIRequest(
|
||||||
uri: "surveys/send_response",
|
uri: "surveys/send_response",
|
||||||
|
@ -13,7 +13,7 @@ class VirtualDirectoryResult {
|
|||||||
const VirtualDirectoryResult({
|
const VirtualDirectoryResult({
|
||||||
required this.type,
|
required this.type,
|
||||||
this.id,
|
this.id,
|
||||||
}) : assert(type != null);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class VirtualDirectoryHelper {
|
class VirtualDirectoryHelper {
|
||||||
|
@ -37,8 +37,7 @@ class AdvancedGroupInfo extends Group implements LikeElement {
|
|||||||
required this.userLike,
|
required this.userLike,
|
||||||
required this.conversations,
|
required this.conversations,
|
||||||
required this.isForezGroup,
|
required this.isForezGroup,
|
||||||
}) : assert(isForezGroup != null),
|
}) : super(
|
||||||
super(
|
|
||||||
id: id,
|
id: id,
|
||||||
name: name,
|
name: name,
|
||||||
iconURL: iconURL,
|
iconURL: iconURL,
|
||||||
@ -53,8 +52,7 @@ class AdvancedGroupInfo extends Group implements LikeElement {
|
|||||||
@override
|
@override
|
||||||
LikesType likeType = LikesType.GROUP;
|
LikesType likeType = LikesType.GROUP;
|
||||||
|
|
||||||
get hasURL => url != null && url.isNotEmpty && url != "null";
|
get hasURL => url.isNotEmpty && url != "null";
|
||||||
|
|
||||||
get hasDescription =>
|
get hasDescription => description.isNotEmpty && description != "null";
|
||||||
description != null && description.isNotEmpty && description != "null";
|
|
||||||
}
|
}
|
||||||
|
@ -32,21 +32,15 @@ class APIRequest {
|
|||||||
Map<String, File> files = Map();
|
Map<String, File> files = Map();
|
||||||
Map<String, BytesFile?> bytesFiles = Map();
|
Map<String, BytesFile?> bytesFiles = Map();
|
||||||
|
|
||||||
APIRequest({required this.uri, this.needLogin = false, this.args})
|
APIRequest({required this.uri, this.needLogin = false, this.args}) {
|
||||||
: assert(uri != null),
|
|
||||||
assert(needLogin != null) {
|
|
||||||
if (this.args == null) this.args = Map();
|
if (this.args == null) this.args = Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
APIRequest.withLogin(this.uri, {this.args})
|
APIRequest.withLogin(this.uri, {this.args}) : needLogin = true {
|
||||||
: needLogin = true,
|
|
||||||
assert(uri != null) {
|
|
||||||
if (args == null) this.args = Map();
|
if (args == null) this.args = Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
APIRequest.withoutLogin(this.uri, {this.args})
|
APIRequest.withoutLogin(this.uri, {this.args}) : needLogin = false {
|
||||||
: needLogin = false,
|
|
||||||
assert(uri != null) {
|
|
||||||
if (args == null) this.args = Map();
|
if (args == null) this.args = Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
/// Call configuration
|
/// Call configuration
|
||||||
///
|
///
|
||||||
/// @author Pierre Hubert
|
/// @author Pierre Hubert
|
||||||
@ -9,7 +7,7 @@ class CallConfig {
|
|||||||
|
|
||||||
const CallConfig({
|
const CallConfig({
|
||||||
required this.iceServers,
|
required this.iceServers,
|
||||||
}) : assert(iceServers != null);
|
});
|
||||||
|
|
||||||
/// Turn this call configuration into the right for the WebRTC plugin
|
/// Turn this call configuration into the right for the WebRTC plugin
|
||||||
Map<String, dynamic> get pluginConfig => {
|
Map<String, dynamic> get pluginConfig => {
|
||||||
|
@ -112,8 +112,7 @@ class ConversationServerMessage {
|
|||||||
required this.userAdded,
|
required this.userAdded,
|
||||||
required this.userWhoRemoved,
|
required this.userWhoRemoved,
|
||||||
required this.userRemoved,
|
required this.userRemoved,
|
||||||
}) : assert(type != null),
|
}) : assert(userID != null ||
|
||||||
assert(userID != null ||
|
|
||||||
(type != ConversationServerMessageType.USER_CREATED_CONVERSATION &&
|
(type != ConversationServerMessageType.USER_CREATED_CONVERSATION &&
|
||||||
type != ConversationServerMessageType.USER_LEFT_CONV)),
|
type != ConversationServerMessageType.USER_LEFT_CONV)),
|
||||||
assert((userWhoAdded != null && userAdded != null) ||
|
assert((userWhoAdded != null && userAdded != null) ||
|
||||||
|
@ -24,17 +24,9 @@ class Survey {
|
|||||||
required this.userChoice,
|
required this.userChoice,
|
||||||
required this.choices,
|
required this.choices,
|
||||||
required this.allowNewChoicesCreation,
|
required this.allowNewChoicesCreation,
|
||||||
}) : assert(id != null),
|
}) : assert(choices.length > 0);
|
||||||
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);
|
|
||||||
|
|
||||||
bool get hasResponded => this.userChoice != null && this.userChoice > 0;
|
bool get hasResponded => this.userChoice > 0;
|
||||||
|
|
||||||
bool get hasResponses =>
|
bool get hasResponses =>
|
||||||
this.choices.where((f) => f.responses > 0).length > 0;
|
this.choices.where((f) => f.responses > 0).length > 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user