Commit 65cb3ee7 authored by Adam Barth's avatar Adam Barth

Add dartdoc for child widgets

This patch adds a consistent, simple description for the common pattern of
having a single child widget.
parent f0866572
...@@ -50,9 +50,13 @@ abstract class MaterialButton extends StatefulWidget { ...@@ -50,9 +50,13 @@ abstract class MaterialButton extends StatefulWidget {
this.onPressed this.onPressed
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final ButtonColor textTheme; final ButtonColor textTheme;
final Color textColor; final Color textColor;
final Color disabledTextColor; final Color disabledTextColor;
/// The callback that is invoked when the button is tapped or otherwise activated. /// The callback that is invoked when the button is tapped or otherwise activated.
......
...@@ -14,7 +14,10 @@ const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0); ...@@ -14,7 +14,10 @@ const EdgeInsets _kCardMargins = const EdgeInsets.all(4.0);
class Card extends StatelessWidget { class Card extends StatelessWidget {
const Card({ Key key, this.child, this.color }) : super(key: key); const Card({ Key key, this.child, this.color }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The color of material used for this card.
final Color color; final Color color;
@override @override
......
...@@ -23,6 +23,7 @@ class CircleAvatar extends StatelessWidget { ...@@ -23,6 +23,7 @@ class CircleAvatar extends StatelessWidget {
this.radius: 40.0 this.radius: 40.0
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The color with which to fill the circle. Changing the background /// The color with which to fill the circle. Changing the background
......
...@@ -34,6 +34,8 @@ class Drawer extends StatelessWidget { ...@@ -34,6 +34,8 @@ class Drawer extends StatelessWidget {
}) : super(key: key); }) : super(key: key);
final int elevation; final int elevation;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -14,6 +14,7 @@ import 'theme.dart'; ...@@ -14,6 +14,7 @@ import 'theme.dart';
class DrawerHeader extends StatelessWidget { class DrawerHeader extends StatelessWidget {
const DrawerHeader({ Key key, this.child }) : super(key: key); const DrawerHeader({ Key key, this.child }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -20,9 +20,14 @@ class DrawerItem extends StatelessWidget { ...@@ -20,9 +20,14 @@ class DrawerItem extends StatelessWidget {
this.selected: false this.selected: false
}) : super(key: key); }) : super(key: key);
/// The icon to display before the child widget.
final IconData icon; final IconData icon;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final VoidCallback onPressed; final VoidCallback onPressed;
final bool selected; final bool selected;
Color _getIconColor(ThemeData themeData) { Color _getIconColor(ThemeData themeData) {
......
...@@ -219,7 +219,12 @@ class DropDownMenuItem<T> extends StatelessWidget { ...@@ -219,7 +219,12 @@ class DropDownMenuItem<T> extends StatelessWidget {
this.child this.child
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The value to return if the user selects this menu item.
///
/// Eventually returned in a call to [DropDownButton.onChanged].
final T value; final T value;
@override @override
......
...@@ -44,16 +44,25 @@ class FloatingActionButton extends StatefulWidget { ...@@ -44,16 +44,25 @@ class FloatingActionButton extends StatefulWidget {
this.mini: false this.mini: false
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final String tooltip; final String tooltip;
/// The color to use when filling the button.
///
/// Defaults to the accent color of the current theme.
final Color backgroundColor; final Color backgroundColor;
/// The callback that is invoked when the button is tapped or otherwise activated. /// The callback that is invoked when the button is tapped or otherwise activated.
/// ///
/// If this is set to null, the button will be disabled. /// If this is set to null, the button will be disabled.
final VoidCallback onPressed; final VoidCallback onPressed;
final int elevation; final int elevation;
final int highlightElevation; final int highlightElevation;
final bool mini; final bool mini;
@override @override
......
...@@ -11,8 +11,13 @@ class GridTile extends StatelessWidget { ...@@ -11,8 +11,13 @@ class GridTile extends StatelessWidget {
assert(child != null); assert(child != null);
} }
/// The widget to show over the top of this grid tile.
final Widget header; final Widget header;
/// The widget to show over the bottom of this grid tile.
final Widget footer; final Widget footer;
/// The widget that fills the tile.
final Widget child; final Widget child;
@override @override
......
...@@ -36,12 +36,19 @@ class InkResponse extends StatefulWidget { ...@@ -36,12 +36,19 @@ class InkResponse extends StatefulWidget {
this.highlightShape: BoxShape.circle this.highlightShape: BoxShape.circle
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final GestureTapCallback onTap; final GestureTapCallback onTap;
final GestureTapCallback onDoubleTap; final GestureTapCallback onDoubleTap;
final GestureLongPressCallback onLongPress; final GestureLongPressCallback onLongPress;
final ValueChanged<bool> onHighlightChanged; final ValueChanged<bool> onHighlightChanged;
final bool containedInWell; final bool containedInWell;
final BoxShape highlightShape; final BoxShape highlightShape;
@override @override
......
...@@ -86,10 +86,15 @@ class Material extends StatefulWidget { ...@@ -86,10 +86,15 @@ class Material extends StatefulWidget {
assert(elevation != null); assert(elevation != null);
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final MaterialType type; final MaterialType type;
final int elevation; final int elevation;
final Color color; final Color color;
final TextStyle textStyle; final TextStyle textStyle;
/// The ink controller from the closest instance of this class that encloses the given context. /// The ink controller from the closest instance of this class that encloses the given context.
......
...@@ -65,6 +65,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> { ...@@ -65,6 +65,7 @@ class PopupMenuItem<T> extends PopupMenuEntry<T> {
@override @override
final bool enabled; final bool enabled;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -395,10 +396,16 @@ class PopupMenuButton<T> extends StatefulWidget { ...@@ -395,10 +396,16 @@ class PopupMenuButton<T> extends StatefulWidget {
}) : super(key: key); }) : super(key: key);
final List<PopupMenuEntry<T>> items; final List<PopupMenuEntry<T>> items;
final T initialValue; final T initialValue;
final PopupMenuItemSelected<T> onSelected; final PopupMenuItemSelected<T> onSelected;
final String tooltip; final String tooltip;
final int elevation; final int elevation;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -429,8 +429,12 @@ class TabBarSelection<T> extends StatefulWidget { ...@@ -429,8 +429,12 @@ class TabBarSelection<T> extends StatefulWidget {
} }
final T value; final T value;
List<T> values; List<T> values;
final ValueChanged<T> onChanged; final ValueChanged<T> onChanged;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -66,8 +66,10 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget { ...@@ -66,8 +66,10 @@ class AnimatedTheme extends ImplicitlyAnimatedWidget {
assert(data != null); assert(data != null);
} }
/// Specifies the color and typography values for descendant widgets.
final ThemeData data; final ThemeData data;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -50,18 +50,32 @@ class Tooltip extends StatefulWidget { ...@@ -50,18 +50,32 @@ class Tooltip extends StatefulWidget {
} }
final String message; final String message;
final Color backgroundColor; final Color backgroundColor;
final Color textColor; final Color textColor;
final TextStyle style; final TextStyle style;
final double opacity; final double opacity;
final double borderRadius; final double borderRadius;
final double height; final double height;
final EdgeInsets padding; final EdgeInsets padding;
final double verticalOffset; final double verticalOffset;
final EdgeInsets screenEdgeMargin; final EdgeInsets screenEdgeMargin;
final bool preferBelow; final bool preferBelow;
final Duration fadeDuration; final Duration fadeDuration;
final Duration showDuration; final Duration showDuration;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -206,8 +206,12 @@ class AssetVendor extends StatefulWidget { ...@@ -206,8 +206,12 @@ class AssetVendor extends StatefulWidget {
}) : super(key: key); }) : super(key: key);
final AssetBundle bundle; final AssetBundle bundle;
final double devicePixelRatio; final double devicePixelRatio;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final ImageDecoder imageDecoder; final ImageDecoder imageDecoder;
@override @override
......
...@@ -971,7 +971,7 @@ class Container extends StatelessWidget { ...@@ -971,7 +971,7 @@ class Container extends StatelessWidget {
assert(decoration == null || decoration.debugAssertValid()); assert(decoration == null || decoration.debugAssertValid());
} }
/// The child to contain in the container. /// The child contained by the container.
/// ///
/// If null, the container will expand to fill all available space in its parent. /// If null, the container will expand to fill all available space in its parent.
final Widget child; final Widget child;
...@@ -2502,6 +2502,7 @@ class KeyedSubtree extends StatelessWidget { ...@@ -2502,6 +2502,7 @@ class KeyedSubtree extends StatelessWidget {
KeyedSubtree({ Key key, this.child }) KeyedSubtree({ Key key, this.child })
: super(key: key); : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -189,8 +189,11 @@ class RenderObjectToWidgetAdapter<T extends RenderObject> extends RenderObjectWi ...@@ -189,8 +189,11 @@ class RenderObjectToWidgetAdapter<T extends RenderObject> extends RenderObjectWi
this.debugShortDescription this.debugShortDescription
}) : container = container, super(key: new GlobalObjectKey(container)); }) : container = container, super(key: new GlobalObjectKey(container));
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final RenderObjectWithChildMixin<T> container; final RenderObjectWithChildMixin<T> container;
final String debugShortDescription; final String debugShortDescription;
@override @override
......
...@@ -60,6 +60,7 @@ class CheckedModeBanner extends StatelessWidget { ...@@ -60,6 +60,7 @@ class CheckedModeBanner extends StatelessWidget {
this.child this.child
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -68,6 +68,7 @@ class Dismissable extends StatefulWidget { ...@@ -68,6 +68,7 @@ class Dismissable extends StatefulWidget {
assert(secondaryBackground != null ? background != null : true); assert(secondaryBackground != null ? background != null : true);
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// A widget that is stacked behind the child. If secondaryBackground is also /// A widget that is stacked behind the child. If secondaryBackground is also
......
...@@ -53,6 +53,8 @@ abstract class DraggableBase<T> extends StatefulWidget { ...@@ -53,6 +53,8 @@ abstract class DraggableBase<T> extends StatefulWidget {
} }
final T data; final T data;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The widget to show instead of [child] when a drag is under way. /// The widget to show instead of [child] when a drag is under way.
......
...@@ -101,6 +101,7 @@ class Focus extends StatefulWidget { ...@@ -101,6 +101,7 @@ class Focus extends StatefulWidget {
assert(key != null); assert(key != null);
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The key that currently has focus globally in the entire focus tree. /// The key that currently has focus globally in the entire focus tree.
......
...@@ -554,6 +554,7 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget { ...@@ -554,6 +554,7 @@ abstract class LeafRenderObjectWidget extends RenderObjectWidget {
abstract class SingleChildRenderObjectWidget extends RenderObjectWidget { abstract class SingleChildRenderObjectWidget extends RenderObjectWidget {
const SingleChildRenderObjectWidget({ Key key, this.child }) : super(key: key); const SingleChildRenderObjectWidget({ Key key, this.child }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -97,6 +97,7 @@ class GestureDetector extends StatelessWidget { ...@@ -97,6 +97,7 @@ class GestureDetector extends StatelessWidget {
}); });
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// A pointer that might cause a tap has contacted the screen at a particular /// A pointer that might cause a tap has contacted the screen at a particular
...@@ -289,6 +290,7 @@ class RawGestureDetector extends StatefulWidget { ...@@ -289,6 +290,7 @@ class RawGestureDetector extends StatefulWidget {
assert(excludeFromSemantics != null); assert(excludeFromSemantics != null);
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final Map<Type, GestureRecognizerFactory> gestures; final Map<Type, GestureRecognizerFactory> gestures;
......
...@@ -71,6 +71,7 @@ class GridPaper extends StatelessWidget { ...@@ -71,6 +71,7 @@ class GridPaper extends StatelessWidget {
/// The number of minor divisions within each major division. /// The number of minor divisions within each major division.
final int subDivisions; final int subDivisions;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -88,7 +88,10 @@ class Hero extends StatefulWidget { ...@@ -88,7 +88,10 @@ class Hero extends StatefulWidget {
} }
final Object tag; final Object tag;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
final int turns; final int turns;
/// If true, the hero will always animate, even if it has no matching hero to /// If true, the hero will always animate, even if it has no matching hero to
......
...@@ -206,6 +206,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget { ...@@ -206,6 +206,7 @@ class AnimatedContainer extends ImplicitlyAnimatedWidget {
assert(padding == null || padding.isNonNegative); assert(padding == null || padding.isNonNegative);
} }
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// Additional constraints to apply to the child. /// Additional constraints to apply to the child.
...@@ -352,6 +353,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget { ...@@ -352,6 +353,7 @@ class AnimatedPositioned extends ImplicitlyAnimatedWidget {
bottom = null, bottom = null,
super(key: key, curve: curve, duration: duration); super(key: key, curve: curve, duration: duration);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The offset of the child's left edge from the left of the stack. /// The offset of the child's left edge from the left of the stack.
......
...@@ -144,6 +144,7 @@ class Mimic extends StatelessWidget { ...@@ -144,6 +144,7 @@ class Mimic extends StatelessWidget {
class Mimicable extends StatefulWidget { class Mimicable extends StatefulWidget {
Mimicable({ Key key, this.child }) : super(key: key); Mimicable({ Key key, this.child }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -31,6 +31,7 @@ class NotificationListener<T extends Notification> extends StatelessWidget { ...@@ -31,6 +31,7 @@ class NotificationListener<T extends Notification> extends StatelessWidget {
this.onNotification this.onNotification
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// Called when a notification of the appropriate type arrives at this location in the tree. /// Called when a notification of the appropriate type arrives at this location in the tree.
......
...@@ -96,6 +96,7 @@ class PageStorage extends StatelessWidget { ...@@ -96,6 +96,7 @@ class PageStorage extends StatelessWidget {
this.bucket this.bucket
}) : super(key: key); }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
/// The page storage bucket to use for this subtree. /// The page storage bucket to use for this subtree.
......
...@@ -20,7 +20,10 @@ class RawKeyboardListener extends StatefulWidget { ...@@ -20,7 +20,10 @@ class RawKeyboardListener extends StatefulWidget {
} }
final bool focused; final bool focused;
final ValueChanged<mojom.InputEvent> onKey; final ValueChanged<mojom.InputEvent> onKey;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -630,6 +630,7 @@ class ScrollableViewport extends Scrollable { ...@@ -630,6 +630,7 @@ class ScrollableViewport extends Scrollable {
onScrollEnd: onScrollEnd onScrollEnd: onScrollEnd
); );
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -18,6 +18,7 @@ import 'gesture_detector.dart'; ...@@ -18,6 +18,7 @@ import 'gesture_detector.dart';
class SemanticsDebugger extends StatefulWidget { class SemanticsDebugger extends StatefulWidget {
const SemanticsDebugger({ Key key, this.child }) : super(key: key); const SemanticsDebugger({ Key key, this.child }) : super(key: key);
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -22,6 +22,7 @@ class Title extends StatelessWidget { ...@@ -22,6 +22,7 @@ class Title extends StatelessWidget {
/// A color that the window manager should use to identify this app. /// A color that the window manager should use to identify this app.
final Color color; final Color color;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
...@@ -103,6 +103,7 @@ class SlideTransition extends AnimatedWidget { ...@@ -103,6 +103,7 @@ class SlideTransition extends AnimatedWidget {
/// location and you want the user to benefit from "muscle memory". /// location and you want the user to benefit from "muscle memory".
final bool transformHitTests; final bool transformHitTests;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -137,6 +138,7 @@ class ScaleTransition extends AnimatedWidget { ...@@ -137,6 +138,7 @@ class ScaleTransition extends AnimatedWidget {
/// an alignment of (0.5, 1.0). /// an alignment of (0.5, 1.0).
final FractionalOffset alignment; final FractionalOffset alignment;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -166,6 +168,7 @@ class RotationTransition extends AnimatedWidget { ...@@ -166,6 +168,7 @@ class RotationTransition extends AnimatedWidget {
/// rotated v * 2 * pi radians before being painted. /// rotated v * 2 * pi radians before being painted.
final Animation<double> turns; final Animation<double> turns;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -203,6 +206,7 @@ class SizeTransition extends AnimatedWidget { ...@@ -203,6 +206,7 @@ class SizeTransition extends AnimatedWidget {
/// How to align the child along the axis that sizeFactor is modifying. /// How to align the child along the axis that sizeFactor is modifying.
final double axisAlignment; final double axisAlignment;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -239,6 +243,7 @@ class FadeTransition extends AnimatedWidget { ...@@ -239,6 +243,7 @@ class FadeTransition extends AnimatedWidget {
/// completely transparent. /// completely transparent.
final Animation<double> opacity; final Animation<double> opacity;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
...@@ -277,6 +282,7 @@ class PositionedTransition extends AnimatedWidget { ...@@ -277,6 +282,7 @@ class PositionedTransition extends AnimatedWidget {
/// The animation that controls the child's size and position. /// The animation that controls the child's size and position.
final Animation<RelativeRect> rect; final Animation<RelativeRect> rect;
/// The widget below this widget in the tree.
final Widget child; final Widget child;
@override @override
......
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