MaterialState → WidgetState in documentation (#151376)

Documentation was migrated as follows:

1. did a RegEx search for `(///.*)MaterialState` and replaced with `$1WidgetState`
2. made sure that `MaterialStateOutlineInputBorder` & `MaterialStateUnderlineInputBorder` were unaffected
3. removed unused imports

<br>

The following files & directories were excluded:

- examples/
- packages/flutter/test/
- material_state.dart
- material_state_mixin.dart
- widget_state.dart

<br>

I believe this should be very straightforward, but I'd also be happy to break the PR in half to make it easier to review.

(related: #151373)
This commit is contained in:
Nate Wilson
2024-07-08 15:12:04 -06:00
committed by GitHub
parent 86ac077fb5
commit e1a6f763f9
55 changed files with 506 additions and 508 deletions

View File

@@ -503,8 +503,8 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget {
/// In Material v3 (i.e., when [ThemeData.useMaterial3] is true),
/// then [AppBar] uses the overall theme's [ColorScheme.surface]
///
/// If this color is a [MaterialStateColor] it will be resolved against
/// [MaterialState.scrolledUnder] when the content of the app's
/// If this color is a [WidgetStateColor] it will be resolved against
/// [WidgetState.scrolledUnder] when the content of the app's
/// primary scrollable overlaps the app bar.
/// {@endtemplate}
///

View File

@@ -372,18 +372,18 @@ class BottomNavigationBar extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// items.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [WidgetState.selected].
///
/// If null, then the value of [BottomNavigationBarThemeData.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// Whether detected gestures should provide acoustic and/or haptic feedback.

View File

@@ -107,28 +107,28 @@ class RawMaterialButton extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// button.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.pressed].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.pressed].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// If this property is null, [WidgetStateMouseCursor.clickable] will be used.
final MouseCursor? mouseCursor;
/// Defines the default text style, with [Material.textStyle], for the
/// button's [child].
///
/// If [TextStyle.color] is a [MaterialStateProperty<Color>], [MaterialStateProperty.resolve]
/// is used for the following [MaterialState]s:
/// If [TextStyle.color] is a [WidgetStateProperty<Color>], [WidgetStateProperty.resolve]
/// is used for the following [WidgetState]s:
///
/// * [MaterialState.pressed].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.pressed].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
final TextStyle? textStyle;
/// The color of the button's [Material].
@@ -245,13 +245,13 @@ class RawMaterialButton extends StatefulWidget {
/// The button's highlight and splash are clipped to this shape. If the
/// button has an elevation, then its drop shadow is defined by this shape.
///
/// If [shape] is a [MaterialStateProperty<ShapeBorder>], [MaterialStateProperty.resolve]
/// is used for the following [MaterialState]s:
/// If [shape] is a [WidgetStateProperty<ShapeBorder>], [WidgetStateProperty.resolve]
/// is used for the following [WidgetState]s:
///
/// * [MaterialState.pressed].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.pressed].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
final ShapeBorder shape;
/// Defines the duration of animated changes for [shape] and [elevation].

View File

@@ -31,9 +31,9 @@ typedef ButtonLayerBuilder = Widget Function(BuildContext context, Set<MaterialS
///
/// All of the ButtonStyle properties are null by default.
///
/// Many of the ButtonStyle properties are [MaterialStateProperty] objects which
/// Many of the ButtonStyle properties are [WidgetStateProperty] objects which
/// resolve to different values depending on the button's state. For example
/// the [Color] properties are defined with `MaterialStateProperty<Color>` and
/// the [Color] properties are defined with `WidgetStateProperty<Color>` and
/// can resolve to different colors depending on if the button is pressed,
/// hovered, focused, disabled, etc.
///
@@ -45,9 +45,9 @@ typedef ButtonLayerBuilder = Widget Function(BuildContext context, Set<MaterialS
/// ```dart
/// ElevatedButton(
/// style: ButtonStyle(
/// backgroundColor: MaterialStateProperty.resolveWith<Color?>(
/// (Set<MaterialState> states) {
/// if (states.contains(MaterialState.pressed)) {
/// backgroundColor: WidgetStateProperty.resolveWith<Color?>(
/// (Set<WidgetState> states) {
/// if (states.contains(WidgetState.pressed)) {
/// return Theme.of(context).colorScheme.primary.withOpacity(0.5);
/// }
/// return null; // Use the component's default.
@@ -68,7 +68,7 @@ typedef ButtonLayerBuilder = Widget Function(BuildContext context, Set<MaterialS
/// ```dart
/// ElevatedButton(
/// style: const ButtonStyle(
/// backgroundColor: MaterialStatePropertyAll<Color>(Colors.green),
/// backgroundColor: WidgetStatePropertyAll<Color>(Colors.green),
/// ),
/// child: const Text('Let me play among the stars'),
/// onPressed: () {

View File

@@ -116,9 +116,9 @@ abstract class ButtonStyleButton extends StatefulWidget {
/// Customizes this button's appearance.
///
/// Non-null properties of this style override the corresponding
/// properties in [themeStyleOf] and [defaultStyleOf]. [MaterialStateProperty]s
/// properties in [themeStyleOf] and [defaultStyleOf]. [WidgetStateProperty]s
/// that resolve to non-null values will similarly override the corresponding
/// [MaterialStateProperty]s in [themeStyleOf] and [defaultStyleOf].
/// [WidgetStateProperty]s in [themeStyleOf] and [defaultStyleOf].
///
/// Null by default.
final ButtonStyle? style;
@@ -166,7 +166,7 @@ abstract class ButtonStyleButton extends StatefulWidget {
/// [TextButtonTheme].
///
/// Concrete button subclasses should return a ButtonStyle that
/// has no null properties, and where all of the [MaterialStateProperty]
/// has no null properties, and where all of the [WidgetStateProperty]
/// properties resolve to non-null values.
///
/// See also:
@@ -206,7 +206,7 @@ abstract class ButtonStyleButton extends StatefulWidget {
properties.add(DiagnosticsProperty<FocusNode>('focusNode', focusNode, defaultValue: null));
}
/// Returns null if [value] is null, otherwise `MaterialStatePropertyAll<T>(value)`.
/// Returns null if [value] is null, otherwise `WidgetStatePropertyAll<T>(value)`.
///
/// A convenience method for subclasses.
static MaterialStateProperty<T>? allOrNull<T>(T? value) => value == null ? null : MaterialStatePropertyAll<T>(value);

View File

@@ -9,7 +9,6 @@ import 'color_scheme.dart';
import 'colors.dart';
import 'constants.dart';
import 'material_button.dart';
import 'material_state.dart';
import 'theme.dart';
import 'theme_data.dart' show MaterialTapTargetSize;
@@ -391,8 +390,8 @@ class ButtonThemeData with Diagnosticable {
/// Otherwise the color scheme's [ColorScheme.onSurface] color is returned
/// with its opacity set to 0.38.
///
/// If [MaterialButton.textColor] is a [MaterialStateProperty<Color>], it will be
/// used as the `disabledTextColor`. It will be resolved in the [MaterialState.disabled] state.
/// If [MaterialButton.textColor] is a [WidgetStateProperty<Color>], it will be
/// used as the `disabledTextColor`. It will be resolved in the [WidgetState.disabled] state.
Color getDisabledTextColor(MaterialButton button) {
return button.textColor ?? button.disabledTextColor ?? colorScheme!.onSurface.withOpacity(0.38);
}

View File

@@ -35,7 +35,7 @@ enum _CheckboxType { material, adaptive }
///
/// {@tool dartpad}
/// This example shows how you can override the default theme of
/// a [Checkbox] with a [MaterialStateProperty].
/// a [Checkbox] with a [WidgetStateProperty].
/// In this example, the checkbox's color will be `Colors.blue` when the [Checkbox]
/// is being pressed, hovered, or focused. Otherwise, the checkbox's color will
/// be `Colors.red`.
@@ -176,56 +176,56 @@ class Checkbox extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// When [value] is null and [tristate] is true, [MaterialState.selected] is
/// When [value] is null and [tristate] is true, [WidgetState.selected] is
/// included as a state.
///
/// If null, then the value of [CheckboxThemeData.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], a [MouseCursor] that implements
/// `MaterialStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], a [MouseCursor] that implements
/// `WidgetStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// The color to use when this checkbox is checked.
///
/// Defaults to [ColorScheme.secondary].
///
/// If [fillColor] returns a non-null color in the [MaterialState.selected]
/// If [fillColor] returns a non-null color in the [WidgetState.selected]
/// state, it will be used instead of this color.
final Color? activeColor;
/// {@template flutter.material.checkbox.fillColor}
/// The color that fills the checkbox, in all [MaterialState]s.
/// The color that fills the checkbox, in all [WidgetState]s.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [fillColor] based on the current [MaterialState]
/// This example resolves the [fillColor] based on the current [WidgetState]
/// of the [Checkbox], providing a different [Color] when it is
/// [MaterialState.disabled].
/// [WidgetState.disabled].
///
/// ```dart
/// Checkbox(
/// value: true,
/// onChanged: (_){},
/// fillColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// fillColor: MaterialStateProperty.resolveWith<Color>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withOpacity(.32);
/// }
/// return Colors.orange;
@@ -293,7 +293,7 @@ class Checkbox extends StatefulWidget {
/// The color for the checkbox's [Material] when it has the input focus.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.focused]
/// If [overlayColor] returns a non-null color in the [WidgetState.focused]
/// state, it will be used instead.
///
/// If null, then the value of [CheckboxThemeData.overlayColor] is used in the
@@ -304,7 +304,7 @@ class Checkbox extends StatefulWidget {
/// {@template flutter.material.checkbox.hoverColor}
/// The color for the checkbox's [Material] when a pointer is hovering over it.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.hovered]
/// If [overlayColor] returns a non-null color in the [WidgetState.hovered]
/// state, it will be used instead.
/// {@endtemplate}
///
@@ -317,10 +317,10 @@ class Checkbox extends StatefulWidget {
/// The color for the checkbox's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// {@endtemplate}
///
/// If null, then the value of [activeColor] with alpha
@@ -358,19 +358,19 @@ class Checkbox extends StatefulWidget {
/// {@template flutter.material.checkbox.side}
/// The color and width of the checkbox's border.
///
/// This property can be a [MaterialStateBorderSide] that can
/// This property can be a [WidgetStateBorderSide] that can
/// specify different border color and widths depending on the
/// checkbox's state.
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [MaterialState.error].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// * [WidgetState.error].
///
/// If this property is not a [MaterialStateBorderSide] and it is
/// If this property is not a [WidgetStateBorderSide] and it is
/// non-null, then it is only rendered when the checkbox's value is
/// false. The difference in interpretation is for backwards
/// compatibility.

View File

@@ -275,15 +275,15 @@ class CheckboxListTile extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [CheckboxThemeData.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
final MouseCursor? mouseCursor;
/// The color to use when this checkbox is checked.
@@ -294,9 +294,9 @@ class CheckboxListTile extends StatelessWidget {
/// The color that fills the checkbox.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [activeColor] is used in the selected
/// state. If that is also null, the value of [CheckboxThemeData.fillColor]
@@ -314,9 +314,9 @@ class CheckboxListTile extends StatelessWidget {
/// The color for the checkbox's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
///
/// If null, then the value of [activeColor] with alpha [kRadialReactionAlpha]
/// and [hoverColor] is used in the pressed and hovered state. If that is also null,

View File

@@ -61,10 +61,10 @@ class CheckboxThemeData with Diagnosticable {
/// {@macro flutter.material.checkbox.checkColor}
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// If specified, overrides the default value of [Checkbox.checkColor].
final MaterialStateProperty<Color?>? checkColor;

View File

@@ -82,14 +82,14 @@ abstract interface class ChipAttributes {
/// This only has an effect on widgets that respect the [DefaultTextStyle],
/// such as [Text].
///
/// If [TextStyle.color] is a [MaterialStateProperty<Color>], [MaterialStateProperty.resolve]
/// is used for the following [MaterialState]s:
/// If [TextStyle.color] is a [WidgetStateProperty<Color>], [WidgetStateProperty.resolve]
/// is used for the following [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.pressed].
/// * [WidgetState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.pressed].
TextStyle? get labelStyle;
/// The color and weight of the chip's outline.
@@ -104,14 +104,14 @@ abstract interface class ChipAttributes {
/// This value is combined with [shape] to create a shape decorated with an
/// outline. To omit the outline entirely, pass [BorderSide.none] to [side].
///
/// If it is a [MaterialStateBorderSide], [MaterialStateProperty.resolve] is
/// used for the following [MaterialState]s:
/// If it is a [WidgetStateBorderSide], [WidgetStateProperty.resolve] is
/// used for the following [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.pressed].
/// * [WidgetState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.pressed].
BorderSide? get side;
/// The [OutlinedBorder] to draw around the chip.
@@ -126,14 +126,14 @@ abstract interface class ChipAttributes {
/// side of [shape] is ignored. To omit the outline entirely,
/// pass [BorderSide.none] to [side].
///
/// If it is a [MaterialStateOutlinedBorder], [MaterialStateProperty.resolve]
/// is used for the following [MaterialState]s:
/// If it is a [WidgetStateOutlinedBorder], [WidgetStateProperty.resolve]
/// is used for the following [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.pressed].
/// * [WidgetState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.pressed].
OutlinedBorder? get shape;
/// {@macro flutter.material.Material.clipBehavior}
@@ -147,13 +147,13 @@ abstract interface class ChipAttributes {
/// {@macro flutter.widgets.Focus.autofocus}
bool get autofocus;
/// The color that fills the chip, in all [MaterialState]s.
/// The color that fills the chip, in all [WidgetState]s.
///
/// Defaults to null.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.disabled].
MaterialStateProperty<Color?>? get color;
/// Color to be used for the unselected, enabled chip's background.

View File

@@ -363,15 +363,15 @@ class ChipThemeData with Diagnosticable {
/// the color and weight of the chip's outline.
///
/// This value is combined with [shape] to create a shape decorated with an
/// outline. If it is a [MaterialStateBorderSide],
/// [MaterialStateProperty.resolve] is used for the following
/// [MaterialState]s:
/// outline. If it is a [WidgetStateBorderSide],
/// [WidgetStateProperty.resolve] is used for the following
/// [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.pressed].
/// * [WidgetState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.pressed].
///
/// This property applies to [ActionChip], [Chip], [ChoiceChip],
/// [FilterChip], [InputChip], [RawChip].
@@ -381,15 +381,15 @@ class ChipThemeData with Diagnosticable {
/// the shape of border to draw around the chip.
///
/// This shape is combined with [side] to create a shape decorated with an
/// outline. If it is a [MaterialStateOutlinedBorder],
/// [MaterialStateProperty.resolve] is used for the following
/// [MaterialState]s:
/// outline. If it is a [WidgetStateOutlinedBorder],
/// [WidgetStateProperty.resolve] is used for the following
/// [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.pressed].
/// * [WidgetState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.pressed].
///
/// This property applies to [ActionChip], [Chip], [ChoiceChip],
/// [FilterChip], [InputChip], [RawChip].

View File

@@ -88,15 +88,15 @@ class DataColumn {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// heading row.
///
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.disabled].
/// * [WidgetState.disabled].
///
/// If this is null, then the value of [DataTableThemeData.headingCellCursor]
/// is used. If that's null, then [MaterialStateMouseCursor.clickable] is used.
/// is used. If that's null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor].
final MaterialStateProperty<MouseCursor?>? mouseCursor;
/// Defines the horizontal layout of the [label] and sort indicator in the
@@ -200,7 +200,7 @@ class DataRow {
/// By default, the color is transparent unless selected. Selected rows has
/// a grey translucent color.
///
/// The effective color can depend on the [MaterialState] state, if the
/// The effective color can depend on the [WidgetState] state, if the
/// row is selected, pressed, hovered, focused, disabled or enabled. The
/// color is painted as an overlay to the row. To make sure that the row's
/// [InkWell] is visible (when pressed, hovered and focused), it is
@@ -210,8 +210,8 @@ class DataRow {
///
/// ```dart
/// DataRow(
/// color: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.selected)) {
/// color: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.selected)) {
/// return Theme.of(context).colorScheme.primary.withOpacity(0.08);
/// }
/// return null; // Use the default value.
@@ -232,15 +232,15 @@ class DataRow {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// data row.
///
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [WidgetState.selected].
///
/// If this is null, then the value of [DataTableThemeData.dataRowCursor]
/// is used. If that's null, then [MaterialStateMouseCursor.clickable] is used.
/// is used. If that's null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor].
final MaterialStateProperty<MouseCursor?>? mouseCursor;
bool get _debugInteractive => onSelectChanged != null || cells.any((DataCell cell) => cell._debugInteractive);
@@ -522,7 +522,7 @@ class DataTable extends StatelessWidget {
/// The background color for the data rows.
///
/// The effective background color can be made to depend on the
/// [MaterialState] state, i.e. if the row is selected, pressed, hovered,
/// [WidgetState] state, i.e. if the row is selected, pressed, hovered,
/// focused, disabled or enabled. The color is painted as an overlay to the
/// row. To make sure that the row's [InkWell] is visible (when pressed,
/// hovered and focused), it is recommended to use a translucent background
@@ -540,8 +540,8 @@ class DataTable extends StatelessWidget {
/// {@template flutter.material.DataTable.dataRowColor}
/// ```dart
/// DataTable(
/// dataRowColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.selected)) {
/// dataRowColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.selected)) {
/// return Theme.of(context).colorScheme.primary.withOpacity(0.08);
/// }
/// return null; // Use the default value.
@@ -602,7 +602,7 @@ class DataTable extends StatelessWidget {
/// The background color for the heading row.
///
/// The effective background color can be made to depend on the
/// [MaterialState] state, i.e. if the row is pressed, hovered, focused when
/// [WidgetState] state, i.e. if the row is pressed, hovered, focused when
/// sorted. The color is painted as an overlay to the row. To make sure that
/// the row's [InkWell] is visible (when pressed, hovered and focused), it is
/// recommended to use a translucent color.
@@ -615,8 +615,8 @@ class DataTable extends StatelessWidget {
/// DataTable(
/// columns: _columns,
/// rows: _rows,
/// headingRowColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.hovered)) {
/// headingRowColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.hovered)) {
/// return Theme.of(context).colorScheme.primary.withOpacity(0.08);
/// }
/// return null; // Use the default value.

View File

@@ -138,16 +138,16 @@ class ElevatedButton extends ButtonStyleButton {
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] and [disabledForegroundColor] colors are used
/// to create a [MaterialStateProperty] [ButtonStyle.foregroundColor], and
/// to create a [WidgetStateProperty] [ButtonStyle.foregroundColor], and
/// a derived [ButtonStyle.overlayColor] if [overlayColor] isn't specified.
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// The [backgroundColor] and [disabledBackgroundColor] colors are
/// used to create a [MaterialStateProperty] [ButtonStyle.backgroundColor].
/// used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor].
///
/// Similarly, the [enabledMouseCursor] and [disabledMouseCursor]
/// parameters are used to construct [ButtonStyle.mouseCursor] and
@@ -160,7 +160,7 @@ class ElevatedButton extends ButtonStyleButton {
/// or focused, and elevation + 6 is used when the button is pressed.
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null, by default this method returns
@@ -283,7 +283,7 @@ class ElevatedButton extends ButtonStyleButton {
/// All of the ButtonStyle's defaults appear below. In this list
/// "Theme.foo" is shorthand for `Theme.of(context).foo`. Color
/// scheme values like "onSurface(0.38)" are shorthand for
/// `onSurface.withOpacity(0.38)`. [MaterialStateProperty] valued
/// `onSurface.withOpacity(0.38)`. [WidgetStateProperty] valued
/// properties that are not followed by a sublist have the same
/// value for all states, otherwise the values are as specified for
/// each state, and "others" means all other states.

View File

@@ -18,7 +18,7 @@ import 'theme.dart';
/// The [style]'s properties override [ElevatedButton]'s default style,
/// i.e. the [ButtonStyle] returned by [ElevatedButton.defaultStyleOf]. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
@@ -27,8 +27,8 @@ import 'theme.dart';
/// for text buttons.
/// * [ElevatedButton.styleFrom], which converts simple values into a
/// [ButtonStyle] that's consistent with [ElevatedButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [WidgetState]s.
/// * [ThemeData.elevatedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [ElevatedButton]s below the overall [Theme].
@immutable
@@ -40,7 +40,7 @@ class ElevatedButtonThemeData with Diagnosticable {
/// Overrides for [ElevatedButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the [ButtonStyle] returned by
/// [ElevatedButton.defaultStyleOf].
///

View File

@@ -211,12 +211,12 @@ class FilledButton extends ButtonStyleButton {
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] and [disabledForegroundColor] colors are used
/// to create a [MaterialStateProperty] [ButtonStyle.foregroundColor], and
/// to create a [WidgetStateProperty] [ButtonStyle.foregroundColor], and
/// a derived [ButtonStyle.overlayColor] if [overlayColor] isn't specified.
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// Similarly, the [enabledMouseCursor] and [disabledMouseCursor]
@@ -228,7 +228,7 @@ class FilledButton extends ButtonStyleButton {
/// or focused, and elevation + 6 is used when the button is pressed.
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null, by default this method returns
@@ -343,7 +343,7 @@ class FilledButton extends ButtonStyleButton {
/// All of the ButtonStyle's defaults appear below. In this list
/// "Theme.foo" is shorthand for `Theme.of(context).foo`. Color
/// scheme values like "onSurface(0.38)" are shorthand for
/// `onSurface.withOpacity(0.38)`. [MaterialStateProperty] valued
/// `onSurface.withOpacity(0.38)`. [WidgetStateProperty] valued
/// properties that are not followed by a sublist have the same
/// value for all states, otherwise the values are as specified for
/// each state, and "others" means all other states.

View File

@@ -18,7 +18,7 @@ import 'theme.dart';
/// The [style]'s properties override [FilledButton]'s default style,
/// i.e. the [ButtonStyle] returned by [FilledButton.defaultStyleOf]. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
@@ -27,8 +27,8 @@ import 'theme.dart';
/// for text buttons.
/// * [FilledButton.styleFrom], which converts simple values into a
/// [ButtonStyle] that's consistent with [FilledButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [WidgetState]s.
/// * [ThemeData.filledButtonTheme], which can be used to override the default
/// [ButtonStyle] for [FilledButton]s below the overall [Theme].
@immutable
@@ -40,7 +40,7 @@ class FilledButtonThemeData with Diagnosticable {
/// Overrides for [FilledButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the [ButtonStyle] returned by
/// [FilledButton.defaultStyleOf].
///

View File

@@ -402,7 +402,7 @@ class FlexibleSpaceBarSettings extends InheritedWidget {
/// True if the FlexibleSpaceBar overlaps the primary scrollable's contents.
///
/// This value is used by the [AppBar] to resolve
/// [AppBar.backgroundColor] against [MaterialState.scrolledUnder],
/// [AppBar.backgroundColor] against [WidgetState.scrolledUnder],
/// i.e. to enable apps to specify different colors when content
/// has been scrolled up and behind the app bar.
///

View File

@@ -323,7 +323,7 @@ class FloatingActionButton extends StatelessWidget {
/// {@macro flutter.material.RawMaterialButton.mouseCursor}
///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// If this property is null, [WidgetStateMouseCursor.clickable] will be used.
final MouseCursor? mouseCursor;
/// The z-coordinate at which to place this button relative to its parent.

View File

@@ -523,8 +523,8 @@ class IconButton extends StatelessWidget {
///
/// Non-null properties of this style override the corresponding
/// properties in [_IconButtonM3.themeStyleOf] and [_IconButtonM3.defaultStyleOf].
/// [MaterialStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [MaterialStateProperty]s in [_IconButtonM3.themeStyleOf]
/// [WidgetStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [WidgetStateProperty]s in [_IconButtonM3.themeStyleOf]
/// and [_IconButtonM3.defaultStyleOf].
///
/// The [style] is only used for Material 3 [IconButton]. If [ThemeData.useMaterial3]
@@ -569,7 +569,7 @@ class IconButton extends StatelessWidget {
/// A static convenience method that constructs an icon button
/// [ButtonStyle] given simple values. This method is only used for Material 3.
///
/// The [foregroundColor] color is used to create a [MaterialStateProperty]
/// The [foregroundColor] color is used to create a [WidgetStateProperty]
/// [ButtonStyle.foregroundColor] value. Specify a value for [foregroundColor]
/// to specify the color of the button's icons. The [hoverColor], [focusColor]
/// and [highlightColor] colors are used to indicate the hover, focus,
@@ -577,7 +577,7 @@ class IconButton extends StatelessWidget {
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// Use [backgroundColor] for the button's background fill color. Use [disabledForegroundColor]
@@ -587,7 +587,7 @@ class IconButton extends StatelessWidget {
/// parameters are used to construct [ButtonStyle].mouseCursor.
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null, by default this method returns

View File

@@ -20,15 +20,15 @@ import 'theme.dart';
///
/// The [style]'s properties override [IconButton]'s default style. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
/// * [IconButtonTheme], the theme which is configured with this class.
/// * [IconButton.styleFrom], which converts simple values into a
/// [ButtonStyle] that's consistent with [IconButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [WidgetState]s.
/// * [ThemeData.iconButtonTheme], which can be used to override the default
/// [ButtonStyle] for [IconButton]s below the overall [Theme].
@immutable
@@ -41,7 +41,7 @@ class IconButtonThemeData with Diagnosticable {
/// Overrides for [IconButton]'s default style if [ThemeData.useMaterial3]
/// is set to true.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the default [ButtonStyle] in [IconButton].
///
/// If [style] is null, then this theme doesn't override anything.

View File

@@ -394,14 +394,14 @@ class InkResponse extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// If this property is null, [WidgetStateMouseCursor.clickable] will be used.
final MouseCursor? mouseCursor;
/// Whether this ink response should be clipped its bounds.
@@ -510,12 +510,12 @@ class InkResponse extends StatelessWidget {
/// This default null property can be used as an alternative to
/// [focusColor], [hoverColor], [highlightColor], and
/// [splashColor]. If non-null, it is resolved against one of
/// [MaterialState.focused], [MaterialState.hovered], and
/// [MaterialState.pressed]. It's convenient to use when the parent
/// widget can pass along its own MaterialStateProperty value for
/// [WidgetState.focused], [WidgetState.hovered], and
/// [WidgetState.pressed]. It's convenient to use when the parent
/// widget can pass along its own WidgetStateProperty value for
/// the overlay color.
///
/// [MaterialState.pressed] triggers a ripple (an ink splash), per
/// [WidgetState.pressed] triggers a ripple (an ink splash), per
/// the current Material Design spec. The [overlayColor] doesn't map
/// a state to [highlightColor] because a separate highlight is not
/// used by the current design guidelines. See
@@ -606,12 +606,12 @@ class InkResponse extends StatelessWidget {
/// {@template flutter.material.inkwell.statesController}
/// Represents the interactive "state" of this widget in terms of
/// a set of [MaterialState]s, like [MaterialState.pressed] and
/// [MaterialState.focused].
/// a set of [WidgetState]s, like [WidgetState.pressed] and
/// [WidgetState.focused].
///
/// Classes based on this one can provide their own
/// [MaterialStatesController] to which they've added listeners.
/// They can also update the controller's [MaterialStatesController.value]
/// [WidgetStatesController] to which they've added listeners.
/// They can also update the controller's [WidgetStatesController.value]
/// however, this may only be done when it's safe to call
/// [State.setState], like in an event handler.
/// {@endtemplate}

View File

@@ -2516,14 +2516,14 @@ class _InputDecoratorState extends State<InputDecorator> with TickerProviderStat
///
/// {@tool dartpad}
/// This sample shows how to style a `TextField` with a prefixIcon that changes color
/// based on the `MaterialState`. The color defaults to gray and is green while focused.
/// based on the `WidgetState`. The color defaults to gray and is green while focused.
///
/// ** See code in examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart **
/// {@end-tool}
///
/// {@tool dartpad}
/// This sample shows how to style a `TextField` with a prefixIcon that changes color
/// based on the `MaterialState` through the use of `ThemeData`. The color defaults
/// based on the `WidgetState` through the use of `ThemeData`. The color defaults
/// to gray, be blue while focused and red if in an error state.
///
/// ** See code in examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart **
@@ -2689,8 +2689,8 @@ class InputDecoration {
/// The color of the [icon].
///
/// If [iconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [iconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
final Color? iconColor;
@@ -2730,8 +2730,8 @@ class InputDecoration {
/// The style to use for [InputDecoration.labelText] when the label is on top
/// of the input field.
///
/// If [labelStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [labelStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// When the [InputDecoration.labelText] is above (i.e., vertically adjacent to)
@@ -2748,7 +2748,7 @@ class InputDecoration {
/// It's possible to override the label style for just the error state, or
/// just the default state, or both.
///
/// In this example the [labelStyle] is specified with a [MaterialStateProperty]
/// In this example the [labelStyle] is specified with a [WidgetStateProperty]
/// which resolves to a text style whose color depends on the decorator's
/// error state.
///
@@ -2764,8 +2764,8 @@ class InputDecoration {
/// When the [InputDecoration.labelText] is on top of the input field, the
/// text uses the [labelStyle] instead.
///
/// If [floatingLabelStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [floatingLabelStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to [labelStyle].
@@ -2779,7 +2779,7 @@ class InputDecoration {
/// just the default state, or both.
///
/// In this example the [floatingLabelStyle] is specified with a
/// [MaterialStateProperty] which resolves to a text style whose color depends
/// [WidgetStateProperty] which resolves to a text style whose color depends
/// on the decorator's error state.
///
/// ** See code in examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart **
@@ -2817,8 +2817,8 @@ class InputDecoration {
/// The style to use for the [helperText].
///
/// If [helperStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [helperStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
final TextStyle? helperStyle;
@@ -2844,8 +2844,8 @@ class InputDecoration {
/// The style to use for the [hintText].
///
/// If [hintStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [hintStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// Also used for the [labelText] when the [labelText] is displayed on
@@ -3115,8 +3115,8 @@ class InputDecoration {
/// The style to use for the [prefixText].
///
/// If [prefixStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [prefixStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [hintStyle].
@@ -3130,8 +3130,8 @@ class InputDecoration {
///
/// Defaults to [iconColor]
///
/// If [prefixIconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [prefixIconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
final Color? prefixIconColor;
@@ -3213,8 +3213,8 @@ class InputDecoration {
/// The style to use for the [suffixText].
///
/// If [suffixStyle] is a [MaterialStateTextStyle], then the effective text
/// style can depend on the [MaterialState.focused] state, i.e. if the
/// If [suffixStyle] is a [WidgetStateTextStyle], then the effective text
/// style can depend on the [WidgetState.focused] state, i.e. if the
/// [TextField] is focused or not.
///
/// If null, defaults to the [hintStyle].
@@ -3228,8 +3228,8 @@ class InputDecoration {
///
/// Defaults to [iconColor]
///
/// If [suffixIconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [suffixIconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
final Color? suffixIconColor;
@@ -3277,8 +3277,8 @@ class InputDecoration {
/// The style to use for the [counterText].
///
/// If [counterStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [counterStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [helperStyle].
@@ -3460,7 +3460,7 @@ class InputDecoration {
///
/// If [border] is a [MaterialStateUnderlineInputBorder]
/// or [MaterialStateOutlineInputBorder], then the effective border can depend on
/// the [MaterialState.focused] state, i.e. if the [TextField] is focused or not.
/// the [WidgetState.focused] state, i.e. if the [TextField] is focused or not.
///
/// If [border] derives from [InputBorder] the border's [InputBorder.borderSide],
/// i.e. the border's color and width, will be overridden to reflect the input
@@ -3923,8 +3923,8 @@ class InputDecorationTheme with Diagnosticable {
/// The style to use for [InputDecoration.helperText].
///
/// If [helperStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [helperStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
final TextStyle? helperStyle;
@@ -3943,8 +3943,8 @@ class InputDecorationTheme with Diagnosticable {
/// The style to use for the [InputDecoration.hintText].
///
/// If [hintStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [hintStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// Also used for the [InputDecoration.labelText] when the
@@ -4013,8 +4013,8 @@ class InputDecorationTheme with Diagnosticable {
/// The Color to use for the [InputDecoration.icon].
///
/// If [iconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [iconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [ColorScheme.primary].
@@ -4022,8 +4022,8 @@ class InputDecorationTheme with Diagnosticable {
/// The style to use for the [InputDecoration.prefixText].
///
/// If [prefixStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [prefixStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [hintStyle].
@@ -4031,8 +4031,8 @@ class InputDecorationTheme with Diagnosticable {
/// The Color to use for the [InputDecoration.prefixIcon].
///
/// If [prefixIconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [prefixIconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [ColorScheme.primary].
@@ -4040,8 +4040,8 @@ class InputDecorationTheme with Diagnosticable {
/// The style to use for the [InputDecoration.suffixText].
///
/// If [suffixStyle] is a [MaterialStateTextStyle], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [suffixStyle] is a [WidgetStateTextStyle], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [hintStyle].
@@ -4049,8 +4049,8 @@ class InputDecorationTheme with Diagnosticable {
/// The Color to use for the [InputDecoration.suffixIcon].
///
/// If [suffixIconColor] is a [MaterialStateColor], then the effective
/// color can depend on the [MaterialState.focused] state, i.e.
/// If [suffixIconColor] is a [WidgetStateColor], then the effective
/// color can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [ColorScheme.primary].
@@ -4058,8 +4058,8 @@ class InputDecorationTheme with Diagnosticable {
/// The style to use for the [InputDecoration.counterText].
///
/// If [counterStyle] is a [MaterialStateTextStyle], then the effective
/// text style can depend on the [MaterialState.focused] state, i.e.
/// If [counterStyle] is a [WidgetStateTextStyle], then the effective
/// text style can depend on the [WidgetState.focused] state, i.e.
/// if the [TextField] is focused or not.
///
/// If null, defaults to the [helperStyle].
@@ -4236,7 +4236,7 @@ class InputDecorationTheme with Diagnosticable {
///
/// If [border] is a [MaterialStateUnderlineInputBorder]
/// or [MaterialStateOutlineInputBorder], then the effective border can depend on
/// the [MaterialState.focused] state, i.e. if the [TextField] is focused or not.
/// the [WidgetState.focused] state, i.e. if the [TextField] is focused or not.
///
/// The decoration's container is the area which is filled if [filled] is
/// true and bordered per the [border]. It's the area adjacent to

View File

@@ -223,7 +223,7 @@ enum ListTileTitleAlignment {
///
/// {@tool dartpad}
/// This sample shows [ListTile]'s [textColor] and [iconColor] can use
/// [MaterialStateColor] color to change the color of the text and icon
/// [WidgetStateColor] color to change the color of the text and icon
/// when the [ListTile] is enabled, selected, or disabled.
///
/// ** See code in examples/api/lib/material/list_tile/list_tile.3.dart **
@@ -510,8 +510,8 @@ class ListTile extends StatelessWidget {
/// If this property is null and [selected] is true then [ListTileThemeData.selectedColor]
/// is used. If that is also null then [ColorScheme.primary] is used.
///
/// If this color is a [MaterialStateColor] it will be resolved against
/// [MaterialState.selected] and [MaterialState.disabled] states.
/// If this color is a [WidgetStateColor] it will be resolved against
/// [WidgetState.selected] and [WidgetState.disabled] states.
///
/// See also:
///
@@ -529,8 +529,8 @@ class ListTile extends StatelessWidget {
/// If this property is null and [selected] is true then [ListTileThemeData.selectedColor]
/// is used. If that is also null then [ColorScheme.primary] is used.
///
/// If this color is a [MaterialStateColor] it will be resolved against
/// [MaterialState.selected] and [MaterialState.disabled] states.
/// If this color is a [WidgetStateColor] it will be resolved against
/// [WidgetState.selected] and [WidgetState.disabled] states.
///
/// See also:
///
@@ -606,20 +606,20 @@ class ListTile extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If null, then the value of [ListTileThemeData.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// If this tile is also [enabled] then icons and text are rendered with the same color.

View File

@@ -114,7 +114,7 @@ class MaterialButton extends StatelessWidget {
/// {@macro flutter.material.RawMaterialButton.mouseCursor}
///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// If this property is null, [WidgetStateMouseCursor.clickable] will be used.
final MouseCursor? mouseCursor;
/// Defines the button's base colors, and the defaults for the button's minimum
@@ -132,7 +132,7 @@ class MaterialButton extends StatelessWidget {
/// The default text color depends on the button theme's text theme,
/// [ButtonThemeData.textTheme].
///
/// If [textColor] is a [MaterialStateProperty<Color>], [disabledTextColor]
/// If [textColor] is a [WidgetStateProperty<Color>], [disabledTextColor]
/// will be ignored.
///
/// See also:
@@ -150,7 +150,7 @@ class MaterialButton extends StatelessWidget {
/// The default value is the theme's disabled color,
/// [ThemeData.disabledColor].
///
/// If [textColor] is a [MaterialStateProperty<Color>], [disabledTextColor]
/// If [textColor] is a [WidgetStateProperty<Color>], [disabledTextColor]
/// will be ignored.
///
/// See also:

View File

@@ -924,9 +924,9 @@ class MenuItemButton extends StatefulWidget {
/// Customizes this button's appearance.
///
/// Non-null properties of this style override the corresponding properties in
/// [themeStyleOf] and [defaultStyleOf]. [MaterialStateProperty]s that resolve
/// [themeStyleOf] and [defaultStyleOf]. [WidgetStateProperty]s that resolve
/// to non-null values will similarly override the corresponding
/// [MaterialStateProperty]s in [themeStyleOf] and [defaultStyleOf].
/// [WidgetStateProperty]s in [themeStyleOf] and [defaultStyleOf].
///
/// Null by default.
final ButtonStyle? style;
@@ -998,7 +998,7 @@ class MenuItemButton extends StatefulWidget {
/// A static convenience method that constructs a [MenuItemButton]'s
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] color is used to create a [MaterialStateProperty]
/// The [foregroundColor] color is used to create a [WidgetStateProperty]
/// [ButtonStyle.foregroundColor] value. Specify a value for [foregroundColor]
/// to specify the color of the button's icons. Use [backgroundColor] for the
/// button's background fill color. Use [disabledForegroundColor] and
@@ -1006,7 +1006,7 @@ class MenuItemButton extends StatefulWidget {
/// color.
///
/// All of the other parameters are either used directly or used to create a
/// [MaterialStateProperty] with a single value for all states.
/// [WidgetStateProperty] with a single value for all states.
///
/// All parameters default to null, by default this method returns a
/// [ButtonStyle] that doesn't override anything.
@@ -1331,8 +1331,8 @@ class CheckboxMenuButton extends StatelessWidget {
///
/// Non-null properties of this style override the corresponding properties in
/// [MenuItemButton.themeStyleOf] and [MenuItemButton.defaultStyleOf].
/// [MaterialStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [MaterialStateProperty]s in
/// [WidgetStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [WidgetStateProperty]s in
/// [MenuItemButton.themeStyleOf] and [MenuItemButton.defaultStyleOf].
///
/// Null by default.
@@ -1530,8 +1530,8 @@ class RadioMenuButton<T> extends StatelessWidget {
///
/// Non-null properties of this style override the corresponding properties in
/// [MenuItemButton.themeStyleOf] and [MenuItemButton.defaultStyleOf].
/// [MaterialStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [MaterialStateProperty]s in
/// [WidgetStateProperty]s that resolve to non-null values will similarly
/// override the corresponding [WidgetStateProperty]s in
/// [MenuItemButton.themeStyleOf] and [MenuItemButton.defaultStyleOf].
///
/// Null by default.
@@ -1680,9 +1680,9 @@ class SubmenuButton extends StatefulWidget {
/// Customizes this button's appearance.
///
/// Non-null properties of this style override the corresponding properties in
/// [themeStyleOf] and [defaultStyleOf]. [MaterialStateProperty]s that resolve
/// [themeStyleOf] and [defaultStyleOf]. [WidgetStateProperty]s that resolve
/// to non-null values will similarly override the corresponding
/// [MaterialStateProperty]s in [themeStyleOf] and [defaultStyleOf].
/// [WidgetStateProperty]s in [themeStyleOf] and [defaultStyleOf].
///
/// Null by default.
final ButtonStyle? style;
@@ -1756,7 +1756,7 @@ class SubmenuButton extends StatefulWidget {
/// A static convenience method that constructs a [SubmenuButton]'s
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] color is used to create a [MaterialStateProperty]
/// The [foregroundColor] color is used to create a [WidgetStateProperty]
/// [ButtonStyle.foregroundColor] value. Specify a value for [foregroundColor]
/// to specify the color of the button's icons. Use [backgroundColor] for the
/// button's background fill color. Use [disabledForegroundColor] and
@@ -1764,7 +1764,7 @@ class SubmenuButton extends StatefulWidget {
/// color.
///
/// All of the other parameters are either used directly or used to create a
/// [MaterialStateProperty] with a single value for all states.
/// [WidgetStateProperty] with a single value for all states.
///
/// All parameters default to null, by default this method returns a
/// [ButtonStyle] that doesn't override anything.
@@ -3603,7 +3603,7 @@ class _Submenu extends StatelessWidget {
}
}
/// Wraps the [MaterialStateMouseCursor] so that it can default to
/// Wraps the [WidgetStateMouseCursor] so that it can default to
/// [MouseCursor.uncontrolled] if none is set.
class _MouseCursor extends MaterialStateMouseCursor {
const _MouseCursor(this.resolveCallback);

View File

@@ -93,7 +93,7 @@ class MenuBarTheme extends InheritedTheme {
/// return MenuTheme(
/// data: const MenuThemeData(
/// style: MenuStyle(
/// backgroundColor: MaterialStatePropertyAll<Color?>(Colors.red),
/// backgroundColor: WidgetStatePropertyAll<Color?>(Colors.red),
/// ),
/// ),
/// child: child,

View File

@@ -6,7 +6,6 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'button_style.dart';
import 'material_state.dart';
import 'menu_anchor.dart';
import 'theme.dart';
@@ -21,7 +20,7 @@ import 'theme.dart';
/// default style, i.e. the [ButtonStyle] returned by
/// [MenuItemButton.defaultStyleOf] and [SubmenuButton.defaultStyleOf]. Only the
/// style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
@@ -33,8 +32,8 @@ import 'theme.dart';
/// * [MenuItemButton.styleFrom] and [SubmenuButton.styleFrom], which converts
/// simple values into a [ButtonStyle] that's consistent with their respective
/// defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property to a
/// simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property to a
/// simple value based on a set of [WidgetState]s.
/// * [ThemeData.menuButtonTheme], which can be used to override the default
/// [ButtonStyle] for [MenuItemButton]s and [SubmenuButton]s below the overall
/// [Theme].
@@ -50,7 +49,7 @@ class MenuButtonThemeData with Diagnosticable {
/// Overrides for [SubmenuButton] and [MenuItemButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty] values
/// Non-null properties or non-null resolved [WidgetStateProperty] values
/// override the [ButtonStyle] returned by [SubmenuButton.defaultStyleOf] or
/// [MenuItemButton.defaultStyleOf].
///

View File

@@ -34,9 +34,9 @@ import 'theme_data.dart';
///
/// All of the [MenuStyle] properties are null by default.
///
/// Many of the [MenuStyle] properties are [MaterialStateProperty] objects which
/// Many of the [MenuStyle] properties are [WidgetStateProperty] objects which
/// resolve to different values depending on the menu's state. For example the
/// [Color] properties are defined with `MaterialStateProperty<Color>` and can
/// [Color] properties are defined with `WidgetStateProperty<Color>` and can
/// resolve to different colors depending on if the menu is pressed, hovered,
/// focused, disabled, etc.
///
@@ -48,9 +48,9 @@ import 'theme_data.dart';
/// ```dart
/// SubmenuButton(
/// menuStyle: MenuStyle(
/// backgroundColor: MaterialStateProperty.resolveWith<Color?>(
/// (Set<MaterialState> states) {
/// if (states.contains(MaterialState.focused)) {
/// backgroundColor: WidgetStateProperty.resolveWith<Color?>(
/// (Set<WidgetState> states) {
/// if (states.contains(WidgetState.focused)) {
/// return Theme.of(context).colorScheme.primary.withOpacity(0.5);
/// }
/// return null; // Use the component's default.
@@ -69,7 +69,7 @@ import 'theme_data.dart';
/// ```dart
/// const SubmenuButton(
/// menuStyle: MenuStyle(
/// backgroundColor: MaterialStatePropertyAll<Color>(Colors.green),
/// backgroundColor: WidgetStatePropertyAll<Color>(Colors.green),
/// ),
/// menuChildren: <Widget>[ /* ... */ ],
/// child: Text('Let me play among the stars'),
@@ -83,7 +83,7 @@ import 'theme_data.dart';
/// MaterialApp(
/// theme: ThemeData(
/// menuTheme: const MenuThemeData(
/// style: MenuStyle(backgroundColor: MaterialStatePropertyAll<Color>(Colors.red)),
/// style: MenuStyle(backgroundColor: WidgetStatePropertyAll<Color>(Colors.red)),
/// ),
/// ),
/// home: const MyAppHome(),

View File

@@ -111,7 +111,7 @@ class MenuTheme extends InheritedTheme {
/// return MenuTheme(
/// data: const MenuThemeData(
/// style: MenuStyle(
/// backgroundColor: MaterialStatePropertyAll<Color>(Colors.red),
/// backgroundColor: WidgetStatePropertyAll<Color>(Colors.red),
/// ),
/// ),
/// child: child,

View File

@@ -332,7 +332,7 @@ class NavigationDestination extends StatelessWidget {
/// selected.
///
/// The icon will use [NavigationBarThemeData.iconTheme] with
/// [MaterialState.selected]. If this is null, the default [IconThemeData]
/// [WidgetState.selected]. If this is null, the default [IconThemeData]
/// would use a size of 24.0 and [ColorScheme.onSurface].
final Widget? selectedIcon;

View File

@@ -218,7 +218,7 @@ class NavigationDrawerDestination extends StatelessWidget {
/// selected.
///
/// The icon will use [NavigationDrawerThemeData.iconTheme] with
/// [MaterialState.selected]. If this is null, the default [IconThemeData]
/// [WidgetState.selected]. If this is null, the default [IconThemeData]
/// would use a size of 24.0 and [ColorScheme.onSecondaryContainer].
final Widget? selectedIcon;

View File

@@ -142,11 +142,11 @@ class OutlinedButton extends ButtonStyleButton {
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] and [disabledForegroundColor] colors are used
/// to create a [MaterialStateProperty] [ButtonStyle.foregroundColor], and
/// to create a [WidgetStateProperty] [ButtonStyle.foregroundColor], and
/// a derived [ButtonStyle.overlayColor] if [overlayColor] isn't specified.
///
/// The [backgroundColor] and [disabledBackgroundColor] colors are
/// used to create a [MaterialStateProperty] [ButtonStyle.backgroundColor].
/// used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor].
///
/// Similarly, the [enabledMouseCursor] and [disabledMouseCursor]
/// parameters are used to construct [ButtonStyle.mouseCursor] and
@@ -155,11 +155,11 @@ class OutlinedButton extends ButtonStyleButton {
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null, by default this method returns
@@ -271,7 +271,7 @@ class OutlinedButton extends ButtonStyleButton {
/// All of the ButtonStyle's defaults appear below. In this list
/// "Theme.foo" is shorthand for `Theme.of(context).foo`. Color
/// scheme values like "onSurface(0.38)" are shorthand for
/// `onSurface.withOpacity(0.38)`. [MaterialStateProperty] valued
/// `onSurface.withOpacity(0.38)`. [WidgetStateProperty] valued
/// properties that are not followed by a sublist have the same
/// value for all states, otherwise the values are as specified for
/// each state and "others" means all other states.

View File

@@ -18,7 +18,7 @@ import 'theme.dart';
/// The [style]'s properties override [OutlinedButton]'s default style,
/// i.e. the [ButtonStyle] returned by [OutlinedButton.defaultStyleOf]. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
@@ -27,8 +27,8 @@ import 'theme.dart';
/// for outlined buttons.
/// * [OutlinedButton.styleFrom], which converts simple values into a
/// [ButtonStyle] that's consistent with [OutlinedButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [WidgetState]s.
/// * [ThemeData.outlinedButtonTheme], which can be used to override the default
/// [ButtonStyle] for [OutlinedButton]s below the overall [Theme].
@immutable
@@ -40,7 +40,7 @@ class OutlinedButtonThemeData with Diagnosticable {
/// Overrides for [OutlinedButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the [ButtonStyle] returned by
/// [OutlinedButton.defaultStyleOf].
///

View File

@@ -285,16 +285,16 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If null, then the value of [PopupMenuThemeData.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
final MouseCursor? mouseCursor;
/// The widget below this widget in the tree.

View File

@@ -175,23 +175,23 @@ class Radio<T> extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If null, then the value of [RadioThemeData.mouseCursor] is used.
/// If that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// If that is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], a [MouseCursor] that implements
/// `MaterialStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], a [MouseCursor] that implements
/// `WidgetStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// Set to true if this radio button is allowed to be returned to an
@@ -223,31 +223,31 @@ class Radio<T> extends StatefulWidget {
///
/// Defaults to [ColorScheme.secondary].
///
/// If [fillColor] returns a non-null color in the [MaterialState.selected]
/// If [fillColor] returns a non-null color in the [WidgetState.selected]
/// state, it will be used instead of this color.
final Color? activeColor;
/// {@template flutter.material.radio.fillColor}
/// The color that fills the radio button, in all [MaterialState]s.
/// The color that fills the radio button, in all [WidgetState]s.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [fillColor] based on the current [MaterialState]
/// This example resolves the [fillColor] based on the current [WidgetState]
/// of the [Radio], providing a different [Color] when it is
/// [MaterialState.disabled].
/// [WidgetState.disabled].
///
/// ```dart
/// Radio<int>(
/// value: 1,
/// groupValue: 1,
/// onChanged: (_){},
/// fillColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// fillColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withOpacity(.32);
/// }
/// return Colors.orange;
@@ -297,7 +297,7 @@ class Radio<T> extends StatefulWidget {
/// The color for the radio's [Material] when it has the input focus.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.focused]
/// If [overlayColor] returns a non-null color in the [WidgetState.focused]
/// state, it will be used instead.
///
/// If null, then the value of [RadioThemeData.overlayColor] is used in the
@@ -308,7 +308,7 @@ class Radio<T> extends StatefulWidget {
/// {@template flutter.material.radio.hoverColor}
/// The color for the radio's [Material] when a pointer is hovering over it.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.hovered]
/// If [overlayColor] returns a non-null color in the [WidgetState.hovered]
/// state, it will be used instead.
/// {@endtemplate}
///
@@ -321,10 +321,10 @@ class Radio<T> extends StatefulWidget {
/// The color for the radio's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// {@endtemplate}
///
/// If null, then the value of [activeColor] with alpha

View File

@@ -272,15 +272,15 @@ class RadioListTile<T> extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [RadioThemeData.mouseCursor] is used.
/// If that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// If that is also null, then [WidgetStateMouseCursor.clickable] is used.
final MouseCursor? mouseCursor;
/// Set to true if this radio list tile is allowed to be returned to an
@@ -316,9 +316,9 @@ class RadioListTile<T> extends StatelessWidget {
/// The color that fills the radio button.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [activeColor] is used in the selected state. If
/// that is also null, then the value of [RadioThemeData.fillColor] is used.
@@ -336,9 +336,9 @@ class RadioListTile<T> extends StatelessWidget {
/// The color for the radio's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
///
/// If null, then the value of [activeColor] with alpha [kRadialReactionAlpha]
/// and [hoverColor] is used in the pressed and hovered state. If that is also

View File

@@ -50,7 +50,7 @@ class RadioThemeData with Diagnosticable {
/// {@macro flutter.material.radio.mouseCursor}
///
/// If specified, overrides the default value of [Radio.mouseCursor]. The
/// default value is [MaterialStateMouseCursor.clickable].
/// default value is [WidgetStateMouseCursor.clickable].
final MaterialStateProperty<MouseCursor?>? mouseCursor;
/// {@macro flutter.material.radio.fillColor}

View File

@@ -340,11 +340,11 @@ class RangeSlider extends StatefulWidget {
/// widget.
///
/// If null, then the value of [SliderThemeData.mouseCursor] is used. If that
/// is also null, then [MaterialStateMouseCursor.clickable] is used.
/// is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor].
final MaterialStateProperty<MouseCursor?>? mouseCursor;
/// The callback used to create a semantic value from the slider's values.

View File

@@ -30,8 +30,8 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600);
/// Dynamically changes to a [CupertinoScrollbar], an iOS style scrollbar, by
/// default on the iOS platform.
///
/// The color of the Scrollbar thumb will change when [MaterialState.dragged],
/// or [MaterialState.hovered] on desktop and web platforms. These stateful
/// The color of the Scrollbar thumb will change when [WidgetState.dragged],
/// or [WidgetState.hovered] on desktop and web platforms. These stateful
/// color choices can be changed using [ScrollbarThemeData.thumbColor].
///
/// {@tool dartpad}
@@ -55,11 +55,11 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600);
/// {@end-tool}
///
/// A scrollbar track can be added using [trackVisibility]. This can also be
/// drawn when triggered by a hover event, or based on any [MaterialState] by
/// drawn when triggered by a hover event, or based on any [WidgetState] by
/// using [ScrollbarThemeData.trackVisibility].
///
/// The [thickness] of the track and scrollbar thumb can be changed dynamically
/// in response to [MaterialState]s using [ScrollbarThemeData.thickness].
/// in response to [WidgetState]s using [ScrollbarThemeData.thickness].
///
/// See also:
///

View File

@@ -55,7 +55,7 @@ class ScrollbarThemeData with Diagnosticable {
/// descendant [Scrollbar] widgets.
///
/// Resolves in the following states:
/// * [MaterialState.hovered] on web and desktop platforms.
/// * [WidgetState.hovered] on web and desktop platforms.
final MaterialStateProperty<double?>? thickness;
/// Overrides the default value of [Scrollbar.trackVisibility] in all
@@ -74,22 +74,22 @@ class ScrollbarThemeData with Diagnosticable {
/// [Scrollbar] widgets.
///
/// Resolves in the following states:
/// * [MaterialState.dragged].
/// * [MaterialState.hovered] on web and desktop platforms.
/// * [WidgetState.dragged].
/// * [WidgetState.hovered] on web and desktop platforms.
final MaterialStateProperty<Color?>? thumbColor;
/// Overrides the default [Color] of the [Scrollbar] track when
/// [trackVisibility] is true in all descendant [Scrollbar] widgets.
///
/// Resolves in the following states:
/// * [MaterialState.hovered] on web and desktop platforms.
/// * [WidgetState.hovered] on web and desktop platforms.
final MaterialStateProperty<Color?>? trackColor;
/// Overrides the default [Color] of the [Scrollbar] track border when
/// [trackVisibility] is true in all descendant [Scrollbar] widgets.
///
/// Resolves in the following states:
/// * [MaterialState.hovered] on web and desktop platforms.
/// * [WidgetState.hovered] on web and desktop platforms.
final MaterialStateProperty<Color?>? trackBorderColor;
/// Overrides the default value of the [ScrollbarPainter.crossAxisMargin]

View File

@@ -202,22 +202,22 @@ class SegmentedButton<T> extends StatefulWidget {
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor], [selectedForegroundColor], and [disabledForegroundColor]
/// colors are used to create a [MaterialStateProperty] [ButtonStyle.foregroundColor],
/// colors are used to create a [WidgetStateProperty] [ButtonStyle.foregroundColor],
/// and a derived [ButtonStyle.overlayColor] if [overlayColor] isn't specified.
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// The [backgroundColor], [selectedBackgroundColor] and [disabledBackgroundColor]
/// colors are used to create a [MaterialStateProperty] [ButtonStyle.backgroundColor].
/// colors are used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor].
///
/// Similarly, the [enabledMouseCursor] and [disabledMouseCursor]
/// parameters are used to construct [ButtonStyle.mouseCursor].
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null. By default this method returns
@@ -336,7 +336,7 @@ class SegmentedButton<T> extends StatefulWidget {
/// * [ButtonStyle.shape]
///
/// The following style properties are applied to each of the individual
/// button segments. For properties that are a [MaterialStateProperty],
/// button segments. For properties that are a [WidgetStateProperty],
/// they will be resolved with the current state of the segment:
///
/// * [ButtonStyle.textStyle]

View File

@@ -36,7 +36,7 @@ class SegmentedButtonThemeData with Diagnosticable {
/// Overrides the [SegmentedButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the default values used by [SegmentedButton].
///
/// If [style] is null, then this theme doesn't override anything.

View File

@@ -477,22 +477,22 @@ class Slider extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.dragged].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.dragged].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If null, then the value of [SliderThemeData.mouseCursor] is used. If that
/// is also null, then [MaterialStateMouseCursor.clickable] is used.
/// is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// The callback used to create a semantic value from a slider value.

View File

@@ -98,8 +98,8 @@ class SnackBarAction extends StatefulWidget {
/// The button label color. If not provided, defaults to
/// [SnackBarThemeData.actionTextColor].
///
/// If [textColor] is a [MaterialStateColor], then the text color will be
/// resolved against the set of [MaterialState]s that the action text
/// If [textColor] is a [WidgetStateColor], then the text color will be
/// resolved against the set of [WidgetState]s that the action text
/// is in, thus allowing for different colors for states such as pressed,
/// hovered and others.
final Color? textColor;
@@ -107,8 +107,8 @@ class SnackBarAction extends StatefulWidget {
/// The button background fill color. If not provided, defaults to
/// [SnackBarThemeData.actionBackgroundColor].
///
/// If [backgroundColor] is a [MaterialStateColor], then the text color will
/// be resolved against the set of [MaterialState]s that the action text is
/// If [backgroundColor] is a [WidgetStateColor], then the text color will
/// be resolved against the set of [WidgetState]s that the action text is
/// in, thus allowing for different colors for the states.
final Color? backgroundColor;
@@ -439,8 +439,8 @@ class SnackBar extends StatefulWidget {
/// [ThemeData.snackBarTheme] is used. If that is null, then the default is
/// inverse surface.
///
/// If [closeIconColor] is a [MaterialStateColor], then the icon color will be
/// resolved against the set of [MaterialState]s that the action text
/// If [closeIconColor] is a [WidgetStateColor], then the icon color will be
/// resolved against the set of [WidgetState]s that the action text
/// is in, thus allowing for different colors for states such as pressed,
/// hovered and others.
final Color? closeIconColor;

View File

@@ -339,8 +339,8 @@ class Stepper extends StatefulWidget {
/// Customize connected lines colors.
///
/// Resolves in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.disabled].
///
/// If not set then the widget will use default colors, primary for selected state
/// and grey.shade400 for disabled state.

View File

@@ -45,7 +45,7 @@ enum _SwitchType { material, adaptive }
///
/// Material Design 3 provides the option to add icons on the thumb of the [Switch].
/// If [ThemeData.useMaterial3] is set to true, users can use [Switch.thumbIcon]
/// to add optional Icons based on the different [MaterialState]s of the [Switch].
/// to add optional Icons based on the different [WidgetState]s of the [Switch].
///
/// {@tool dartpad}
/// This example shows a toggleable [Switch]. When the thumb slides to the other
@@ -55,7 +55,7 @@ enum _SwitchType { material, adaptive }
/// {@end-tool}
///
/// {@tool dartpad}
/// This example shows how to customize [Switch] using [MaterialStateProperty]
/// This example shows how to customize [Switch] using [WidgetStateProperty]
/// switch properties.
///
/// ** See code in examples/api/lib/material/switch/switch.1.dart **
@@ -82,7 +82,7 @@ enum _SwitchType { material, adaptive }
/// * [Checkbox], another widget with similar semantics.
/// * [Radio], for selecting among a set of explicit values.
/// * [Slider], for selecting a value in a range.
/// * [MaterialStateProperty], an interface for objects that "resolve" to
/// * [WidgetStateProperty], an interface for objects that "resolve" to
/// different values depending on a widget's material state.
/// * <https://material.io/design/components/selection-controls.html#switches>
class Switch extends StatelessWidget {
@@ -215,7 +215,7 @@ class Switch extends StatelessWidget {
///
/// Defaults to [ColorScheme.secondary].
///
/// If [thumbColor] returns a non-null color in the [MaterialState.selected]
/// If [thumbColor] returns a non-null color in the [WidgetState.selected]
/// state, it will be used instead of this color.
final Color? activeColor;
@@ -225,7 +225,7 @@ class Switch extends StatelessWidget {
///
/// Defaults to [ColorScheme.secondary] with the opacity set at 50%.
///
/// If [trackColor] returns a non-null color in the [MaterialState.selected]
/// If [trackColor] returns a non-null color in the [WidgetState.selected]
/// state, it will be used instead of this color.
final Color? activeTrackColor;
@@ -275,22 +275,22 @@ class Switch extends StatelessWidget {
/// The color of this [Switch]'s thumb.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [thumbColor] based on the current
/// [MaterialState] of the [Switch], providing a different [Color] when it is
/// [MaterialState.disabled].
/// [WidgetState] of the [Switch], providing a different [Color] when it is
/// [WidgetState.disabled].
///
/// ```dart
/// Switch(
/// value: true,
/// onChanged: (bool value) { },
/// thumbColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// thumbColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withOpacity(.48);
/// }
/// return Colors.orange;
@@ -316,22 +316,22 @@ class Switch extends StatelessWidget {
/// The color of this [Switch]'s track.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [trackColor] based on the current
/// [MaterialState] of the [Switch], providing a different [Color] when it is
/// [MaterialState.disabled].
/// [WidgetState] of the [Switch], providing a different [Color] when it is
/// [WidgetState.disabled].
///
/// ```dart
/// Switch(
/// value: true,
/// onChanged: (bool value) { },
/// thumbColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// thumbColor: WidgetStateProperty.resolveWith<Color>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withOpacity(.48);
/// }
/// return Colors.orange;
@@ -357,22 +357,22 @@ class Switch extends StatelessWidget {
/// The outline color of this [Switch]'s track.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [trackOutlineColor] based on the current
/// [MaterialState] of the [Switch], providing a different [Color] when it is
/// [MaterialState.disabled].
/// [WidgetState] of the [Switch], providing a different [Color] when it is
/// [WidgetState.disabled].
///
/// ```dart
/// Switch(
/// value: true,
/// onChanged: (bool value) { },
/// trackOutlineColor: MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// trackOutlineColor: WidgetStateProperty.resolveWith<Color?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return Colors.orange.withOpacity(.48);
/// }
/// return null; // Use the default color.
@@ -391,22 +391,22 @@ class Switch extends StatelessWidget {
/// The outline width of this [Switch]'s track.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [trackOutlineWidth] based on the current
/// [MaterialState] of the [Switch], providing a different outline width when it is
/// [MaterialState.disabled].
/// [WidgetState] of the [Switch], providing a different outline width when it is
/// [WidgetState.disabled].
///
/// ```dart
/// Switch(
/// value: true,
/// onChanged: (bool value) { },
/// trackOutlineWidth: MaterialStateProperty.resolveWith<double?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// trackOutlineWidth: WidgetStateProperty.resolveWith<double?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return 5.0;
/// }
/// return null; // Use the default width.
@@ -423,22 +423,22 @@ class Switch extends StatelessWidget {
/// The icon to use on the thumb of this switch
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// {@tool snippet}
/// This example resolves the [thumbIcon] based on the current
/// [MaterialState] of the [Switch], providing a different [Icon] when it is
/// [MaterialState.disabled].
/// [WidgetState] of the [Switch], providing a different [Icon] when it is
/// [WidgetState.disabled].
///
/// ```dart
/// Switch(
/// value: true,
/// onChanged: (bool value) { },
/// thumbIcon: MaterialStateProperty.resolveWith<Icon?>((Set<MaterialState> states) {
/// if (states.contains(MaterialState.disabled)) {
/// thumbIcon: WidgetStateProperty.resolveWith<Icon?>((Set<WidgetState> states) {
/// if (states.contains(WidgetState.disabled)) {
/// return const Icon(Icons.close);
/// }
/// return null; // All other states will use the default thumbIcon.
@@ -477,28 +477,28 @@ class Switch extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
/// {@endtemplate}
///
/// If null, then the value of [SwitchThemeData.mouseCursor] is used. If that
/// is also null, then [MaterialStateMouseCursor.clickable] is used.
/// is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], a [MouseCursor] that implements
/// `MaterialStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], a [MouseCursor] that implements
/// `WidgetStateProperty` which is used in APIs that need to accept
/// either a [MouseCursor] or a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// The color for the button's [Material] when it has the input focus.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.focused]
/// If [overlayColor] returns a non-null color in the [WidgetState.focused]
/// state, it will be used instead.
///
/// If null, then the value of [SwitchThemeData.overlayColor] is used in the
@@ -508,7 +508,7 @@ class Switch extends StatelessWidget {
/// The color for the button's [Material] when a pointer is hovering over it.
///
/// If [overlayColor] returns a non-null color in the [MaterialState.hovered]
/// If [overlayColor] returns a non-null color in the [WidgetState.hovered]
/// state, it will be used instead.
///
/// If null, then the value of [SwitchThemeData.overlayColor] is used in the
@@ -520,10 +520,10 @@ class Switch extends StatelessWidget {
/// The color for the switch's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// {@endtemplate}
///
/// If null, then the value of [activeColor] with alpha

View File

@@ -333,9 +333,9 @@ class SwitchListTile extends StatelessWidget {
/// The color of this switch's thumb.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [activeColor] is used in the selected state
/// and [inactiveThumbColor] in the default state. If that is also null, then
@@ -346,9 +346,9 @@ class SwitchListTile extends StatelessWidget {
/// The color of this switch's track.
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [activeTrackColor] is used in the selected
/// state and [inactiveTrackColor] in the default state. If that is also null,
@@ -369,9 +369,9 @@ class SwitchListTile extends StatelessWidget {
/// The icon to use on the thumb of this switch
///
/// Resolved in the following states:
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [SwitchThemeData.thumbIcon] is used. If this is
/// also null, then the [Switch] does not have any icons on the thumb.
@@ -388,23 +388,23 @@ class SwitchListTile extends StatelessWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [MaterialState.disabled].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
/// * [WidgetState.disabled].
///
/// If null, then the value of [SwitchThemeData.mouseCursor] is used. If that
/// is also null, then [MaterialStateMouseCursor.clickable] is used.
/// is also null, then [WidgetStateMouseCursor.clickable] is used.
final MouseCursor? mouseCursor;
/// The color for the switch's [Material].
///
/// Resolves in the following states:
/// * [MaterialState.pressed].
/// * [MaterialState.selected].
/// * [MaterialState.hovered].
/// * [WidgetState.pressed].
/// * [WidgetState.selected].
/// * [WidgetState.hovered].
///
/// If null, then the value of [activeColor] with alpha [kRadialReactionAlpha]
/// and [hoverColor] is used in the pressed and hovered state. If that is also

View File

@@ -62,9 +62,9 @@ class TabBarTheme with Diagnosticable {
/// Overrides the default value for [TabBar.labelColor].
///
/// If [labelColor] is a [MaterialStateColor], then the effective color will
/// depend on the [MaterialState.selected] state, i.e. if the [Tab] is
/// selected or not. In case of unselected state, this [MaterialStateColor]'s
/// If [labelColor] is a [WidgetStateColor], then the effective color will
/// depend on the [WidgetState.selected] state, i.e. if the [Tab] is
/// selected or not. In case of unselected state, this [WidgetStateColor]'s
/// resolved color will be used even if [TabBar.unselectedLabelColor] or
/// [unselectedLabelColor] is non-null.
final Color? labelColor;

View File

@@ -1049,8 +1049,8 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// [TextTheme.bodyLarge] text color is used.
///
/// If [labelColor] (or, if null, [TabBarTheme.labelColor]) is a
/// [MaterialStateColor], then the effective tab color will depend on the
/// [MaterialState.selected] state, i.e. if the [Tab] is selected or not,
/// [WidgetStateColor], then the effective tab color will depend on the
/// [WidgetState.selected] state, i.e. if the [Tab] is selected or not,
/// ignoring [unselectedLabelColor] even if it's non-null.
///
/// When this color or the [TabBarTheme.labelColor] is specified, it overrides
@@ -1065,8 +1065,8 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// The color of unselected tab labels.
///
/// If [labelColor] (or, if null, [TabBarTheme.labelColor]) is a
/// [MaterialStateColor], then the unselected tabs are rendered with
/// that [MaterialStateColor]'s resolved color for unselected state, even if
/// [WidgetStateColor], then the unselected tabs are rendered with
/// that [WidgetStateColor]'s resolved color for unselected state, even if
/// [unselectedLabelColor] is non-null.
///
/// If null, then [TabBarTheme.unselectedLabelColor] is used. If that is also
@@ -1124,10 +1124,10 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// Defines the ink response focus, hover, and splash colors.
///
/// If non-null, it is resolved against one of [MaterialState.focused],
/// [MaterialState.hovered], and [MaterialState.pressed].
/// If non-null, it is resolved against one of [WidgetState.focused],
/// [WidgetState.hovered], and [WidgetState.pressed].
///
/// [MaterialState.pressed] triggers a ripple (an ink splash), per
/// [WidgetState.pressed] triggers a ripple (an ink splash), per
/// the current Material Design spec.
///
/// If the overlay color is null or resolves to null, then if [ThemeData.useMaterial3] is
@@ -1150,19 +1150,19 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// individual tab widgets.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.selected].
/// * [WidgetState.selected].
/// {@endtemplate}
///
/// If null, then the value of [TabBarTheme.mouseCursor] is used. If
/// that is also null, then [MaterialStateMouseCursor.clickable] is used.
/// that is also null, then [WidgetStateMouseCursor.clickable] is used.
///
/// See also:
///
/// * [MaterialStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [MaterialStateProperty<MouseCursor>].
/// * [WidgetStateMouseCursor], which can be used to create a [MouseCursor]
/// that is also a [WidgetStateProperty<MouseCursor>].
final MouseCursor? mouseCursor;
/// Whether detected gestures should provide acoustic and/or haptic feedback.
@@ -1202,9 +1202,9 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget {
/// ```dart
/// TabBar(
/// splashFactory: NoSplash.splashFactory,
/// overlayColor: MaterialStateProperty.resolveWith<Color?>(
/// (Set<MaterialState> states) {
/// return states.contains(MaterialState.focused) ? null : Colors.transparent;
/// overlayColor: WidgetStateProperty.resolveWith<Color?>(
/// (Set<WidgetState> states) {
/// return states.contains(WidgetState.focused) ? null : Colors.transparent;
/// },
/// ),
/// tabs: const <Widget>[

View File

@@ -59,7 +59,7 @@ import 'theme_data.dart';
///
/// {@tool dartpad}
/// This sample demonstrates using the [statesController] parameter to create a button
/// that adds support for [MaterialState.selected].
/// that adds support for [WidgetState.selected].
///
/// ** See code in examples/api/lib/material/text_button/text_button.1.dart **
/// {@end-tool}
@@ -150,11 +150,11 @@ class TextButton extends ButtonStyleButton {
/// [ButtonStyle] given simple values.
///
/// The [foregroundColor] and [disabledForegroundColor] colors are used
/// to create a [MaterialStateProperty] [ButtonStyle.foregroundColor], and
/// to create a [WidgetStateProperty] [ButtonStyle.foregroundColor], and
/// a derived [ButtonStyle.overlayColor] if [overlayColor] isn't specified.
///
/// The [backgroundColor] and [disabledBackgroundColor] colors are
/// used to create a [MaterialStateProperty] [ButtonStyle.backgroundColor].
/// used to create a [WidgetStateProperty] [ButtonStyle.backgroundColor].
///
/// Similarly, the [enabledMouseCursor] and [disabledMouseCursor]
/// parameters are used to construct [ButtonStyle.mouseCursor] and
@@ -163,11 +163,11 @@ class TextButton extends ButtonStyleButton {
///
/// If [overlayColor] is specified and its value is [Colors.transparent]
/// then the pressed/focused/hovered highlights are effectively defeated.
/// Otherwise a [MaterialStateProperty] with the same opacities as the
/// Otherwise a [WidgetStateProperty] with the same opacities as the
/// default is created.
///
/// All of the other parameters are either used directly or used to
/// create a [MaterialStateProperty] with a single value for all
/// create a [WidgetStateProperty] with a single value for all
/// states.
///
/// All parameters default to null. By default this method returns
@@ -278,7 +278,7 @@ class TextButton extends ButtonStyleButton {
/// In this list "Theme.foo" is shorthand for
/// `Theme.of(context).foo`. Color scheme values like
/// "onSurface(0.38)" are shorthand for
/// `onSurface.withOpacity(0.38)`. [MaterialStateProperty] valued
/// `onSurface.withOpacity(0.38)`. [WidgetStateProperty] valued
/// properties that are not followed by a sublist have the same
/// value for all states, otherwise the values are as specified for
/// each state and "others" means all other states.

View File

@@ -18,7 +18,7 @@ import 'theme.dart';
/// The [style]'s properties override [TextButton]'s default style,
/// i.e. the [ButtonStyle] returned by [TextButton.defaultStyleOf]. Only
/// the style's non-null property values or resolved non-null
/// [MaterialStateProperty] values are used.
/// [WidgetStateProperty] values are used.
///
/// See also:
///
@@ -27,8 +27,8 @@ import 'theme.dart';
/// for text buttons.
/// * [TextButton.styleFrom], which converts simple values into a
/// [ButtonStyle] that's consistent with [TextButton]'s defaults.
/// * [MaterialStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [MaterialState]s.
/// * [WidgetStateProperty.resolve], "resolve" a material state property
/// to a simple value based on a set of [WidgetState]s.
/// * [ThemeData.textButtonTheme], which can be used to override the default
/// [ButtonStyle] for [TextButton]s below the overall [Theme].
@immutable
@@ -40,7 +40,7 @@ class TextButtonThemeData with Diagnosticable {
/// Overrides for [TextButton]'s default style.
///
/// Non-null properties or non-null resolved [MaterialStateProperty]
/// Non-null properties or non-null resolved [WidgetStateProperty]
/// values override the [ButtonStyle] returned by
/// [TextButton.defaultStyleOf].
///

View File

@@ -468,23 +468,23 @@ class TextField extends StatefulWidget {
final bool autofocus;
/// Represents the interactive "state" of this widget in terms of a set of
/// [MaterialState]s, including [MaterialState.disabled], [MaterialState.hovered],
/// [MaterialState.error], and [MaterialState.focused].
/// [WidgetState]s, including [WidgetState.disabled], [WidgetState.hovered],
/// [WidgetState.error], and [WidgetState.focused].
///
/// Classes based on this one can provide their own
/// [MaterialStatesController] to which they've added listeners.
/// They can also update the controller's [MaterialStatesController.value]
/// [WidgetStatesController] to which they've added listeners.
/// They can also update the controller's [WidgetStatesController.value]
/// however, this may only be done when it's safe to call
/// [State.setState], like in an event handler.
///
/// The controller's [MaterialStatesController.value] represents the set of
/// states that a widget's visual properties, typically [MaterialStateProperty]
/// The controller's [WidgetStatesController.value] represents the set of
/// states that a widget's visual properties, typically [WidgetStateProperty]
/// values, are resolved against. It is _not_ the intrinsic state of the widget.
/// The widget is responsible for ensuring that the controller's
/// [MaterialStatesController.value] tracks its intrinsic state. For example
/// one cannot request the keyboard focus for a widget by adding [MaterialState.focused]
/// [WidgetStatesController.value] tracks its intrinsic state. For example
/// one cannot request the keyboard focus for a widget by adding [WidgetState.focused]
/// to its controller. When the widget gains the or loses the focus it will
/// [MaterialStatesController.update] its controller's [MaterialStatesController.value]
/// [WidgetStatesController.update] its controller's [WidgetStatesController.value]
/// and notify listeners of the change.
final MaterialStatesController? statesController;
@@ -733,15 +733,15 @@ class TextField extends StatefulWidget {
/// The cursor for a mouse pointer when it enters or is hovering over the
/// widget.
///
/// If [mouseCursor] is a [MaterialStateProperty<MouseCursor>],
/// [MaterialStateProperty.resolve] is used for the following [MaterialState]s:
/// If [mouseCursor] is a [WidgetStateProperty<MouseCursor>],
/// [WidgetStateProperty.resolve] is used for the following [WidgetState]s:
///
/// * [MaterialState.error].
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
/// * [WidgetState.error].
/// * [WidgetState.hovered].
/// * [WidgetState.focused].
/// * [WidgetState.disabled].
///
/// If this property is null, [MaterialStateMouseCursor.textable] will be used.
/// If this property is null, [WidgetStateMouseCursor.textable] will be used.
///
/// The [mouseCursor] is the only property of [TextField] that controls the
/// appearance of the mouse pointer. All other properties related to "cursor"

View File

@@ -94,8 +94,8 @@ class TimePickerThemeData with Diagnosticable {
/// The background color of the AM/PM toggle.
///
/// If [dayPeriodColor] is a [MaterialStateColor], then the effective
/// background color can depend on the [MaterialState.selected] state, i.e.
/// If [dayPeriodColor] is a [WidgetStateColor], then the effective
/// background color can depend on the [WidgetState.selected] state, i.e.
/// if the segment is selected or not.
///
/// By default, if the segment is selected, the overall theme's
@@ -135,8 +135,8 @@ class TimePickerThemeData with Diagnosticable {
/// The color of the day period text that represents AM/PM.
///
/// If [dayPeriodTextColor] is a [MaterialStateColor], then the effective
/// text color can depend on the [MaterialState.selected] state, i.e. if the
/// If [dayPeriodTextColor] is a [WidgetStateColor], then the effective
/// text color can depend on the [WidgetState.selected] state, i.e. if the
/// text is selected or not.
///
/// By default the overall theme's [ColorScheme.primary] color is used when
@@ -172,8 +172,8 @@ class TimePickerThemeData with Diagnosticable {
/// The color of the dial text that represents specific hours and minutes.
///
/// If [dialTextColor] is a [MaterialStateColor], then the effective
/// text color can depend on the [MaterialState.selected] state, i.e. if the
/// If [dialTextColor] is a [WidgetStateColor], then the effective
/// text color can depend on the [WidgetState.selected] state, i.e. if the
/// text is selected or not.
///
/// If this color is null then the dial's text colors are based on the
@@ -182,8 +182,8 @@ class TimePickerThemeData with Diagnosticable {
/// The [TextStyle] for the numbers on the time selection dial.
///
/// If [dialTextStyle]'s [TextStyle.color] is a [MaterialStateColor], then the
/// effective text color can depend on the [MaterialState.selected] state,
/// If [dialTextStyle]'s [TextStyle.color] is a [WidgetStateColor], then the
/// effective text color can depend on the [WidgetState.selected] state,
/// i.e. if the text is selected or not.
///
/// If this style is null then the dial's text style is based on the theme's
@@ -213,8 +213,8 @@ class TimePickerThemeData with Diagnosticable {
/// The background color of the hour and minute header segments.
///
/// If [hourMinuteColor] is a [MaterialStateColor], then the effective
/// background color can depend on the [MaterialState.selected] state, i.e.
/// If [hourMinuteColor] is a [WidgetStateColor], then the effective
/// background color can depend on the [WidgetState.selected] state, i.e.
/// if the segment is selected or not.
///
/// By default, if the segment is selected, the overall theme's
@@ -234,8 +234,8 @@ class TimePickerThemeData with Diagnosticable {
/// The color of the header text that represents hours and minutes.
///
/// If [hourMinuteTextColor] is a [MaterialStateColor], then the effective
/// text color can depend on the [MaterialState.selected] state, i.e. if the
/// If [hourMinuteTextColor] is a [WidgetStateColor], then the effective
/// text color can depend on the [WidgetState.selected] state, i.e. if the
/// text is selected or not.
///
/// By default the overall theme's [ColorScheme.primary] color is used when

View File

@@ -266,7 +266,7 @@ class ToggleButtons extends StatelessWidget {
/// {@macro flutter.material.RawMaterialButton.mouseCursor}
///
/// If this property is null, [MaterialStateMouseCursor.clickable] will be used.
/// If this property is null, [WidgetStateMouseCursor.clickable] will be used.
final MouseCursor? mouseCursor;
/// Configures the minimum size of the area within which the buttons may
@@ -334,11 +334,11 @@ class ToggleButtons extends StatelessWidget {
/// [ToggleButtonsThemeData.fillColor] is also null, then
/// the fill color is null.
///
/// If fillColor is a [MaterialStateProperty<Color>], then [MaterialStateProperty.resolve]
/// is used for the following [MaterialState]s:
/// If fillColor is a [WidgetStateProperty<Color>], then [WidgetStateProperty.resolve]
/// is used for the following [WidgetState]s:
///
/// * [MaterialState.disabled]
/// * [MaterialState.selected]
/// * [WidgetState.disabled]
/// * [WidgetState.selected]
///
final Color? fillColor;

View File

@@ -1127,7 +1127,7 @@ class RawScrollbar extends StatefulWidget {
/// {@endtemplate}
///
/// Subclass [Scrollbar] can hide and show the scrollbar thumb in response to
/// [MaterialState]s by using [ScrollbarThemeData.thumbVisibility].
/// [WidgetState]s by using [ScrollbarThemeData.thumbVisibility].
final bool? thumbVisibility;
/// The [OutlinedBorder] of the scrollbar's thumb.
@@ -1203,7 +1203,7 @@ class RawScrollbar extends StatefulWidget {
/// {@endtemplate}
///
/// Subclass [Scrollbar] can hide and show the scrollbar thumb in response to
/// [MaterialState]s by using [ScrollbarThemeData.trackVisibility].
/// [WidgetState]s by using [ScrollbarThemeData.trackVisibility].
final bool? trackVisibility;
/// The [Radius] of the scrollbar track's rounded rectangle corners.