From b713445298598c949e0ea6a3ce6baea3f022750a Mon Sep 17 00:00:00 2001 From: Nate Wilson Date: Mon, 8 Jul 2024 13:06:54 -0600 Subject: [PATCH] Factor out deprecated names in example code (#151374) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains: - 3 instances of `colorScheme.background` → `colorScheme.surface` - and a whole bunch of `MaterialState` → `WidgetState` As of yet, no changes have been made to example test files or the [examples/api/lib/material/material_state/](https://github.com/flutter/flutter/tree/0b2a8e589efcd9907c946e83adb1a71d5473c2ee/examples/api/lib/material/material_state) directory. (related: #151373) --- .../api/lib/material/checkbox/checkbox.0.dart | 12 +++++----- .../lib/material/data_table/data_table.1.dart | 4 ++-- .../date_picker_theme_day_shape.0.dart | 6 ++--- ...coration.floating_label_style_error.0.dart | 8 +++---- .../input_decoration.label_style_error.0.dart | 8 +++---- .../lib/material/list_tile/list_tile.3.dart | 12 +++++----- .../navigation_bar/navigation_bar.2.dart | 2 +- .../material/search_anchor/search_bar.0.dart | 2 +- .../api/lib/material/switch/switch.1.dart | 16 ++++++------- .../api/lib/material/switch/switch.2.dart | 6 ++--- .../api/lib/material/switch/switch.4.dart | 6 ++--- .../material/text_button/text_button.0.dart | 24 +++++++++---------- .../material/text_button/text_button.1.dart | 18 +++++++------- .../axis_direction/axis_direction.0.dart | 2 +- .../linear_border/linear_border.0.dart | 8 +++---- .../growth_direction/growth_direction.0.dart | 2 +- .../scroll_direction/scroll_direction.0.dart | 2 +- .../api/lib/widgets/actions/actions.0.dart | 2 +- .../focus_traversal_group.0.dart | 14 +++++------ .../sliver/pinned_header_sliver.0.dart | 2 +- .../sliver/sliver_floating_header.0.dart | 2 +- .../sliver/sliver_resizing_header.0.dart | 2 +- 22 files changed, 80 insertions(+), 80 deletions(-) diff --git a/examples/api/lib/material/checkbox/checkbox.0.dart b/examples/api/lib/material/checkbox/checkbox.0.dart index 074e5adcda..8273be26ab 100644 --- a/examples/api/lib/material/checkbox/checkbox.0.dart +++ b/examples/api/lib/material/checkbox/checkbox.0.dart @@ -36,11 +36,11 @@ class _CheckboxExampleState extends State { @override Widget build(BuildContext context) { - Color getColor(Set states) { - const Set interactiveStates = { - MaterialState.pressed, - MaterialState.hovered, - MaterialState.focused, + Color getColor(Set states) { + const Set interactiveStates = { + WidgetState.pressed, + WidgetState.hovered, + WidgetState.focused, }; if (states.any(interactiveStates.contains)) { return Colors.blue; @@ -50,7 +50,7 @@ class _CheckboxExampleState extends State { return Checkbox( checkColor: Colors.white, - fillColor: MaterialStateProperty.resolveWith(getColor), + fillColor: WidgetStateProperty.resolveWith(getColor), value: isChecked, onChanged: (bool? value) { setState(() { diff --git a/examples/api/lib/material/data_table/data_table.1.dart b/examples/api/lib/material/data_table/data_table.1.dart index 36690d3617..b9675f3370 100644 --- a/examples/api/lib/material/data_table/data_table.1.dart +++ b/examples/api/lib/material/data_table/data_table.1.dart @@ -45,9 +45,9 @@ class _DataTableExampleState extends State { rows: List.generate( numItems, (int index) => DataRow( - color: MaterialStateProperty.resolveWith((Set states) { + color: WidgetStateProperty.resolveWith((Set states) { // All rows will have the same selected color. - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return Theme.of(context).colorScheme.primary.withOpacity(0.08); } // Even rows will have a grey color. diff --git a/examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart b/examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart index 41cd9812df..b00bf27036 100644 --- a/examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart +++ b/examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart @@ -16,10 +16,10 @@ class DatePickerApp extends StatelessWidget { return MaterialApp( theme: ThemeData( datePickerTheme: DatePickerThemeData( - todayBackgroundColor: const MaterialStatePropertyAll(Colors.amber), - todayForegroundColor: const MaterialStatePropertyAll(Colors.black), + todayBackgroundColor: const WidgetStatePropertyAll(Colors.amber), + todayForegroundColor: const WidgetStatePropertyAll(Colors.black), todayBorder: const BorderSide(width: 2), - dayShape: MaterialStatePropertyAll( + dayShape: WidgetStatePropertyAll( RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.0), ), diff --git a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart index dab7208a6c..dd441181fc 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart @@ -34,13 +34,13 @@ class InputDecoratorExample extends StatelessWidget { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: 'Name', - // The MaterialStateProperty's value is a text style that is orange + // The WidgetStateProperty's value is a text style that is orange // by default, but the theme's error color if the input decorator // is in its error state. - floatingLabelStyle: MaterialStateTextStyle.resolveWith( - (Set states) { + floatingLabelStyle: WidgetStateTextStyle.resolveWith( + (Set states) { final Color color = - states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error : Colors.orange; + states.contains(WidgetState.error) ? Theme.of(context).colorScheme.error : Colors.orange; return TextStyle(color: color, letterSpacing: 1.3); }, ), diff --git a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart index 186395015a..d7f45001b2 100644 --- a/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart +++ b/examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart @@ -34,13 +34,13 @@ class InputDecoratorExample extends StatelessWidget { decoration: InputDecoration( border: const OutlineInputBorder(), labelText: 'Name', - // The MaterialStateProperty's value is a text style that is orange + // The WidgetStateProperty's value is a text style that is orange // by default, but the theme's error color if the input decorator // is in its error state. - labelStyle: MaterialStateTextStyle.resolveWith( - (Set states) { + labelStyle: WidgetStateTextStyle.resolveWith( + (Set states) { final Color color = - states.contains(MaterialState.error) ? Theme.of(context).colorScheme.error : Colors.orange; + states.contains(WidgetState.error) ? Theme.of(context).colorScheme.error : Colors.orange; return TextStyle(color: color, letterSpacing: 1.3); }, ), diff --git a/examples/api/lib/material/list_tile/list_tile.3.dart b/examples/api/lib/material/list_tile/list_tile.3.dart index 82f326491f..bb42a00de5 100644 --- a/examples/api/lib/material/list_tile/list_tile.3.dart +++ b/examples/api/lib/material/list_tile/list_tile.3.dart @@ -47,22 +47,22 @@ class _ListTileExampleState extends State { }, // This sets text color and icon color to red when list tile is disabled and // green when list tile is selected, otherwise sets it to black. - iconColor: MaterialStateColor.resolveWith((Set states) { - if (states.contains(MaterialState.disabled)) { + iconColor: WidgetStateColor.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return Colors.red; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return Colors.green; } return Colors.black; }), // This sets text color and icon color to red when list tile is disabled and // green when list tile is selected, otherwise sets it to black. - textColor: MaterialStateColor.resolveWith((Set states) { - if (states.contains(MaterialState.disabled)) { + textColor: WidgetStateColor.resolveWith((Set states) { + if (states.contains(WidgetState.disabled)) { return Colors.red; } - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return Colors.green; } return Colors.black; diff --git a/examples/api/lib/material/navigation_bar/navigation_bar.2.dart b/examples/api/lib/material/navigation_bar/navigation_bar.2.dart index e7f1090eab..f9fedbc659 100644 --- a/examples/api/lib/material/navigation_bar/navigation_bar.2.dart +++ b/examples/api/lib/material/navigation_bar/navigation_bar.2.dart @@ -279,7 +279,7 @@ class ListPage extends StatelessWidget { padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8), child: OutlinedButton( style: buttonStyle.copyWith( - backgroundColor: MaterialStatePropertyAll( + backgroundColor: WidgetStatePropertyAll( Color.lerp( destination.color[100], Colors.white, diff --git a/examples/api/lib/material/search_anchor/search_bar.0.dart b/examples/api/lib/material/search_anchor/search_bar.0.dart index f4ed7ce16f..444a677838 100644 --- a/examples/api/lib/material/search_anchor/search_bar.0.dart +++ b/examples/api/lib/material/search_anchor/search_bar.0.dart @@ -32,7 +32,7 @@ class _SearchBarAppState extends State { builder: (BuildContext context, SearchController controller) { return SearchBar( controller: controller, - padding: const MaterialStatePropertyAll(EdgeInsets.symmetric(horizontal: 16.0)), + padding: const WidgetStatePropertyAll(EdgeInsets.symmetric(horizontal: 16.0)), onTap: () { controller.openView(); }, onChanged: (_) { controller.openView(); }, leading: const Icon(Icons.search), diff --git a/examples/api/lib/material/switch/switch.1.dart b/examples/api/lib/material/switch/switch.1.dart index 0fbe72dead..bf8b918a23 100644 --- a/examples/api/lib/material/switch/switch.1.dart +++ b/examples/api/lib/material/switch/switch.1.dart @@ -37,10 +37,10 @@ class _SwitchExampleState extends State { @override Widget build(BuildContext context) { - final MaterialStateProperty trackColor = MaterialStateProperty.resolveWith( - (Set states) { + final WidgetStateProperty trackColor = WidgetStateProperty.resolveWith( + (Set states) { // Track color when the switch is selected. - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return Colors.amber; } // Otherwise return null to set default track color @@ -49,14 +49,14 @@ class _SwitchExampleState extends State { return null; }, ); - final MaterialStateProperty overlayColor = MaterialStateProperty.resolveWith( - (Set states) { + final WidgetStateProperty overlayColor = WidgetStateProperty.resolveWith( + (Set states) { // Material color when switch is selected. - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return Colors.amber.withOpacity(0.54); } // Material color when switch is disabled. - if (states.contains(MaterialState.disabled)) { + if (states.contains(WidgetState.disabled)) { return Colors.grey.shade400; } // Otherwise return null to set default material color @@ -71,7 +71,7 @@ class _SwitchExampleState extends State { value: light, overlayColor: overlayColor, trackColor: trackColor, - thumbColor: const MaterialStatePropertyAll(Colors.black), + thumbColor: const WidgetStatePropertyAll(Colors.black), onChanged: (bool value) { // This is called when the user toggles the switch. setState(() { diff --git a/examples/api/lib/material/switch/switch.2.dart b/examples/api/lib/material/switch/switch.2.dart index 8c47d5235f..1c69c8bbed 100644 --- a/examples/api/lib/material/switch/switch.2.dart +++ b/examples/api/lib/material/switch/switch.2.dart @@ -36,9 +36,9 @@ class _SwitchExampleState extends State { bool light0 = true; bool light1 = true; - final MaterialStateProperty thumbIcon = MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.selected)) { + final WidgetStateProperty thumbIcon = WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.selected)) { return const Icon(Icons.check); } return const Icon(Icons.close); diff --git a/examples/api/lib/material/switch/switch.4.dart b/examples/api/lib/material/switch/switch.4.dart index 4d64608f86..53d19ad59b 100644 --- a/examples/api/lib/material/switch/switch.4.dart +++ b/examples/api/lib/material/switch/switch.4.dart @@ -121,13 +121,13 @@ class _SwitchThemeAdaptation extends Adaptation { case TargetPlatform.iOS: case TargetPlatform.macOS: return SwitchThemeData( - thumbColor: MaterialStateProperty.resolveWith((Set states) { - if (states.contains(MaterialState.selected)) { + thumbColor: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.selected)) { return Colors.yellow; } return null; // Use the default. }), - trackColor: const MaterialStatePropertyAll(Colors.brown), + trackColor: const WidgetStatePropertyAll(Colors.brown), ); } } diff --git a/examples/api/lib/material/text_button/text_button.0.dart b/examples/api/lib/material/text_button/text_button.0.dart index 181e553392..f1a059dd16 100644 --- a/examples/api/lib/material/text_button/text_button.0.dart +++ b/examples/api/lib/material/text_button/text_button.0.dart @@ -104,15 +104,15 @@ class _TextButtonExampleState extends State { // This gradient's appearance reflects the button's state. // Always return a gradient decoration so that AnimatedContainer // can interpolate in between. Used by TextButton #7. - Decoration? statesToDecoration(Set states) { - if (states.contains(MaterialState.pressed)) { + Decoration? statesToDecoration(Set states) { + if (states.contains(WidgetState.pressed)) { return BoxDecoration( gradient: LinearGradient(colors: [color2, color2]), // solid fill ); } return BoxDecoration( gradient: LinearGradient( - colors: switch (states.contains(MaterialState.hovered)) { + colors: switch (states.contains(WidgetState.hovered)) { true => [color1, color2], false => [color2, color1], }, @@ -149,7 +149,7 @@ class _TextButtonExampleState extends State { // In this example, and most of the ones that follow, we're using // the TextButton.styleFrom() convenience method to create a ButtonStyle. // The styleFrom method is a little easier because it creates - // ButtonStyle MaterialStateProperty parameters for you. + // ButtonStyle WidgetStateProperty parameters for you. // In this case, Specifying foregroundColor overrides the text, // icon and overlay (splash and highlight) colors a little differently // depending on the button's state. BackgroundColor is just the background @@ -213,7 +213,7 @@ class _TextButtonExampleState extends State { // theme or the MaterialApp theme's ThemeData.textButtonTheme. TextButton( style: TextButton.styleFrom( - foregroundBuilder: (BuildContext context, Set states, Widget? child) { + foregroundBuilder: (BuildContext context, Set states, Widget? child) { return ShaderMask( shaderCallback: (Rect bounds) { return LinearGradient( @@ -248,10 +248,10 @@ class _TextButtonExampleState extends State { // outlines the button's shape. TextButton( style: TextButton.styleFrom( - foregroundBuilder: (BuildContext context, Set states, Widget? child) { + foregroundBuilder: (BuildContext context, Set states, Widget? child) { return DecoratedBox( decoration: BoxDecoration( - border: states.contains(MaterialState.hovered) + border: states.contains(WidgetState.hovered) ? Border(bottom: BorderSide(color: colorScheme.primary)) : const Border(), // essentially "no border" ), @@ -272,7 +272,7 @@ class _TextButtonExampleState extends State { // closely). Because we want the outline to only appear when the button is hovered // we can't use the styleFrom() side parameter, because that creates the same // outline for all states. The ButtonStyle.copyWith() method is used to add - // a MaterialState property that does the right thing. + // a WidgetState property that does the right thing. // // The gradient background is translucent - all of the colors have opacity 0.5 - // so the overlay's splash and highlight colors are visible even though they're @@ -284,7 +284,7 @@ class _TextButtonExampleState extends State { onPressed: () {}, style: TextButton.styleFrom( overlayColor: color2, - backgroundBuilder: (BuildContext context, Set states, Widget? child) { + backgroundBuilder: (BuildContext context, Set states, Widget? child) { return AnimatedContainer( duration: const Duration(milliseconds: 500), decoration: statesToDecoration(states), @@ -292,8 +292,8 @@ class _TextButtonExampleState extends State { ); }, ).copyWith( - side: MaterialStateProperty.resolveWith((Set states) { - if (states.contains(MaterialState.hovered)) { + side: WidgetStateProperty.resolveWith((Set states) { + if (states.contains(WidgetState.hovered)) { return BorderSide(width: 3, color: color3); } return null; // defer to the default @@ -315,7 +315,7 @@ class _TextButtonExampleState extends State { onPressed: () {}, style: TextButton.styleFrom( foregroundColor: Colors.white, - backgroundBuilder: (BuildContext context, Set states, Widget? child) { + backgroundBuilder: (BuildContext context, Set states, Widget? child) { return Ink( decoration: const BoxDecoration( image: DecorationImage( diff --git a/examples/api/lib/material/text_button/text_button.1.dart b/examples/api/lib/material/text_button/text_button.1.dart index f72630a65c..378d9ec7c5 100644 --- a/examples/api/lib/material/text_button/text_button.1.dart +++ b/examples/api/lib/material/text_button/text_button.1.dart @@ -29,19 +29,19 @@ class SelectableButton extends StatefulWidget { } class _SelectableButtonState extends State { - late final MaterialStatesController statesController; + late final WidgetStatesController statesController; @override void initState() { super.initState(); - statesController = MaterialStatesController({if (widget.selected) MaterialState.selected}); + statesController = WidgetStatesController({if (widget.selected) WidgetState.selected}); } @override void didUpdateWidget(SelectableButton oldWidget) { super.didUpdateWidget(oldWidget); if (widget.selected != oldWidget.selected) { - statesController.update(MaterialState.selected, widget.selected); + statesController.update(WidgetState.selected, widget.selected); } } @@ -73,17 +73,17 @@ class _HomeState extends State { child: SelectableButton( selected: selected, style: ButtonStyle( - foregroundColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.selected)) { + foregroundColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.selected)) { return Colors.white; } return null; // defer to the defaults }, ), - backgroundColor: MaterialStateProperty.resolveWith( - (Set states) { - if (states.contains(MaterialState.selected)) { + backgroundColor: WidgetStateProperty.resolveWith( + (Set states) { + if (states.contains(WidgetState.selected)) { return Colors.indigo; } return null; // defer to the defaults diff --git a/examples/api/lib/painting/axis_direction/axis_direction.0.dart b/examples/api/lib/painting/axis_direction/axis_direction.0.dart index 2323bd8581..1ae3c785cb 100644 --- a/examples/api/lib/painting/axis_direction/axis_direction.0.dart +++ b/examples/api/lib/painting/axis_direction/axis_direction.0.dart @@ -81,7 +81,7 @@ class _MyWidgetState extends State { style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.white), child: RadioTheme( data: RadioThemeData( - fillColor: MaterialStateProperty.all(Colors.white), + fillColor: WidgetStateProperty.all(Colors.white), ), child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/examples/api/lib/painting/linear_border/linear_border.0.dart b/examples/api/lib/painting/linear_border/linear_border.0.dart index 510a65236e..d81c22c465 100644 --- a/examples/api/lib/painting/linear_border/linear_border.0.dart +++ b/examples/api/lib/painting/linear_border/linear_border.0.dart @@ -281,11 +281,11 @@ class _HomeState extends State { ), TextButton( style: ButtonStyle( - side: MaterialStateProperty.resolveWith((Set states) { - return states.contains(MaterialState.hovered) ? primarySide3 : null; + side: WidgetStateProperty.resolveWith((Set states) { + return states.contains(WidgetState.hovered) ? primarySide3 : null; }), - shape: MaterialStateProperty.resolveWith((Set states) { - return states.contains(MaterialState.hovered) ? shape0 : shape1; + shape: WidgetStateProperty.resolveWith((Set states) { + return states.contains(WidgetState.hovered) ? shape0 : shape1; }), ), onPressed: () {}, diff --git a/examples/api/lib/rendering/growth_direction/growth_direction.0.dart b/examples/api/lib/rendering/growth_direction/growth_direction.0.dart index 50e41b4f30..ab67f91c41 100644 --- a/examples/api/lib/rendering/growth_direction/growth_direction.0.dart +++ b/examples/api/lib/rendering/growth_direction/growth_direction.0.dart @@ -89,7 +89,7 @@ class _MyWidgetState extends State { style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.white), child: RadioTheme( data: RadioThemeData( - fillColor: MaterialStateProperty.all(Colors.white), + fillColor: WidgetStateProperty.all(Colors.white), ), child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart b/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart index dbec435fb9..95beba6c4a 100644 --- a/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart +++ b/examples/api/lib/rendering/scroll_direction/scroll_direction.0.dart @@ -85,7 +85,7 @@ class _MyWidgetState extends State { style: const TextStyle(fontWeight: FontWeight.bold, color: Colors.white), child: RadioTheme( data: RadioThemeData( - fillColor: MaterialStateProperty.all(Colors.white), + fillColor: WidgetStateProperty.all(Colors.white), ), child: Padding( padding: const EdgeInsets.all(8.0), diff --git a/examples/api/lib/widgets/actions/actions.0.dart b/examples/api/lib/widgets/actions/actions.0.dart index bef8f6c2d3..08348ca4a6 100644 --- a/examples/api/lib/widgets/actions/actions.0.dart +++ b/examples/api/lib/widgets/actions/actions.0.dart @@ -103,7 +103,7 @@ class _SaveButtonState extends State { icon: const Icon(Icons.save), label: Text('$_savedValue'), style: ButtonStyle( - foregroundColor: MaterialStatePropertyAll( + foregroundColor: WidgetStatePropertyAll( widget.valueNotifier.value ? Colors.red : Colors.green, ), ), diff --git a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart index 818eb2ac1f..38b506fd90 100644 --- a/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart +++ b/examples/api/lib/widgets/focus_traversal/focus_traversal_group.0.dart @@ -78,18 +78,18 @@ class _OrderedButtonState extends State> { order = LexicalFocusOrder(widget.order.toString()); } - Color? overlayColor(Set states) { - if (states.contains(MaterialState.focused)) { + Color? overlayColor(Set states) { + if (states.contains(WidgetState.focused)) { return Colors.red; } - if (states.contains(MaterialState.hovered)) { + if (states.contains(WidgetState.hovered)) { return Colors.blue; } return null; // defer to the default overlayColor } - Color? foregroundColor(Set states) { - if (states.contains(MaterialState.focused) || states.contains(MaterialState.hovered)) { + Color? foregroundColor(Set states) { + if (states.contains(WidgetState.focused) || states.contains(WidgetState.hovered)) { return Colors.white; } return null; // defer to the default foregroundColor @@ -103,8 +103,8 @@ class _OrderedButtonState extends State> { focusNode: focusNode, autofocus: widget.autofocus, style: ButtonStyle( - overlayColor: MaterialStateProperty.resolveWith(overlayColor), - foregroundColor: MaterialStateProperty.resolveWith(foregroundColor), + overlayColor: WidgetStateProperty.resolveWith(overlayColor), + foregroundColor: WidgetStateProperty.resolveWith(foregroundColor), ), onPressed: () => _handleOnPressed(), child: Text(widget.name), diff --git a/examples/api/lib/widgets/sliver/pinned_header_sliver.0.dart b/examples/api/lib/widgets/sliver/pinned_header_sliver.0.dart index 5eacfca82a..ab4c6390be 100644 --- a/examples/api/lib/widgets/sliver/pinned_header_sliver.0.dart +++ b/examples/api/lib/widgets/sliver/pinned_header_sliver.0.dart @@ -50,7 +50,7 @@ class _PinnedHeaderSliverExampleState extends State { final ColorScheme colorScheme = theme.colorScheme; final Widget header = Container( - color: colorScheme.background, + color: colorScheme.surface, padding: const EdgeInsets.all(4), child: Material( color: colorScheme.primaryContainer, diff --git a/examples/api/lib/widgets/sliver/sliver_floating_header.0.dart b/examples/api/lib/widgets/sliver/sliver_floating_header.0.dart index 6d44659c65..b9d17de624 100644 --- a/examples/api/lib/widgets/sliver/sliver_floating_header.0.dart +++ b/examples/api/lib/widgets/sliver/sliver_floating_header.0.dart @@ -64,7 +64,7 @@ class ListHeader extends StatelessWidget { final ColorScheme colorScheme = theme.colorScheme; return Container( - color: colorScheme.background, + color: colorScheme.surface, padding: const EdgeInsets.symmetric(horizontal: 4), child: Material( color: colorScheme.primaryContainer, diff --git a/examples/api/lib/widgets/sliver/sliver_resizing_header.0.dart b/examples/api/lib/widgets/sliver/sliver_resizing_header.0.dart index 347a433d43..3c64719972 100644 --- a/examples/api/lib/widgets/sliver/sliver_resizing_header.0.dart +++ b/examples/api/lib/widgets/sliver/sliver_resizing_header.0.dart @@ -88,7 +88,7 @@ class ListHeader extends StatelessWidget { final ColorScheme colorScheme = theme.colorScheme; return Container( - color: colorScheme.background, + color: colorScheme.surface, padding: const EdgeInsets.symmetric(horizontal: 4), child: Material( color: colorScheme.primaryContainer,