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

@ -113,6 +113,8 @@ class PublicRoomBottomSheet extends StatelessWidget {
body: FutureBuilder<PublicRoomsChunk>(
future: _search(),
builder: (context, snapshot) {
final theme = Theme.of(context);
final profile = snapshot.data;
return ListView(
padding: EdgeInsets.zero,
@ -150,8 +152,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
size: 14,
),
style: TextButton.styleFrom(
foregroundColor:
Theme.of(context).colorScheme.onSurface,
foregroundColor: theme.colorScheme.onSurface,
),
label: Text(
roomLink ?? '...',
@ -166,8 +167,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
size: 14,
),
style: TextButton.styleFrom(
foregroundColor:
Theme.of(context).colorScheme.onSurface,
foregroundColor: theme.colorScheme.onSurface,
),
label: Text(
L10n.of(context)!.countParticipants(
@ -211,7 +211,7 @@ class PublicRoomBottomSheet extends StatelessWidget {
),
style: TextStyle(
fontSize: 14,
color: Theme.of(context).textTheme.bodyMedium!.color,
color: theme.textTheme.bodyMedium!.color,
),
options: const LinkifyOptions(humanize: false),
onOpen: (url) =>