Update parameters to the styleFrom button methods. (#105291)

* Update parameters to the `styleFrom` button methods.

* Updated the Flutter fix data to point to this PR.

* Updated handling of background color to better maintain backwards compatibility with previous API.
This commit is contained in:
Darren Austin
2022-06-21 19:08:22 -07:00
committed by GitHub
parent ce10e6fff2
commit 2532584bf3
21 changed files with 404 additions and 106 deletions

View File

@@ -247,7 +247,7 @@ class TravelDestinationContent extends StatelessWidget {
final ThemeData theme = Theme.of(context);
final TextStyle titleStyle = theme.textTheme.headline5!.copyWith(color: Colors.white);
final TextStyle descriptionStyle = theme.textTheme.subtitle1!;
final ButtonStyle textButtonStyle = TextButton.styleFrom(primary: Colors.amber.shade500);
final ButtonStyle textButtonStyle = TextButton.styleFrom(foregroundColor: Colors.amber.shade500);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,

View File

@@ -78,7 +78,7 @@ class _ShoppingCartPageState extends State<ShoppingCartPage> {
right: 16.0,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
primary: kShrinePink100,
backgroundColor: kShrinePink100,
shape: const BeveledRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(7.0)),
),

View File

@@ -177,7 +177,7 @@ class _TextButton extends StatelessWidget {
final ThemeData theme = Theme.of(context);
return TextButton(
style: TextButton.styleFrom(
primary: theme.colorScheme.onPrimary,
foregroundColor: theme.colorScheme.onPrimary,
textStyle: theme.textTheme.subtitle1,
padding: EdgeInsets.zero,
),