migrate material 3 demo code to avoid warning

pull/1353/head
Xiao Yu 2 years ago
parent 3cd173be55
commit 7df37d9f65

@ -113,10 +113,8 @@ class ButtonsWithoutIcon extends StatelessWidget {
_colDivider, _colDivider,
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
// Foreground color foregroundColor: Theme.of(context).colorScheme.onPrimary,
onPrimary: Theme.of(context).colorScheme.onPrimary, backgroundColor: Theme.of(context).colorScheme.primary,
// Background color
primary: Theme.of(context).colorScheme.primary,
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
onPressed: handlePressed(context, isDisabled, "FilledButton"), onPressed: handlePressed(context, isDisabled, "FilledButton"),
child: const Text('Filled'), child: const Text('Filled'),
@ -124,10 +122,8 @@ class ButtonsWithoutIcon extends StatelessWidget {
_colDivider, _colDivider,
ElevatedButton( ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
// Foreground color foregroundColor: Theme.of(context).colorScheme.onSecondaryContainer,
onPrimary: Theme.of(context).colorScheme.onSecondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
// Background color
primary: Theme.of(context).colorScheme.secondaryContainer,
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
onPressed: handlePressed(context, isDisabled, "FilledTonalButton"), onPressed: handlePressed(context, isDisabled, "FilledTonalButton"),
child: const Text('Filled Tonal'), child: const Text('Filled Tonal'),
@ -165,10 +161,8 @@ class ButtonsWithIcon extends StatelessWidget {
_colDivider, _colDivider,
ElevatedButton.icon( ElevatedButton.icon(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
// Foreground color foregroundColor: Theme.of(context).colorScheme.onPrimary,
onPrimary: Theme.of(context).colorScheme.onPrimary, backgroundColor: Theme.of(context).colorScheme.primary,
// Background color
primary: Theme.of(context).colorScheme.primary,
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
onPressed: handlePressed(context, false, "FilledButton with Icon"), onPressed: handlePressed(context, false, "FilledButton with Icon"),
label: const Text('Icon'), label: const Text('Icon'),
@ -177,10 +171,8 @@ class ButtonsWithIcon extends StatelessWidget {
_colDivider, _colDivider,
ElevatedButton.icon( ElevatedButton.icon(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
// Foreground color foregroundColor: Theme.of(context).colorScheme.onSecondaryContainer,
onPrimary: Theme.of(context).colorScheme.onSecondaryContainer, backgroundColor: Theme.of(context).colorScheme.secondaryContainer,
// Background color
primary: Theme.of(context).colorScheme.secondaryContainer,
).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)), ).copyWith(elevation: ButtonStyleButton.allOrNull(0.0)),
onPressed: onPressed:
handlePressed(context, false, "FilledTonalButton with Icon"), handlePressed(context, false, "FilledTonalButton with Icon"),

Loading…
Cancel
Save