Explain MaterialColor's constructor better. (#14407)
Fixes https://github.com/flutter/flutter/issues/14393
This commit is contained in:
parent
c02b6a8bcf
commit
21ee1a25fd
@ -17,6 +17,11 @@ import 'package:flutter/painting.dart';
|
|||||||
/// * [Colors], which defines all of the standard material colors.
|
/// * [Colors], which defines all of the standard material colors.
|
||||||
class MaterialColor extends ColorSwatch<int> {
|
class MaterialColor extends ColorSwatch<int> {
|
||||||
/// Creates a color swatch with a variety of shades.
|
/// Creates a color swatch with a variety of shades.
|
||||||
|
///
|
||||||
|
/// The `primary` argument should be the 32 bit ARGB value of one of the
|
||||||
|
/// values in the swatch, as would be passed to the [new Color] constructor
|
||||||
|
/// for that same color, and as is exposed by [value]. (This is distinct from
|
||||||
|
/// the specific index of the color in the swatch.)
|
||||||
const MaterialColor(int primary, Map<int, Color> swatch) : super(primary, swatch);
|
const MaterialColor(int primary, Map<int, Color> swatch) : super(primary, swatch);
|
||||||
|
|
||||||
/// The lightest shade.
|
/// The lightest shade.
|
||||||
|
@ -205,6 +205,11 @@ class HSVColor {
|
|||||||
/// * [material.Colors], which defines all of the standard material design colors.
|
/// * [material.Colors], which defines all of the standard material design colors.
|
||||||
class ColorSwatch<T> extends Color {
|
class ColorSwatch<T> extends Color {
|
||||||
/// Creates a color that has a small table of related colors called a "swatch".
|
/// Creates a color that has a small table of related colors called a "swatch".
|
||||||
|
///
|
||||||
|
/// The `primary` argument should be the 32 bit ARGB value of one of the
|
||||||
|
/// values in the swatch, as would be passed to the [new Color] constructor
|
||||||
|
/// for that same color, and as is exposed by [value]. (This is distinct from
|
||||||
|
/// the specific index of the color in the swatch.)
|
||||||
const ColorSwatch(int primary, this._swatch) : super(primary);
|
const ColorSwatch(int primary, this._swatch) : super(primary);
|
||||||
|
|
||||||
@protected
|
@protected
|
||||||
|
Loading…
x
Reference in New Issue
Block a user