Refactor: Reduce .of(context) calls theme

Signed commit
This commit is contained in:
Thomas Klein Langenhorst 2024-08-04 14:09:36 +02:00
commit 5d2aaef3ca
No known key found for this signature in database
GPG key ID: CA868C3CB279DA5B
69 changed files with 525 additions and 501 deletions

View file

@ -15,6 +15,8 @@ class NewGroupView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final avatar = controller.avatar;
final error = controller.error;
return Scaffold(
@ -86,12 +88,12 @@ class NewGroupView extends StatelessWidget {
SwitchListTile.adaptive(
secondary: Icon(
Icons.lock_outlined,
color: Theme.of(context).colorScheme.onSurface,
color: theme.colorScheme.onSurface,
),
title: Text(
L10n.of(context)!.enableEncryption,
style: TextStyle(
color: Theme.of(context).colorScheme.onSurface,
color: theme.colorScheme.onSurface,
),
),
value: !controller.publicGroup,
@ -126,12 +128,12 @@ class NewGroupView extends StatelessWidget {
: ListTile(
leading: Icon(
Icons.warning_outlined,
color: Theme.of(context).colorScheme.error,
color: theme.colorScheme.error,
),
title: Text(
error.toLocalizedString(context),
style: TextStyle(
color: Theme.of(context).colorScheme.error,
color: theme.colorScheme.error,
),
),
),