1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2025-09-19 05:48:54 +00:00

Fix a few notices

This commit is contained in:
2022-03-11 16:36:42 +01:00
parent 06312512a6
commit 45e8f34c81
26 changed files with 38 additions and 110 deletions

View File

@@ -45,10 +45,7 @@ class _MenuItem {
required this.action,
required this.pageType,
this.isMenu = false,
}) : assert(label != null),
assert(isMenu != null),
assert(isMenu || icon != null),
assert(isMenu || action != null),
}) : assert(isMenu || action != null),
assert(isMenu || pageType != null);
}
@@ -57,9 +54,7 @@ class _ActionMenuItem {
final String label;
final BarCallbackActions action;
const _ActionMenuItem({required this.label, required this.action})
: assert(label != null),
assert(action != null);
const _ActionMenuItem({required this.label, required this.action});
}
/// List of menu items to show
@@ -113,8 +108,7 @@ class ComunicMobileAppBar extends StatefulWidget
const ComunicMobileAppBar({
Key? key,
required this.currentPage,
}) : assert(currentPage != null),
super(key: key);
}) : super(key: key);
@override
_ComunicMobileAppBarState createState() => _ComunicMobileAppBarState();
@@ -154,8 +148,6 @@ class _ComunicMobileAppBarState extends SafeState<ComunicMobileAppBar> {
/// Get the number of unread notifications for the selected notice
int? getNumberUnread(BarCallbackActions? action) {
if (_unreadNotifications == null) return 0;
switch (action) {
case BarCallbackActions.OPEN_NOTIFICATIONS:
return _unreadNotifications.notifications;

View File

@@ -19,9 +19,7 @@ class UserMobilePage extends StatefulWidget {
Key? key,
required this.userInfo,
required this.onNeedRefresh,
}) : assert(userInfo != null),
assert(onNeedRefresh != null),
super(key: key);
}) : super(key: key);
@override
_UserMobilePageState createState() => _UserMobilePageState();
@@ -114,9 +112,7 @@ class UserPageTab {
required this.label,
required this.onBuild,
this.visible = true,
}) : assert(label != null),
assert(onBuild != null),
assert(visible != null);
});
Tab get tab => Tab(text: label);
}