@@ -68,7 +68,7 @@ typedef MaterialStateColorResolver = Color Function(Set<MaterialState> states);
6868/// Defines a [Color] whose value depends on changes in the state of a Material
6969/// component, based on a given set of [MaterialState] s.
7070///
71- /// This is useful for preserving the accessibility of text in different states
71+ /// This is useful for improving the accessibility of text in different states
7272/// of a component. For example, in a [FlatButton] with blue text, the text will
7373/// become more difficult to read when the button is hovered, focused, or pressed,
7474/// because the contrast ratio between the button and the text will decrease. To
@@ -87,10 +87,10 @@ typedef MaterialStateColorResolver = Color Function(Set<MaterialState> states);
8787///
8888/// This example shows how you could pass a `MaterialStateColor` to `FlatButton.textColor` .
8989/// Here, the text color will be `Colors.blue[900]` when the button is being
90- /// pressed, hovered, or focused. Otherwise, the text color will be `Colors.blue[900 ]` .
90+ /// pressed, hovered, or focused. Otherwise, the text color will be `Colors.blue[600 ]` .
9191///
9292/// ```dart
93- /// Color getTextColor(Set<MaterialSet > states) {
93+ /// Color getTextColor(Set<MaterialState > states) {
9494/// final Set<MaterialState> interactiveStates = <MaterialState>{
9595/// MaterialState.pressed,
9696/// MaterialState.hovered,
@@ -103,7 +103,8 @@ typedef MaterialStateColorResolver = Color Function(Set<MaterialState> states);
103103/// }
104104///
105105/// FlatButton(
106- /// ...
106+ /// child: Text('FlatButton'),
107+ /// onPressed: () {},
107108/// textColor: MaterialStateColor.resolveWith(getTextColor),
108109/// ),
109110/// ```
0 commit comments