Commit 35d5b73a authored by Adam Barth's avatar Adam Barth

Add review feedback to dartdocs

parent cf80b905
...@@ -23,6 +23,7 @@ import 'toggleable.dart'; ...@@ -23,6 +23,7 @@ import 'toggleable.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [Radio] /// * [Radio]
/// * [Switch] /// * [Switch]
/// * [Slider] /// * [Slider]
...@@ -40,15 +41,21 @@ class Checkbox extends StatelessWidget { ...@@ -40,15 +41,21 @@ class Checkbox extends StatelessWidget {
this.onChanged this.onChanged
}) : super(key: key); }) : super(key: key);
/// Whether this checkbox is checked or unchecked. /// Whether this checkbox is checked.
final bool value; final bool value;
/// The color to use when this checkbox is checked. /// The color to use when this checkbox is checked.
/// ///
/// Defaults to accent color of the current theme. /// Defaults to accent color of the current [Theme].
final Color activeColor; final Color activeColor;
/// Called when the user checks or unchecks the checkbox. /// Called when the user checks or unchecks the checkbox.
///
/// The checkbox passes the new value to the callback but does not actually
/// change state until the parent widget rebuilds the checkbox with the new
/// value.
///
/// If null, the checkbox will be displayed as disabled.
final ValueChanged<bool> onChanged; final ValueChanged<bool> onChanged;
@override @override
......
...@@ -31,6 +31,7 @@ const TextStyle _kLabelStyle = const TextStyle( ...@@ -31,6 +31,7 @@ const TextStyle _kLabelStyle = const TextStyle(
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [CircleAvatar] /// * [CircleAvatar]
/// * https://www.google.com/design/spec/components/chips.html /// * https://www.google.com/design/spec/components/chips.html
class Chip extends StatelessWidget { class Chip extends StatelessWidget {
...@@ -53,7 +54,7 @@ class Chip extends StatelessWidget { ...@@ -53,7 +54,7 @@ class Chip extends StatelessWidget {
/// Called when the user deletes the chip, e.g., by tapping the delete button. /// Called when the user deletes the chip, e.g., by tapping the delete button.
/// ///
/// The delete button is included in the ship only if this callback is non-null. /// The delete button is included in the chip only if this callback is non-null.
final VoidCallback onDeleted; final VoidCallback onDeleted;
@override @override
......
...@@ -14,6 +14,7 @@ import 'theme.dart'; ...@@ -14,6 +14,7 @@ import 'theme.dart';
/// always be paired with the same background color, for consistency. /// always be paired with the same background color, for consistency.
/// ///
/// See also: /// See also:
///
/// * [Chip] /// * [Chip]
/// * [ListItem] /// * [ListItem]
/// * <https://www.google.com/design/spec/components/chips.html#chips-contact-chips> /// * <https://www.google.com/design/spec/components/chips.html#chips-contact-chips>
......
...@@ -25,6 +25,7 @@ enum _DatePickerMode { day, year } ...@@ -25,6 +25,7 @@ enum _DatePickerMode { day, year }
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [showDatePicker] /// * [showDatePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers>
class DatePicker extends StatefulWidget { class DatePicker extends StatefulWidget {
...@@ -192,6 +193,7 @@ class _DatePickerHeader extends StatelessWidget { ...@@ -192,6 +193,7 @@ class _DatePickerHeader extends StatelessWidget {
/// Part of the material design [DatePicker]. /// Part of the material design [DatePicker].
/// ///
/// See also: /// See also:
///
/// * [DatePicker]. /// * [DatePicker].
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers>
class DayPicker extends StatelessWidget { class DayPicker extends StatelessWidget {
...@@ -320,6 +322,7 @@ class DayPicker extends StatelessWidget { ...@@ -320,6 +322,7 @@ class DayPicker extends StatelessWidget {
/// Part of the material design [DatePicker]. /// Part of the material design [DatePicker].
/// ///
/// See also: /// See also:
///
/// * [DatePicker] /// * [DatePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers>
class MonthPicker extends StatefulWidget { class MonthPicker extends StatefulWidget {
...@@ -432,6 +435,7 @@ class _MonthPickerState extends State<MonthPicker> { ...@@ -432,6 +435,7 @@ class _MonthPickerState extends State<MonthPicker> {
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [DatePicker] /// * [DatePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers>
class YearPicker extends StatefulWidget { class YearPicker extends StatefulWidget {
......
...@@ -85,6 +85,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> { ...@@ -85,6 +85,7 @@ class _DatePickerDialogState extends State<_DatePickerDialog> {
/// the initialDate. /// the initialDate.
/// ///
/// See also: /// See also:
///
/// * [DatePicker] /// * [DatePicker]
/// * [showTimePicker] /// * [showTimePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-date-pickers>
......
...@@ -30,10 +30,13 @@ const Duration _kBaseSettleDuration = const Duration(milliseconds: 246); ...@@ -30,10 +30,13 @@ const Duration _kBaseSettleDuration = const Duration(milliseconds: 246);
/// ///
/// Typically used in the [Scaffold.drawer] property, a drawer slides in from /// Typically used in the [Scaffold.drawer] property, a drawer slides in from
/// the side of the screen and displays a list of items that the user can /// the side of the screen and displays a list of items that the user can
/// interact with. The top-most item in a drawer is typically a [DrawerHeader] /// interact with.
/// that displays status information about the current user. ///
/// Typically, the child of the drawer is a [Block] whose first child is a
/// [DrawerHeader] that displays status information about the current user.
/// ///
/// See also: /// See also:
///
/// * [Scaffold.drawer] /// * [Scaffold.drawer]
/// * [DrawerItem] /// * [DrawerItem]
/// * [DrawerHeader] /// * [DrawerHeader]
...@@ -49,6 +52,8 @@ class Drawer extends StatelessWidget { ...@@ -49,6 +52,8 @@ class Drawer extends StatelessWidget {
final int elevation; final int elevation;
/// The widget below this widget in the tree. /// The widget below this widget in the tree.
///
/// Typically a [Block].
final Widget child; final Widget child;
@override @override
...@@ -69,6 +74,7 @@ class Drawer extends StatelessWidget { ...@@ -69,6 +74,7 @@ class Drawer extends StatelessWidget {
/// widgets. /// widgets.
/// ///
/// See also: /// See also:
///
/// * [Drawer] /// * [Drawer]
/// * [Scaffold.drawer] /// * [Scaffold.drawer]
class DrawerController extends StatefulWidget { class DrawerController extends StatefulWidget {
......
...@@ -15,6 +15,7 @@ import 'theme.dart'; ...@@ -15,6 +15,7 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [Drawer] /// * [Drawer]
/// * [DrawerItem] /// * [DrawerItem]
/// * <https://www.google.com/design/spec/patterns/navigation-drawer.html> /// * <https://www.google.com/design/spec/patterns/navigation-drawer.html>
......
...@@ -18,6 +18,7 @@ import 'theme.dart'; ...@@ -18,6 +18,7 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [Drawer] /// * [Drawer]
/// * [DrawerHeader] /// * [DrawerHeader]
/// * <https://www.google.com/design/spec/patterns/navigation-drawer.html> /// * <https://www.google.com/design/spec/patterns/navigation-drawer.html>
...@@ -37,6 +38,8 @@ class DrawerItem extends StatelessWidget { ...@@ -37,6 +38,8 @@ class DrawerItem extends StatelessWidget {
final Widget child; final Widget child;
/// Called when the user taps this drawer item. /// Called when the user taps this drawer item.
///
/// If null, the drawer item is displayed as disabled.
final VoidCallback onPressed; final VoidCallback onPressed;
/// Whether this drawer item is currently selected. /// Whether this drawer item is currently selected.
......
...@@ -252,6 +252,7 @@ class DropDownMenuItem<T> extends StatelessWidget { ...@@ -252,6 +252,7 @@ class DropDownMenuItem<T> extends StatelessWidget {
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [RaisedButton] /// * [RaisedButton]
/// * [FlatButton] /// * [FlatButton]
/// * <https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons> /// * <https://www.google.com/design/spec/components/buttons.html#buttons-dropdown-buttons>
......
...@@ -29,6 +29,7 @@ import 'theme.dart'; ...@@ -29,6 +29,7 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [RaisedButton] /// * [RaisedButton]
/// * [DropDownButton] /// * [DropDownButton]
/// * https://www.google.com/design/spec/components/buttons.html /// * https://www.google.com/design/spec/components/buttons.html
......
...@@ -31,7 +31,11 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0); ...@@ -31,7 +31,11 @@ const Interval _kChildSegueInterval = const Interval(0.65, 1.0);
/// If the [onPressed] callback is not specified or null, then the button will /// If the [onPressed] callback is not specified or null, then the button will
/// be disabled, will not react to touch. /// be disabled, will not react to touch.
/// ///
/// See also: <https://www.google.com/design/spec/components/buttons-floating-action-button.html> /// See also:
///
/// * [RaisedButton]
/// * [FlatButton]
/// * <https://www.google.com/design/spec/components/buttons-floating-action-button.html>
class FloatingActionButton extends StatefulWidget { class FloatingActionButton extends StatefulWidget {
const FloatingActionButton({ const FloatingActionButton({
Key key, Key key,
......
...@@ -25,7 +25,11 @@ class IconData { ...@@ -25,7 +25,11 @@ class IconData {
/// ///
/// Use with with the [Icon] class to show specific icons. /// Use with with the [Icon] class to show specific icons.
/// ///
/// See also: <https://design.google.com/icons/> /// See also:
///
/// * [Icon]
/// * [IconButton]
/// * <https://design.google.com/icons/>
class Icons { class Icons {
Icons._(); Icons._();
......
...@@ -18,6 +18,7 @@ export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType; ...@@ -18,6 +18,7 @@ export 'package:sky_services/editing/editing.mojom.dart' show KeyboardType;
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * <https://www.google.com/design/spec/components/text-fields.html> /// * <https://www.google.com/design/spec/components/text-fields.html>
class Input extends StatefulWidget { class Input extends StatefulWidget {
Input({ Input({
......
...@@ -21,6 +21,7 @@ import 'theme.dart'; ...@@ -21,6 +21,7 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [MaterialList] /// * [MaterialList]
/// * [CircleAvatar] /// * [CircleAvatar]
/// * <https://www.google.com/design/spec/components/lists.html> /// * <https://www.google.com/design/spec/components/lists.html>
...@@ -61,20 +62,29 @@ class ListItem extends StatelessWidget { ...@@ -61,20 +62,29 @@ class ListItem extends StatelessWidget {
final Widget trailing; final Widget trailing;
/// Whether this list item is intended to display three lines of text. /// Whether this list item is intended to display three lines of text.
///
/// If false, the list item is treated as having one line if the subtitle is
/// null and treated as having two lines if the subtitle is non-null.
final bool isThreeLine; final bool isThreeLine;
/// Whether this list item is part of a vertically dense list. /// Whether this list item is part of a vertically dense list.
final bool dense; final bool dense;
/// Whether this list item should be styled with the disabled color from the theme. /// Whether this list item is interactive.
/// ///
/// If true, prevents the [onTap] and [onLongPress] callbacks from being operative. /// If false, this list item is styled with the disabled color from the
/// current [Theme] and the [onTap] and [onLongPress] callbacks are
/// inoperative.
final bool enabled; final bool enabled;
/// Called when the user taps this list item. /// Called when the user taps this list item.
///
/// Inoperative if [enabled] is false.
final GestureTapCallback onTap; final GestureTapCallback onTap;
/// Called when the user long-presses on this list item. /// Called when the user long-presses on this list item.
///
/// Inoperative if [enabled] is false.
final GestureLongPressCallback onLongPress; final GestureLongPressCallback onLongPress;
/// Add a one pixel border in between each item. If color isn't specified the /// Add a one pixel border in between each item. If color isn't specified the
......
...@@ -29,6 +29,7 @@ const double _kInnerRadius = 5.0; ...@@ -29,6 +29,7 @@ const double _kInnerRadius = 5.0;
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [CheckBox] /// * [CheckBox]
/// * [Slider] /// * [Slider]
/// * [Switch] /// * [Switch]
...@@ -53,13 +54,16 @@ class Radio<T> extends StatelessWidget { ...@@ -53,13 +54,16 @@ class Radio<T> extends StatelessWidget {
/// The color to use when this radio button is selected. /// The color to use when this radio button is selected.
/// ///
/// Defaults to accent color of the current theme. /// Defaults to accent color of the current [Theme].
final Color activeColor; final Color activeColor;
/// Called when the user selects this radio button. /// Called when the user selects this radio button.
/// ///
/// For convenence, the radio button passes [value] as a parameter to this /// The radio button passes [value] as a parameter to this callback. The radio
/// callback. /// button does not actually change state until the parent widget rebuilds the
/// radio button with the new [groupValue].
///
/// If null, the radio button will be displayed as disabled.
final ValueChanged<T> onChanged; final ValueChanged<T> onChanged;
bool get _enabled => onChanged != null; bool get _enabled => onChanged != null;
......
...@@ -26,8 +26,10 @@ import 'theme.dart'; ...@@ -26,8 +26,10 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [FlatButton] /// * [FlatButton]
/// * [DropDownButton] /// * [DropDownButton]
/// * [FloatingActionButton]
/// * <https://www.google.com/design/spec/components/buttons.html> /// * <https://www.google.com/design/spec/components/buttons.html>
class RaisedButton extends MaterialButton { class RaisedButton extends MaterialButton {
RaisedButton({ RaisedButton({
......
...@@ -17,7 +17,9 @@ import 'package:flutter/painting.dart'; ...@@ -17,7 +17,9 @@ import 'package:flutter/painting.dart';
/// Each entry has three shadows which must be combined to obtain the defined /// Each entry has three shadows which must be combined to obtain the defined
/// effect for that elevation. /// effect for that elevation.
/// ///
/// See also: <https://www.google.com/design/spec/what-is-material/elevation-shadows.html> /// See also:
/// * [Material]
/// * <https://www.google.com/design/spec/what-is-material/elevation-shadows.html>
const Map<int, List<BoxShadow>> elevationToShadow = _elevationToShadow; // to hide the literal from the docs const Map<int, List<BoxShadow>> elevationToShadow = _elevationToShadow; // to hide the literal from the docs
const Color _kKeyUmbraOpacity = const Color(0x33000000); // alpha = 0.2 const Color _kKeyUmbraOpacity = const Color(0x33000000); // alpha = 0.2
......
...@@ -23,6 +23,7 @@ import 'theme.dart'; ...@@ -23,6 +23,7 @@ import 'theme.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [CheckBox] /// * [CheckBox]
/// * [Radio] /// * [Radio]
/// * [Switch] /// * [Switch]
...@@ -59,10 +60,16 @@ class Slider extends StatelessWidget { ...@@ -59,10 +60,16 @@ class Slider extends StatelessWidget {
/// The color to use for the portion of the slider that has been selected. /// The color to use for the portion of the slider that has been selected.
/// ///
/// Defaults to accent color of the current theme. /// Defaults to accent color of the current [Theme].
final Color activeColor; final Color activeColor;
/// Called when the user selects a new value for the slider. /// Called when the user selects a new value for the slider.
///
/// The slider passes the new value to the callback but does not actually
/// change state until the parent widget rebuilds the slider with the new
/// value.
///
/// If null, the slider will be displayed as disabled.
final ValueChanged<double> onChanged; final ValueChanged<double> onChanged;
void _handleChanged(double value) { void _handleChanged(double value) {
......
...@@ -36,7 +36,10 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut ...@@ -36,7 +36,10 @@ const Curve _snackBarFadeCurve = const Interval(0.72, 1.0, curve: Curves.fastOut
/// Snack bar actions are always enabled. If you want to disable a snack bar /// Snack bar actions are always enabled. If you want to disable a snack bar
/// action, simply don't include it in the snack bar. /// action, simply don't include it in the snack bar.
/// ///
/// See also: <https://www.google.com/design/spec/components/snackbars-toasts.html> /// See also:
///
/// * [SnackBar]
/// * <https://www.google.com/design/spec/components/snackbars-toasts.html>
class SnackBarAction extends StatelessWidget { class SnackBarAction extends StatelessWidget {
SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) { SnackBarAction({Key key, this.label, this.onPressed }) : super(key: key) {
assert(label != null); assert(label != null);
......
...@@ -25,6 +25,7 @@ import 'toggleable.dart'; ...@@ -25,6 +25,7 @@ import 'toggleable.dart';
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [CheckBox] /// * [CheckBox]
/// * [Radio] /// * [Radio]
/// * [Slider] /// * [Slider]
...@@ -44,7 +45,7 @@ class Switch extends StatelessWidget { ...@@ -44,7 +45,7 @@ class Switch extends StatelessWidget {
/// The color to use when this switch is on. /// The color to use when this switch is on.
/// ///
/// Defaults to accent color of the current theme. /// Defaults to accent color of the current [Theme].
final Color activeColor; final Color activeColor;
/// A decoration to use for the thumb of this switch when the switch is on. /// A decoration to use for the thumb of this switch when the switch is on.
...@@ -62,6 +63,8 @@ class Switch extends StatelessWidget { ...@@ -62,6 +63,8 @@ class Switch extends StatelessWidget {
/// The switch passes the new value to the callback but does not actually /// The switch passes the new value to the callback but does not actually
/// change state until the parent widget rebuilds the switch with the new /// change state until the parent widget rebuilds the switch with the new
/// value. /// value.
///
/// If null, the switch will be displayed as disabled.
final ValueChanged<bool> onChanged; final ValueChanged<bool> onChanged;
@override @override
......
...@@ -582,6 +582,7 @@ class TabBarSelectionState<T> extends State<TabBarSelection<T>> { ...@@ -582,6 +582,7 @@ class TabBarSelectionState<T> extends State<TabBarSelection<T>> {
/// Requires one of its ancestors to be a [Material] widget. /// Requires one of its ancestors to be a [Material] widget.
/// ///
/// See also: /// See also:
///
/// * [TabBarSelection] /// * [TabBarSelection]
/// * [TabBarView] /// * [TabBarView]
/// * [AppBar.tabBar] /// * [AppBar.tabBar]
......
...@@ -98,6 +98,7 @@ enum _TimePickerMode { hour, minute } ...@@ -98,6 +98,7 @@ enum _TimePickerMode { hour, minute }
/// [showTimePicker], which creates a time picker dialog. /// [showTimePicker], which creates a time picker dialog.
/// ///
/// See also: /// See also:
///
/// * [showTimePicker] /// * [showTimePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-time-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-time-pickers>
class TimePicker extends StatefulWidget { class TimePicker extends StatefulWidget {
......
...@@ -74,6 +74,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> { ...@@ -74,6 +74,7 @@ class _TimePickerDialogState extends State<_TimePickerDialog> {
/// the initialTime. /// the initialTime.
/// ///
/// See also: /// See also:
///
/// * [TimePicker] /// * [TimePicker]
/// * [showDatePicker] /// * [showDatePicker]
/// * <https://www.google.com/design/spec/components/pickers.html#pickers-time-pickers> /// * <https://www.google.com/design/spec/components/pickers.html#pickers-time-pickers>
......
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