MaterialStateProperty Docs (#96532)
diff --git a/packages/flutter/lib/src/material/checkbox.dart b/packages/flutter/lib/src/material/checkbox.dart
index d209dc1..c1d21f0 100644
--- a/packages/flutter/lib/src/material/checkbox.dart
+++ b/packages/flutter/lib/src/material/checkbox.dart
@@ -161,6 +161,25 @@
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
+ ///
+ /// {@tool snippet}
+ /// This example resolves the [fillColor] based on the current [MaterialState]
+ /// of the [Checkbox], providing a different [Color] when it is
+ /// [MaterialState.disabled].
+ ///
+ /// ```dart
+ /// Checkbox(
+ /// value: true,
+ /// onChanged: (_){},
+ /// fillColor: MaterialStateProperty.resolveWith<Color>((states) {
+ /// if (states.contains(MaterialState.disabled)) {
+ /// return Colors.orange.withOpacity(.32);
+ /// }
+ /// return Colors.orange;
+ /// })
+ /// )
+ /// ```
+ /// {@end-tool}
/// {@endtemplate}
///
/// If null, then the value of [activeColor] is used in the selected
diff --git a/packages/flutter/lib/src/material/radio.dart b/packages/flutter/lib/src/material/radio.dart
index d320f0d..444a1bc 100644
--- a/packages/flutter/lib/src/material/radio.dart
+++ b/packages/flutter/lib/src/material/radio.dart
@@ -189,6 +189,26 @@
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.disabled].
+ ///
+ /// {@tool snippet}
+ /// This example resolves the [fillColor] based on the current [MaterialState]
+ /// of the [Radio], providing a different [Color] when it is
+ /// [MaterialState.disabled].
+ ///
+ /// ```dart
+ /// Radio<int>(
+ /// value: 1,
+ /// groupValue: 1,
+ /// onChanged: (_){},
+ /// fillColor: MaterialStateProperty.resolveWith<Color>((states) {
+ /// if (states.contains(MaterialState.disabled)) {
+ /// return Colors.orange.withOpacity(.32);
+ /// }
+ /// return Colors.orange;
+ /// })
+ /// )
+ /// ```
+ /// {@end-tool}
/// {@endtemplate}
///
/// If null, then the value of [activeColor] is used in the selected state. If
diff --git a/packages/flutter/lib/src/material/switch.dart b/packages/flutter/lib/src/material/switch.dart
index b3eb1c8..6a71b7f 100644
--- a/packages/flutter/lib/src/material/switch.dart
+++ b/packages/flutter/lib/src/material/switch.dart
@@ -229,6 +229,25 @@
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.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].
+ ///
+ /// ```dart
+ /// Switch(
+ /// value: true,
+ /// onChanged: (_) => true,
+ /// thumbColor: MaterialStateProperty.resolveWith<Color>((states) {
+ /// if (states.contains(MaterialState.disabled)) {
+ /// return Colors.orange.withOpacity(.48);
+ /// }
+ /// return Colors.orange;
+ /// }),
+ /// )
+ /// ```
+ /// {@end-tool}
/// {@endtemplate}
///
/// If null, then the value of [activeColor] is used in the selected
@@ -251,6 +270,25 @@
/// * [MaterialState.hovered].
/// * [MaterialState.focused].
/// * [MaterialState.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].
+ ///
+ /// ```dart
+ /// Switch(
+ /// value: true,
+ /// onChanged: (_) => true,
+ /// thumbColor: MaterialStateProperty.resolveWith<Color>((states) {
+ /// if (states.contains(MaterialState.disabled)) {
+ /// return Colors.orange.withOpacity(.48);
+ /// }
+ /// return Colors.orange;
+ /// }),
+ /// )
+ /// ```
+ /// {@end-tool}
/// {@endtemplate}
///
/// If null, then the value of [activeTrackColor] is used in the selected