Unverified Commit 598ecb32 authored by Shi-Hao Hong's avatar Shi-Hao Hong Committed by GitHub

Add clarifying docs on MaterialButton.colorBrightness (#36202)

* Add clarifying docs on MaterialButton.colorBrightness
parent b2cc9701
......@@ -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) {
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment