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:
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user