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
|
|
@ -23,6 +23,8 @@ class LoginScaffold extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
|
||||
final isMobileMode =
|
||||
enforceMobileMode || !FluffyThemes.isColumnMode(context);
|
||||
final scaffold = Scaffold(
|
||||
|
|
@ -40,13 +42,12 @@ class LoginScaffold extends StatelessWidget {
|
|||
backgroundColor: isMobileMode ? null : Colors.transparent,
|
||||
),
|
||||
body: body,
|
||||
backgroundColor: isMobileMode
|
||||
? null
|
||||
: Theme.of(context).colorScheme.surface.withOpacity(0.8),
|
||||
backgroundColor:
|
||||
isMobileMode ? null : theme.colorScheme.surface.withOpacity(0.8),
|
||||
bottomNavigationBar: isMobileMode
|
||||
? Material(
|
||||
elevation: 4,
|
||||
shadowColor: Theme.of(context).colorScheme.onSurface,
|
||||
shadowColor: theme.colorScheme.onSurface,
|
||||
child: const _PrivacyButtons(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
),
|
||||
|
|
@ -72,9 +73,8 @@ class LoginScaffold extends StatelessWidget {
|
|||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
elevation:
|
||||
Theme.of(context).appBarTheme.scrolledUnderElevation ?? 4,
|
||||
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
||||
elevation: theme.appBarTheme.scrolledUnderElevation ?? 4,
|
||||
shadowColor: theme.appBarTheme.shadowColor,
|
||||
child: ConstrainedBox(
|
||||
constraints: isMobileMode
|
||||
? const BoxConstraints()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue