Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4d5c0264
Unverified
Commit
4d5c0264
authored
Jan 13, 2022
by
Kate Lovett
Committed by
GitHub
Jan 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MaterialStateProperty Docs (#96532)
parent
177cfc49
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
0 deletions
+77
-0
checkbox.dart
packages/flutter/lib/src/material/checkbox.dart
+19
-0
radio.dart
packages/flutter/lib/src/material/radio.dart
+20
-0
switch.dart
packages/flutter/lib/src/material/switch.dart
+38
-0
No files found.
packages/flutter/lib/src/material/checkbox.dart
View file @
4d5c0264
...
...
@@ -161,6 +161,25 @@ class Checkbox extends StatefulWidget {
/// * [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
...
...
packages/flutter/lib/src/material/radio.dart
View file @
4d5c0264
...
...
@@ -189,6 +189,26 @@ class Radio<T> extends StatefulWidget {
/// * [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
...
...
packages/flutter/lib/src/material/switch.dart
View file @
4d5c0264
...
...
@@ -229,6 +229,25 @@ class Switch extends StatelessWidget {
/// * [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 @@ class Switch extends StatelessWidget {
/// * [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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment