Refactor: Reduce .of(context) calls theme
Signed commit
This commit is contained in:
parent
a928ecec1e
commit
5d2aaef3ca
69 changed files with 525 additions and 501 deletions
|
|
@ -19,6 +19,7 @@ class SettingsView extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final showChatBackupBanner = controller.showChatBackupBanner;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
|
@ -30,7 +31,7 @@ class SettingsView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.settings),
|
||||
),
|
||||
body: ListTileTheme(
|
||||
iconColor: Theme.of(context).colorScheme.onSurface,
|
||||
iconColor: theme.colorScheme.onSurface,
|
||||
child: ListView(
|
||||
key: const Key('SettingsListViewContent'),
|
||||
children: <Widget>[
|
||||
|
|
@ -79,8 +80,7 @@ class SettingsView extends StatelessWidget {
|
|||
size: 16,
|
||||
),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.onSurface,
|
||||
foregroundColor: theme.colorScheme.onSurface,
|
||||
),
|
||||
label: Text(
|
||||
displayname,
|
||||
|
|
@ -98,8 +98,7 @@ class SettingsView extends StatelessWidget {
|
|||
size: 14,
|
||||
),
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor:
|
||||
Theme.of(context).colorScheme.secondary,
|
||||
foregroundColor: theme.colorScheme.secondary,
|
||||
),
|
||||
label: Text(
|
||||
mxid,
|
||||
|
|
@ -115,7 +114,7 @@ class SettingsView extends StatelessWidget {
|
|||
);
|
||||
},
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
Divider(color: theme.dividerColor),
|
||||
if (showChatBackupBanner == null)
|
||||
ListTile(
|
||||
leading: const Icon(Icons.backup_outlined),
|
||||
|
|
@ -131,7 +130,7 @@ class SettingsView extends StatelessWidget {
|
|||
onChanged: controller.firstRunBootstrapAction,
|
||||
),
|
||||
Divider(
|
||||
color: Theme.of(context).dividerColor,
|
||||
color: theme.dividerColor,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.format_paint_outlined),
|
||||
|
|
@ -158,7 +157,7 @@ class SettingsView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.security),
|
||||
onTap: () => context.go('/rooms/settings/security'),
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.help_outline_outlined),
|
||||
title: Text(L10n.of(context)!.help),
|
||||
|
|
@ -174,7 +173,7 @@ class SettingsView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.about),
|
||||
onTap: () => PlatformInfos.showDialog(context),
|
||||
),
|
||||
Divider(color: Theme.of(context).dividerColor),
|
||||
Divider(color: theme.dividerColor),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout_outlined),
|
||||
title: Text(L10n.of(context)!.logout),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue