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

@ -14,6 +14,8 @@ class ReplyDisplay extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return AnimatedContainer(
duration: FluffyThemes.animationDuration,
curve: FluffyThemes.animationCurve,
@ -22,7 +24,7 @@ class ReplyDisplay extends StatelessWidget {
: 0,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.onInverseSurface,
color: theme.colorScheme.onInverseSurface,
),
child: Row(
children: <Widget>[
@ -55,6 +57,7 @@ class _EditContent extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final event = this.event;
if (event == null) {
return const SizedBox.shrink();
@ -63,7 +66,7 @@ class _EditContent extends StatelessWidget {
children: <Widget>[
Icon(
Icons.edit,
color: Theme.of(context).colorScheme.primary,
color: theme.colorScheme.primary,
),
Container(width: 15.0),
Text(
@ -75,7 +78,7 @@ class _EditContent extends StatelessWidget {
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Theme.of(context).textTheme.bodyMedium!.color,
color: theme.textTheme.bodyMedium!.color,
),
),
],