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
|
|
@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue