@@ -35,6 +35,15 @@ enum MaterialType {
35
35
button,
36
36
37
37
/// A transparent piece of material that draws ink splashes and highlights.
38
+ ///
39
+ /// While the material metaphor describes child widgets as printed on the
40
+ /// material itself and do not hide ink effects, in practice the [Material]
41
+ /// widget draws child widgets on top of the ink effects.
42
+ /// A [Material] with type transparency can be placed on top of opaque widgets
43
+ /// to show ink effects on top of them.
44
+ ///
45
+ /// Prefer using the [Ink] widget for showing ink effects on top of opaque
46
+ /// widgets.
38
47
transparency
39
48
}
40
49
@@ -76,6 +85,17 @@ abstract class MaterialInkController {
76
85
77
86
/// A piece of material.
78
87
///
88
+ /// The Material widget is responsible for:
89
+ ///
90
+ /// 1. Clipping: Material clips its widget sub-tree to the shape specified by
91
+ /// [type] and [borderRadius].
92
+ /// 2. Elevation: Material elevates its widget sub-tree on the Z axis by
93
+ /// [elevation] pixels, and draws the appropriate shadow.
94
+ /// 3. Ink effects: Material shows ink effects implemented by [InkFeature] s
95
+ /// like [InkSplash] and [InkHighlight] below its children.
96
+ ///
97
+ /// ## The Material Metaphor
98
+ ///
79
99
/// Material is the central metaphor in material design. Each piece of material
80
100
/// exists at a given elevation, which influences how that piece of material
81
101
/// visually relates to other pieces of material and how that material casts
@@ -86,9 +106,26 @@ abstract class MaterialInkController {
86
106
/// [InkSplash] and [InkHighlight] effects. To trigger a reaction on the
87
107
/// material, use a [MaterialInkController] obtained via [Material.of] .
88
108
///
89
- /// If a material has a non-zero [elevation] , then the material will clip its
90
- /// contents because content that is conceptually printing on a separate piece
91
- /// of material cannot be printed beyond the bounds of the material.
109
+ /// In general, the features of a [Material] should not change over time (e.g. a
110
+ /// [Material] should not change its [color] , [shadowColor] or [type] ). The one
111
+ /// exception is the [elevation] , changes to which will be animated.
112
+ ///
113
+ /// ## Shape
114
+ ///
115
+ /// The shape for material is determined by [type] and [borderRadius] .
116
+ ///
117
+ /// - If [borderRadius] is non null, the shape is a rounded rectangle, with
118
+ /// corners specified by [borderRadius].
119
+ /// - If [borderRadius] is null, [type] determines the shape as follows:
120
+ /// - [MaterialType.canvas]: the default material shape is a rectangle.
121
+ /// - [MaterialType.card]: the default material shape is a rectangle with
122
+ /// rounded edges. The edge radii is specified by [kMaterialEdges].
123
+ /// - [MaterialType.circle]: the default material shape is a circle.
124
+ /// - [MaterialType.button]: the default material shape is a rectangle with
125
+ /// rounded edges. The edge radii is specified by [kMaterialEdges].
126
+ /// - [MaterialType.transparency]: the default material shape is a rectangle.
127
+ ///
128
+ /// ## Layout change notifications
92
129
///
93
130
/// If the layout changes (e.g. because there's a list on the material, and it's
94
131
/// been scrolled), a [LayoutChangedNotification] must be dispatched at the
@@ -99,10 +136,6 @@ abstract class MaterialInkController {
99
136
/// features (e.g., ink splashes and ink highlights) won't move to account for
100
137
/// the new layout.
101
138
///
102
- /// In general, the features of a [Material] should not change over time (e.g. a
103
- /// [Material] should not change its [color] , [shadowColor] or [type] ). The one
104
- /// exception is the [elevation] , changes to which will be animated.
105
- ///
106
139
/// See also:
107
140
///
108
141
/// * [MergeableMaterial] , a piece of material that can split and remerge.
0 commit comments