refactor: Use non nullable localizations builder and lazy load on web
This commit is contained in:
parent
8cedd2a45a
commit
0d4b7d67cc
111 changed files with 879 additions and 883 deletions
|
|
@ -19,37 +19,37 @@ class NotificationSettingsItem {
|
|||
NotificationSettingsItem(
|
||||
PushRuleKind.underride,
|
||||
'.m.rule.message',
|
||||
(c) => L10n.of(c)!.allRooms,
|
||||
(c) => L10n.of(c).allRooms,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.underride,
|
||||
'.m.rule.room_one_to_one',
|
||||
(c) => L10n.of(c)!.directChats,
|
||||
(c) => L10n.of(c).directChats,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.override,
|
||||
'.m.rule.contains_display_name',
|
||||
(c) => L10n.of(c)!.containsDisplayName,
|
||||
(c) => L10n.of(c).containsDisplayName,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.content,
|
||||
'.m.rule.contains_user_name',
|
||||
(c) => L10n.of(c)!.containsUserName,
|
||||
(c) => L10n.of(c).containsUserName,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.override,
|
||||
'.m.rule.invite_for_me',
|
||||
(c) => L10n.of(c)!.inviteForMe,
|
||||
(c) => L10n.of(c).inviteForMe,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.override,
|
||||
'.m.rule.member_event',
|
||||
(c) => L10n.of(c)!.memberChanges,
|
||||
(c) => L10n.of(c).memberChanges,
|
||||
),
|
||||
NotificationSettingsItem(
|
||||
PushRuleKind.override,
|
||||
'.m.rule.suppress_notices',
|
||||
(c) => L10n.of(c)!.botMessages,
|
||||
(c) => L10n.of(c).botMessages,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ class SettingsNotificationsController extends State<SettingsNotifications> {
|
|||
message: '${pusher.appDisplayName} (${pusher.appId})',
|
||||
actions: [
|
||||
SheetAction(
|
||||
label: L10n.of(context)!.delete,
|
||||
label: L10n.of(context).delete,
|
||||
isDestructiveAction: true,
|
||||
key: true,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: const Center(child: BackButton()),
|
||||
title: Text(L10n.of(context)!.notifications),
|
||||
title: Text(L10n.of(context).notifications),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
child: StreamBuilder(
|
||||
|
|
@ -36,7 +36,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
SwitchListTile.adaptive(
|
||||
value: !Matrix.of(context).client.allPushNotificationsMuted,
|
||||
title: Text(
|
||||
L10n.of(context)!.notificationsEnabledForThisAccount,
|
||||
L10n.of(context).notificationsEnabledForThisAccount,
|
||||
),
|
||||
onChanged: controller.isLoading
|
||||
? null
|
||||
|
|
@ -45,7 +45,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.notifyMeFor,
|
||||
L10n.of(context).notifyMeFor,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -68,7 +68,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
title: Text(
|
||||
L10n.of(context)!.devices,
|
||||
L10n.of(context).devices,
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.secondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -98,7 +98,7 @@ class SettingsNotificationsView extends StatelessWidget {
|
|||
return Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(bottom: 16.0),
|
||||
child: Text(L10n.of(context)!.noOtherDevicesFound),
|
||||
child: Text(L10n.of(context).noOtherDevicesFound),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue