Skip to content

Commit 72e409b

Browse files
committed
Address Wills comments
fix import fix usage code
1 parent b5ba17f commit 72e409b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/flutter/lib/src/material/button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import 'dart:math' as math;
77
import 'package:flutter/foundation.dart';
88
import 'package:flutter/gestures.dart';
99
import 'package:flutter/rendering.dart';
10-
import 'package:flutter/src/material/material_state.dart';
1110
import 'package:flutter/widgets.dart';
1211

1312
import 'button_theme.dart';
1413
import 'constants.dart';
1514
import 'ink_well.dart';
1615
import 'material.dart';
16+
import 'material_state.dart';
1717
import 'theme.dart';
1818
import 'theme_data.dart';
1919

packages/flutter/lib/src/material/material_state.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)