Add clarifying docs on MaterialButton.colorBrightness (#36202)

* Add clarifying docs on MaterialButton.colorBrightness
This commit is contained in:
Shi-Hao Hong 2019-07-17 10:08:51 -07:00 committed by GitHub
parent b2cc97013d
commit 598ecb324d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 5 deletions

View File

@ -562,10 +562,11 @@ class ButtonThemeData extends Diagnosticable {
/// Otherwise the text color depends on the value of [getTextTheme]
/// and [getBrightness].
///
/// * [ButtonTextTheme.normal], [Colors.white] if [getBrightness] is dark,
/// otherwise [Colors.black87].
/// * ButtonTextTheme.accent], [colorScheme.secondary].
/// * [ButtonTextTheme.primary], if [getFillColor] is dark then [Colors.white],
/// * [ButtonTextTheme.normal]: [Colors.white] is used if [getBrightness]
/// resolves to [Brightness.dark]. [Colors.black87] is used if
/// [getBrightness] resolves to [Brightness.light].
/// * [ButtonTextTheme.accent]: [colorScheme.secondary].
/// * [ButtonTextTheme.primary]: If [getFillColor] is dark then [Colors.white],
/// otherwise if [button] is a [FlatButton] or an [OutlineButton] then
/// [colorScheme.primary], otherwise [Colors.black].
Color getTextColor(MaterialButton button) {

View File

@ -257,7 +257,13 @@ class MaterialButton extends StatelessWidget {
/// The theme brightness to use for this button.
///
/// Defaults to the theme's brightness, [ThemeData.brightness].
/// Defaults to the theme's brightness in [ThemeData.brightness]. Setting
/// this value determines the button text's colors based on
/// [ButtonThemeData.getTextColor].
///
/// See also:
///
/// * [ButtonTextTheme], uses [Brightness] to determine text color.
final Brightness colorBrightness;
/// The button's label.