mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add clarifying docs on MaterialButton.colorBrightness (#36202)
* Add clarifying docs on MaterialButton.colorBrightness
This commit is contained in:
parent
b2cc97013d
commit
598ecb324d
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user