From 6f824bcec9b68b3580a7b2687a47c1e98b21f664 Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Mon, 5 Jun 2017 22:44:49 -0700 Subject: [PATCH] More documentation (#10519) --- .../flutter/lib/src/animation/curves.dart | 19 + .../lib/src/cupertino/bottom_tab_bar.dart | 5 +- .../flutter/lib/src/cupertino/colors.dart | 1 + .../flutter/lib/src/cupertino/nav_bar.dart | 5 +- .../flutter/lib/src/material/back_button.dart | 5 + .../lib/src/material/checkbox_list_tile.dart | 3 + packages/flutter/lib/src/material/colors.dart | 879 +++++++++++++++--- .../lib/src/material/radio_list_tile.dart | 3 + .../lib/src/material/switch_list_tile.dart | 3 + .../flutter/lib/src/painting/box_painter.dart | 4 +- .../flutter/lib/src/rendering/editable.dart | 25 + .../flutter/lib/src/rendering/object.dart | 4 +- .../flutter/lib/src/rendering/proxy_box.dart | 12 +- .../rendering/sliver_persistent_header.dart | 1 + .../lib/src/services/image_provider.dart | 81 ++ .../lib/src/services/image_stream.dart | 15 +- .../lib/src/widgets/animated_cross_fade.dart | 37 + packages/flutter/lib/src/widgets/basic.dart | 77 +- packages/flutter/lib/src/widgets/binding.dart | 107 +++ .../flutter/lib/src/widgets/container.dart | 2 +- .../flutter/lib/src/widgets/framework.dart | 2 +- packages/flutter/lib/src/widgets/image.dart | 9 + .../lib/src/widgets/navigation_toolbar.dart | 4 +- .../lib/src/widgets/nested_scroll_view.dart | 15 + .../flutter/test/widgets/transform_test.dart | 24 + packages/flutter_driver/lib/src/health.dart | 3 - .../flutter_test/lib/src/all_elements.dart | 2 +- packages/flutter_test/lib/src/binding.dart | 4 + packages/flutter_test/lib/src/finders.dart | 3 + 29 files changed, 1177 insertions(+), 177 deletions(-) diff --git a/packages/flutter/lib/src/animation/curves.dart b/packages/flutter/lib/src/animation/curves.dart index dcb7aa013e..f0c74528d7 100644 --- a/packages/flutter/lib/src/animation/curves.dart +++ b/packages/flutter/lib/src/animation/curves.dart @@ -448,6 +448,25 @@ class ElasticInOutCurve extends Curve { // PREDEFINED CURVES /// A collection of common animation curves. +/// +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_bounce_in.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_bounce_in_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_bounce_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_decelerate.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_ease.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_ease_in.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_ease_in_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_ease_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_elastic_in.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_elastic_in_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_elastic_out.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_fast_out_slow_in.png) +/// ![](https://flutter.github.io/assets-for-api-docs/animation/curve_linear.png) +/// +/// See also: +/// +/// * [Curve], the interface implemented by the constants available from the +/// [Curves] class. class Curves { Curves._(); diff --git a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart index 59472f3532..c1e7efa392 100644 --- a/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart +++ b/packages/flutter/lib/src/cupertino/bottom_tab_bar.dart @@ -15,7 +15,7 @@ const double _kTabBarHeight = 50.0; const Color _kDefaultTabBarBackgroundColor = const Color(0xCCF8F8F8); const Color _kDefaultTabBarBorderColor = const Color(0x4C000000); -/// An iOS styled bottom navigation tab bar. +/// An iOS-styled bottom navigation tab bar. /// /// Displays multiple tabs using [BottomNavigationBarItem] with one tab being /// active, the first tab by default. @@ -29,9 +29,10 @@ const Color _kDefaultTabBarBorderColor = const Color(0x4C000000); /// /// If the given [backgroundColor]'s opacity is not 1.0 (which is the case by /// default), it will produce a blurring effect to the content behind it. -/// +// // TODO(xster): document using with a CupertinoScaffold. class CupertinoTabBar extends StatelessWidget { + /// Creates a tab bar in the iOS style. CupertinoTabBar({ Key key, @required this.items, diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index cb546cb564..17ab67e52f 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -4,6 +4,7 @@ import 'dart:ui' show Color; +/// [Color] constants that describe colors commonly used in iOS applications. class CupertinoColors { CupertinoColors._(); diff --git a/packages/flutter/lib/src/cupertino/nav_bar.dart b/packages/flutter/lib/src/cupertino/nav_bar.dart index 0ee64fe912..82ecc791d0 100644 --- a/packages/flutter/lib/src/cupertino/nav_bar.dart +++ b/packages/flutter/lib/src/cupertino/nav_bar.dart @@ -15,7 +15,7 @@ const double _kNavBarHeight = 44.0; const Color _kDefaultNavBarBackgroundColor = const Color(0xCCF8F8F8); const Color _kDefaultNavBarBorderColor = const Color(0x4C000000); -/// An iOS styled navigation bar. +/// An iOS-styled navigation bar. /// /// The navigation bar is a toolbar that minimally consists of a widget, normally /// a page title, in the [middle] of the toolbar. @@ -28,11 +28,12 @@ const Color _kDefaultNavBarBorderColor = const Color(0x4C000000); /// /// If the given [backgroundColor]'s opacity is not 1.0 (which is the case by /// default), it will produce a blurring effect to the content behind it. -/// +// // TODO(xster): document automatic addition of a CupertinoBackButton. // TODO(xster): add sample code using icons. // TODO(xster): document integration into a CupertinoScaffold. class CupertinoNavigationBar extends StatelessWidget implements PreferredSizeWidget { + /// Creates a navigation bar in the iOS style. const CupertinoNavigationBar({ Key key, this.leading, diff --git a/packages/flutter/lib/src/material/back_button.dart b/packages/flutter/lib/src/material/back_button.dart index d6326a1d0f..671bfeeb87 100644 --- a/packages/flutter/lib/src/material/back_button.dart +++ b/packages/flutter/lib/src/material/back_button.dart @@ -10,6 +10,8 @@ import 'theme.dart'; /// A "back" icon that's appropriate for the current [TargetPlatform]. /// +/// The current platform is determined by querying for the ambient [Theme]. +/// /// See also: /// /// * [BackButton], an [IconButton] with a [BackButtonIcon] that calls @@ -17,7 +19,10 @@ import 'theme.dart'; /// * [IconButton], which is a more general widget for creating buttons /// with icons. /// * [Icon], a material design icon. +/// * [ThemeData.platform], which specifies the current platform. class BackButtonIcon extends StatelessWidget { + /// Creates an icon that shows the appropriate "back" image for + /// the current platform (as obtained from the [Theme]). const BackButtonIcon({ Key key }) : super(key: key); /// Returns tha appropriate "back" icon for the given `platform`. diff --git a/packages/flutter/lib/src/material/checkbox_list_tile.dart b/packages/flutter/lib/src/material/checkbox_list_tile.dart index 02b217b7e0..25ec516c4d 100644 --- a/packages/flutter/lib/src/material/checkbox_list_tile.dart +++ b/packages/flutter/lib/src/material/checkbox_list_tile.dart @@ -31,6 +31,9 @@ import 'theme.dart'; /// [secondary] widget is placed on the opposite side. This maps to the /// [ListTile.leading] and [ListTile.trailing] properties of [ListTile]. /// +/// To show the [CheckboxListTile] as disabled, pass null as the [onChanged] +/// callback. +/// /// ## Sample code /// /// This widget shows a checkbox that, when checked, slows down all animations diff --git a/packages/flutter/lib/src/material/colors.dart b/packages/flutter/lib/src/material/colors.dart index 45d4b89395..14a1fa7987 100644 --- a/packages/flutter/lib/src/material/colors.dart +++ b/packages/flutter/lib/src/material/colors.dart @@ -91,21 +91,6 @@ class MaterialAccentColor extends ColorSwatch { /// colors selected for the current theme, such as [ThemeData.primaryColor] and /// [ThemeData.accentColor] (among many others). /// -/// To select a specific color from one of the swatches, index into the swatch -/// using an integer for the specific color desired, as follows: -/// -/// ```dart -/// Colors.green[400] // Selects a mid-range green. -/// ``` -/// -/// Each [ColorSwatch] constant is a color and can used directly. For example -/// -/// ```dart -/// new Container( -/// color: Colors.blue, // same as Colors.blue[500] or Colors.blue.shade500 -/// ) -/// ``` -/// /// Most swatches have colors from 100 to 900 in increments of one hundred, plus /// the color 50. The smaller the number, the more pale the color. The greater /// the number, the darker the color. The accent swatches (e.g. [redAccent]) only @@ -113,6 +98,91 @@ class MaterialAccentColor extends ColorSwatch { /// /// In addition, a series of blacks and whites with common opacities are /// available. For example, [black54] is a pure black with 54% opacity. +/// +/// ## Sample code +/// +/// To select a specific color from one of the swatches, index into the swatch +/// using an integer for the specific color desired, as follows: +/// +/// ```dart +/// Colors.green[400] // Selects a mid-range green. +/// ``` +/// +/// Each [ColorSwatch] constant is a color and can used directly. For example: +/// +/// ```dart +/// new Container( +/// color: Colors.blue, // same as Colors.blue[500] or Colors.blue.shade500 +/// ) +/// ``` +/// +/// ## Color palettes +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.brown.png) +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.grey.png) +/// +/// ## Blacks and whites +/// +/// These colors are identified by their transparency. The low transparency +/// levels (e.g. [Colors.white12] and [Colors.white10]) are very hard to see and +/// should be avoided in general. They are intended for very subtle effects. +/// +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) +/// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) +/// +/// The [Colors.transparent] color isn't shown here because it is entirely +/// invisible! class Colors { Colors._(); @@ -120,54 +190,97 @@ class Colors { static const Color transparent = const Color(0x00000000); /// Completely opaque black. + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// + /// See also: + /// + /// * [black87], [black54], [black45], [black38], [black26], [black12], which + /// are variants on this color but with different opacities. + /// * [white], a solid white color. + /// * [transparent], a fully-transparent color. static const Color black = const Color(0xFF000000); /// Black with 87% opacity. /// /// This is a good contrasting color for text in light themes. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// /// See also: /// - /// * [Typography.black], which uses this color for its text styles. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [Typography.black], which uses this color for its text styles. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [black], [black54], [black45], [black38], [black26], [black12], which + /// are variants on this color but with different opacities. static const Color black87 = const Color(0xDD000000); /// Black with 54% opacity. /// - /// This is a color commonly used for headings in light themes. + /// This is a color commonly used for headings in light themes. It's also used + /// as the mask color behind dialogs. + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) /// /// See also: /// - /// * [Typography.black], which uses this color for its text styles. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [Typography.black], which uses this color for its text styles. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [black], [black87], [black45], [black38], [black26], [black12], which + /// are variants on this color but with different opacities. static const Color black54 = const Color(0x8A000000); + /// Black with 45% opacity. + /// + /// Used for disabled icons. + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// + /// See also: + /// + /// * [black], [black87], [black54], [black38], [black26], [black12], which + /// are variants on this color but with different opacities. + static const Color black45 = const Color(0x73000000); + /// Black with 38% opacity. /// /// Used for the placeholder text in data tables in light themes. - static const Color black38 = const Color(0x61000000); - - /// Black with 45% opacity. /// - /// Used for modal barriers. - static const Color black45 = const Color(0x73000000); + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// + /// See also: + /// + /// * [black], [black87], [black54], [black45], [black26], [black12], which + /// are variants on this color but with different opacities. + static const Color black38 = const Color(0x61000000); /// Black with 26% opacity. /// /// Used for disabled radio buttons and the text of disabled flat buttons in light themes. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// /// See also: /// - /// * [ThemeData.disabledColor], which uses this color by default in light themes. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [ThemeData.disabledColor], which uses this color by default in light themes. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [black], [black87], [black54], [black45], [black38], [black12], which + /// are variants on this color but with different opacities. static const Color black26 = const Color(0x42000000); /// Black with 12% opacity. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blacks.png) + /// /// Used for the background of disabled raised buttons in light themes. + /// + /// See also: + /// + /// * [black], [black87], [black54], [black45], [black38], [black26], which + /// are variants on this color but with different opacities. static const Color black12 = const Color(0x1F000000); /// Completely opaque white. @@ -175,45 +288,85 @@ class Colors { /// This is a good contrasting color for the [ThemeData.primaryColor] in the /// dark theme. See [ThemeData.brightness]. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) + /// /// See also: /// - /// * [Typography.white], which uses this color for its text styles. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [Typography.white], which uses this color for its text styles. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [white70, white30, white12, white10], which are variants on this color + /// but with different opacities. + /// * [black], a solid black color. + /// * [transparent], a fully-transparent color. static const Color white = const Color(0xFFFFFFFF); /// White with 70% opacity. /// /// This is a color commonly used for headings in dark themes. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) + /// /// See also: /// - /// * [Typography.white], which uses this color for its text styles. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [Typography.white], which uses this color for its text styles. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [white, white30, white12, white10], which are variants on this color + /// but with different opacities. static const Color white70 = const Color(0xB3FFFFFF); /// White with 32% opacity. /// /// Used for disabled radio buttons and the text of disabled flat buttons in dark themes. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) + /// /// See also: /// - /// * [ThemeData.disabledColor], which uses this color by default in dark themes. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [ThemeData.disabledColor], which uses this color by default in dark themes. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. + /// * [white, white70, white12, white10], which are variants on this color + /// but with different opacities. static const Color white30 = const Color(0x4DFFFFFF); /// White with 12% opacity. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) + /// /// Used for the background of disabled raised buttons in dark themes. + /// + /// See also: + /// + /// * [white, white70, white30, white10], which are variants on this color + /// but with different opacities. static const Color white12 = const Color(0x1FFFFFFF); /// White with 10% opacity. + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.whites.png) + /// + /// See also: + /// + /// * [white, white70, white30, white12], which are variants on this color + /// but with different opacities. + /// * [transparent], a fully-transparent color, not far from this one. static const Color white10 = const Color(0x1AFFFFFF); /// The red primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -223,9 +376,10 @@ class Colors { /// /// See also: /// - /// * [redAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [redAccent], the corresponding accent colors. + /// * [deepOrange] and [pink], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor red = const MaterialColor( _redPrimaryValue, const { @@ -245,6 +399,17 @@ class Colors { /// The red accent swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -254,9 +419,10 @@ class Colors { /// /// See also: /// - /// * [red], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [red], the corresponding primary colors. + /// * [deepOrangeAccent] and [pinkAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor redAccent = const MaterialAccentColor( _redAccentValue, const { @@ -270,6 +436,17 @@ class Colors { /// The pink primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -279,9 +456,10 @@ class Colors { /// /// See also: /// - /// * [pinkAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [pinkAccent], the corresponding accent colors. + /// * [red] and [purple], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor pink = const MaterialColor( _pinkPrimaryValue, const { @@ -301,6 +479,17 @@ class Colors { /// The pink accent color swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -310,9 +499,10 @@ class Colors { /// /// See also: /// - /// * [pink], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [pink], the corresponding primary colors. + /// * [redAccent] and [purpleAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor pinkAccent = const MaterialAccentColor( _pinkAccentPrimaryValue, const { @@ -326,6 +516,17 @@ class Colors { /// The purple primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -335,9 +536,10 @@ class Colors { /// /// See also: /// - /// * [purpleAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [purpleAccent], the corresponding accent colors. + /// * [deepPurple] and [pink], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor purple = const MaterialColor( _purplePrimaryValue, const { @@ -357,6 +559,17 @@ class Colors { /// The purple accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pink.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.pinkAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -366,9 +579,10 @@ class Colors { /// /// See also: /// - /// * [purple], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [purple], the corresponding primary colors. + /// * [deepPurpleAccent] and [pinkAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor purpleAccent = const MaterialAccentColor( _purpleAccentPrimaryValue, const { @@ -382,6 +596,17 @@ class Colors { /// The deep purple primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -391,9 +616,10 @@ class Colors { /// /// See also: /// - /// * [deepPurpleAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [deepPurpleAccent], the corresponding accent colors. + /// * [purple] and [indigo], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor deepPurple = const MaterialColor( _deepPurplePrimaryValue, const { @@ -413,6 +639,17 @@ class Colors { /// The deep purple accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.purpleAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -422,9 +659,10 @@ class Colors { /// /// See also: /// - /// * [deepPurple], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [deepPurple], the corresponding primary colors. + /// * [purpleAccent] and [indigoAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor deepPurpleAccent = const MaterialAccentColor( _deepPurpleAccentPrimaryValue, const { @@ -438,6 +676,17 @@ class Colors { /// The indigo primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -447,9 +696,10 @@ class Colors { /// /// See also: /// - /// * [indigoAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [indigoAccent], the corresponding accent colors. + /// * [blue] and [deepPurple], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor indigo = const MaterialColor( _indigoPrimaryValue, const { @@ -469,6 +719,17 @@ class Colors { /// The indigo accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurple.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepPurpleAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -478,9 +739,10 @@ class Colors { /// /// See also: /// - /// * [indigo], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [indigo], the corresponding primary colors. + /// * [blueAccent] and [deepPurpleAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor indigoAccent = const MaterialAccentColor( _indigoAccentPrimaryValue, const { @@ -494,6 +756,19 @@ class Colors { /// The blue primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -503,9 +778,10 @@ class Colors { /// /// See also: /// - /// * [blueAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [blueAccent], the corresponding accent colors. + /// * [indigo], [lightBlue], and [blueGrey], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor blue = const MaterialColor( _bluePrimaryValue, const { @@ -525,6 +801,17 @@ class Colors { /// The blue accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigo.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.indigoAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -534,9 +821,10 @@ class Colors { /// /// See also: /// - /// * [blue], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [blue], the corresponding primary colors. + /// * [indigoAccent] and [lightBlueAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor blueAccent = const MaterialAccentColor( _blueAccentPrimaryValue, const { @@ -550,6 +838,17 @@ class Colors { /// The light blue primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -559,9 +858,10 @@ class Colors { /// /// See also: /// - /// * [lightBlueAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [lightBlueAccent], the corresponding accent colors. + /// * [blue] and [cyan], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor lightBlue = const MaterialColor( _lightBluePrimaryValue, const { @@ -581,6 +881,17 @@ class Colors { /// The light blue accent swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -590,9 +901,10 @@ class Colors { /// /// See also: /// - /// * [lightBlue], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [lightBlue], the corresponding primary colors. + /// * [blueAccent] and [cyanAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor lightBlueAccent = const MaterialAccentColor( _lightBlueAccentPrimaryValue, const { @@ -606,6 +918,19 @@ class Colors { /// The cyan primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -615,9 +940,10 @@ class Colors { /// /// See also: /// - /// * [cyanAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [cyanAccent], the corresponding accent colors. + /// * [lightBlue], [teal], and [blueGrey], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor cyan = const MaterialColor( _cyanPrimaryValue, const { @@ -637,6 +963,17 @@ class Colors { /// The cyan accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlue.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightBlueAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -646,9 +983,10 @@ class Colors { /// /// See also: /// - /// * [cyan], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [cyan], the corresponding primary colors. + /// * [lightBlueAccent] and [tealAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor cyanAccent = const MaterialAccentColor( _cyanAccentPrimaryValue, const { @@ -662,6 +1000,17 @@ class Colors { /// The teal primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -671,9 +1020,10 @@ class Colors { /// /// See also: /// - /// * [tealAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [tealAccent], the corresponding accent colors. + /// * [green] and [cyan], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor teal = const MaterialColor( _tealPrimaryValue, const { @@ -693,6 +1043,17 @@ class Colors { /// The teal accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyanAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -702,9 +1063,10 @@ class Colors { /// /// See also: /// - /// * [teal], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [teal], the corresponding primary colors. + /// * [greenAccent] and [cyanAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor tealAccent = const MaterialAccentColor( _tealAccentPrimaryValue, const { @@ -718,6 +1080,20 @@ class Colors { /// The green primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -727,9 +1103,10 @@ class Colors { /// /// See also: /// - /// * [greenAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [greenAccent], the corresponding accent colors. + /// * [teal], [lightGreen], and [lime], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor green = const MaterialColor( _greenPrimaryValue, const { @@ -749,6 +1126,20 @@ class Colors { /// The green accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.teal.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.tealAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -758,9 +1149,10 @@ class Colors { /// /// See also: /// - /// * [green], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [green], the corresponding primary colors. + /// * [tealAccent], [lightGreenAccent], and [limeAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor greenAccent = const MaterialAccentColor( _greenAccentPrimaryValue, const { @@ -774,6 +1166,17 @@ class Colors { /// The light green primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -783,9 +1186,10 @@ class Colors { /// /// See also: /// - /// * [lightGreenAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [lightGreenAccent], the corresponding accent colors. + /// * [green] and [lime], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor lightGreen = const MaterialColor( _lightGreenPrimaryValue, const { @@ -805,6 +1209,17 @@ class Colors { /// The light green accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.green.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.greenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -814,9 +1229,10 @@ class Colors { /// /// See also: /// - /// * [lightGreen], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [lightGreen], the corresponding primary colors. + /// * [greenAccent] and [limeAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor lightGreenAccent = const MaterialAccentColor( _lightGreenAccentPrimaryValue, const { @@ -830,6 +1246,17 @@ class Colors { /// The lime primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -839,9 +1266,10 @@ class Colors { /// /// See also: /// - /// * [limeAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [limeAccent], the corresponding accent colors. + /// * [lightGreen] and [yellow], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor lime = const MaterialColor( _limePrimaryValue, const { @@ -861,6 +1289,17 @@ class Colors { /// The lime accent primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreen.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lightGreenAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -870,9 +1309,10 @@ class Colors { /// /// See also: /// - /// * [lime], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [lime], the corresponding primary colors. + /// * [lightGreenAccent] and [yellowAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor limeAccent = const MaterialAccentColor( _limeAccentPrimaryValue, const { @@ -886,6 +1326,17 @@ class Colors { /// The yellow primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -895,9 +1346,10 @@ class Colors { /// /// See also: /// - /// * [yellowAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [yellowAccent], the corresponding accent colors. + /// * [lime] and [amber], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor yellow = const MaterialColor( _yellowPrimaryValue, const { @@ -917,6 +1369,17 @@ class Colors { /// The yellow accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.lime.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.limeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -926,9 +1389,10 @@ class Colors { /// /// See also: /// - /// * [yellow], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [yellow], the corresponding primary colors. + /// * [limeAccent] and [amberAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor yellowAccent = const MaterialAccentColor( _yellowAccentPrimaryValue, const { @@ -942,6 +1406,17 @@ class Colors { /// The amber primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -951,9 +1426,10 @@ class Colors { /// /// See also: /// - /// * [amberAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [amberAccent], the corresponding accent colors. + /// * [yellow] and [orange], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor amber = const MaterialColor( _amberPrimaryValue, const { @@ -973,6 +1449,17 @@ class Colors { /// The amber accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellow.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.yellowAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -982,9 +1469,10 @@ class Colors { /// /// See also: /// - /// * [amber], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [amber], the corresponding primary colors. + /// * [yellowAccent] and [orangeAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor amberAccent = const MaterialAccentColor( _amberAccentPrimaryValue, const { @@ -998,6 +1486,19 @@ class Colors { /// The orange primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.brown.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1007,9 +1508,10 @@ class Colors { /// /// See also: /// - /// * [orangeAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [orangeAccent], the corresponding accent colors. + /// * [amber], [deepOrange], and [brown], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor orange = const MaterialColor( _orangePrimaryValue, const { @@ -1029,6 +1531,17 @@ class Colors { /// The orange accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amber.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.amberAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1038,9 +1551,10 @@ class Colors { /// /// See also: /// - /// * [orange], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [orange], the corresponding primary colors. + /// * [amberAccent] and [deepOrangeAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor orangeAccent = const MaterialAccentColor( _orangeAccentPrimaryValue, const { @@ -1054,6 +1568,19 @@ class Colors { /// The deep orange primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.brown.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1063,9 +1590,10 @@ class Colors { /// /// See also: /// - /// * [deepOrangeAccent], the corresponding accent colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [deepOrangeAccent], the corresponding accent colors. + /// * [orange], [red], and [brown], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor deepOrange = const MaterialColor( _deepOrangePrimaryValue, const { @@ -1085,6 +1613,17 @@ class Colors { /// The deep orange accent color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.deepOrangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orangeAccent.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.red.png) + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.redAccent.png) + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1094,9 +1633,10 @@ class Colors { /// /// See also: /// - /// * [deepOrange], the corresponding primary colors. - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [deepOrange], the corresponding primary colors. + /// * [orangeAccent] [redAccent], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialAccentColor deepOrangeAccent = const MaterialAccentColor( _deepOrangeAccentPrimaryValue, const { @@ -1110,6 +1650,16 @@ class Colors { /// The brown primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.brown.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.orange.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) + /// + /// This swatch has no corresponding accent color and swatch. + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1117,12 +1667,11 @@ class Colors { /// ), /// ``` /// - /// This swatch has no corresponding accent color and swatch. - /// /// See also: /// - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [orange] and [blueGrey], vaguely similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor brown = const MaterialColor( _brownPrimaryValue, const { @@ -1142,12 +1691,11 @@ class Colors { /// The grey primary color and swatch. /// - /// ```dart - /// new Icon( - /// icon: Icons.widgets, - /// color: Colors.grey[400], - /// ), - /// ``` + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.grey.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.brown.png) /// /// This swatch has no corresponding accent swatch. /// @@ -1156,10 +1704,22 @@ class Colors { /// used for raised button while pressed in light themes, and 850 is used for /// the background color of the dark theme. See [ThemeData.brightness]. /// + /// ## Sample code + /// + /// ```dart + /// new Icon( + /// icon: Icons.widgets, + /// color: Colors.grey[400], + /// ), + /// ``` + /// /// See also: /// - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [blueGrey] and [brown], somewhat similar colors. + /// * [black], [black87], [black54], [black45], [black38], [black26], [black12], which + /// provide a different approach to showing shades of grey. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor grey = const MaterialColor( _greyPrimaryValue, const { @@ -1181,6 +1741,18 @@ class Colors { /// The blue-grey primary color and swatch. /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blueGrey.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.grey.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.cyan.png) + /// + /// ![](https://flutter.github.io/assets-for-api-docs/material/Colors.blue.png) + /// + /// This swatch has no corresponding accent swatch. + /// + /// ## Sample code + /// /// ```dart /// new Icon( /// icon: Icons.widgets, @@ -1188,12 +1760,11 @@ class Colors { /// ), /// ``` /// - /// This swatch has no corresponding accent swatch. - /// /// See also: /// - /// * [Theme.of], which allows you to select colors from the current theme - /// rather than hard-coding colors in your build methods. + /// * [grey], [cyan], and [blue], similar colors. + /// * [Theme.of], which allows you to select colors from the current theme + /// rather than hard-coding colors in your build methods. static const MaterialColor blueGrey = const MaterialColor( _blueGreyPrimaryValue, const { @@ -1211,7 +1782,7 @@ class Colors { ); static const int _blueGreyPrimaryValue = 0xFF607D8B; - /// The material design primary color swatches (except grey). + /// The material design primary color swatches, excluding grey. static const List primaries = const [ red, pink, @@ -1230,7 +1801,9 @@ class Colors { orange, deepOrange, brown, - // grey intentionally omitted + // The grey swatch is intentionally omitted because when picking a color + // randomly from this list to colorize an application, picking grey suddenly + // makes the app look disabled. blueGrey, ]; diff --git a/packages/flutter/lib/src/material/radio_list_tile.dart b/packages/flutter/lib/src/material/radio_list_tile.dart index 969d312283..b1a34844e6 100644 --- a/packages/flutter/lib/src/material/radio_list_tile.dart +++ b/packages/flutter/lib/src/material/radio_list_tile.dart @@ -34,6 +34,9 @@ import 'theme.dart'; /// [secondary] widget is placed on the opposite side. This maps to the /// [ListTile.leading] and [ListTile.trailing] properties of [ListTile]. /// +/// To show the [RadioListTile] as disabled, pass null as the [onChanged] +/// callback. +/// /// ## Sample code /// /// This widget shows a pair of radio buttons that control the `_character` diff --git a/packages/flutter/lib/src/material/switch_list_tile.dart b/packages/flutter/lib/src/material/switch_list_tile.dart index 1504f6d7a9..eb12eb61fe 100644 --- a/packages/flutter/lib/src/material/switch_list_tile.dart +++ b/packages/flutter/lib/src/material/switch_list_tile.dart @@ -32,6 +32,9 @@ import 'theme.dart'; /// [ListTile.leading] slot. This cannot be changed; there is not sufficient /// space in a [ListTile]'s [ListTile.leading] slot for a [Switch]. /// +/// To show the [SwitchListTile] as disabled, pass null as the [onChanged] +/// callback. +/// /// ## Sample code /// /// This widget shows a switch that, when toggled, changes the state of a [bool] diff --git a/packages/flutter/lib/src/painting/box_painter.dart b/packages/flutter/lib/src/painting/box_painter.dart index 5b4a47aceb..19af89bd2a 100644 --- a/packages/flutter/lib/src/painting/box_painter.dart +++ b/packages/flutter/lib/src/painting/box_painter.dart @@ -1411,7 +1411,7 @@ class DecorationImage { /// /// The [BoxDecoration] class provides a variety of ways to draw a box. /// -/// The box has a [border], a body, and may cast a [shadow]. +/// The box has a [border], a body, and may cast a [boxShadow]. /// /// The [shape] of the box can be a circle or a rectangle. If it is a rectangle, /// then the [borderRadius] property controls the roundness of the corners. @@ -1421,7 +1421,7 @@ class DecorationImage { /// the box. Finally there is the [image], the precise alignment of which is /// controlled by the [DecorationImage] class. /// -/// The [border] paints over the body; the [shadow], naturally, paints below it. +/// The [border] paints over the body; the [boxShadow], naturally, paints below it. /// /// ## Sample code /// diff --git a/packages/flutter/lib/src/rendering/editable.dart b/packages/flutter/lib/src/rendering/editable.dart index 2e46c19147..8622994a44 100644 --- a/packages/flutter/lib/src/rendering/editable.dart +++ b/packages/flutter/lib/src/rendering/editable.dart @@ -58,7 +58,32 @@ class TextSelectionPoint { } } +/// Displays some text in a scrollable container with a potentially blinking +/// cursor and with gesture recognizers. +/// +/// This is the renderer for an editable text field. It does not directly +/// provide affordances for editing the text, but it does handle text selection +/// and manipulation of the text cursor. +/// +/// The [text] is displayed, scrolled by the given [offset], aligned according +/// to [textAlign]. The [maxLines] property controls whether the text displays +/// on one line or many. The [selection], if it is not collapsed, is painted in +/// the [selectionColor]. If it _is_ collapsed, then it represents the cursor +/// position. The cursor is shown while [showCursor] is true. It is painted in +/// the [cursorColor]. +/// +/// If, when the render object paints, the caret is found to have changed +/// location, [onCaretChanged] is called. +/// +/// The user may interact with the render object by tapping or long-pressing. +/// When the user does so, the selection is updated, and [onSelectionChanged] is +/// called. +/// +/// Keyboard handling, IME handling, scrolling, toggling the [showCursor] value +/// to actually blink the cursor, and other features not mentioned above are the +/// responsibility of higher layers and not handled by this object. class RenderEditable extends RenderBox { + /// Creates a render object that implements the visual aspects of a text field. RenderEditable({ TextSpan text, TextAlign textAlign, diff --git a/packages/flutter/lib/src/rendering/object.dart b/packages/flutter/lib/src/rendering/object.dart index 0eed843453..b5fd189f3d 100644 --- a/packages/flutter/lib/src/rendering/object.dart +++ b/packages/flutter/lib/src/rendering/object.dart @@ -1233,8 +1233,8 @@ class PipelineOwner { /// Update the semantics for render objects marked as needing a semantics /// update. /// - /// Initially, only the root node, as scheduled by [scheduleInitialSemantics], - /// needs a semantics update. + /// Initially, only the root node, as scheduled by + /// [RenderObjectscheduleInitialSemantics], needs a semantics update. /// /// This function is one of the core stages of the rendering pipeline. The /// semantics are compiled after painting and only after diff --git a/packages/flutter/lib/src/rendering/proxy_box.dart b/packages/flutter/lib/src/rendering/proxy_box.dart index 23474cf0bb..757db32661 100644 --- a/packages/flutter/lib/src/rendering/proxy_box.dart +++ b/packages/flutter/lib/src/rendering/proxy_box.dart @@ -1509,7 +1509,7 @@ class RenderTransform extends RenderProxyBox { /// child as it is painted. When set to false, hit tests are performed /// ignoring the transformation. /// - /// applyPaintTransform(), and therefore localToGlobal() and globalToLocal(), + /// [applyPaintTransform], and therefore [localToGlobal] and [globalToLocal], /// always honor the transformation, regardless of the value of this property. bool transformHitTests; @@ -2890,12 +2890,14 @@ class RenderSemanticsAnnotations extends RenderProxyBox { } } -/// Causes the semantics of all siblings and cousins painted before it in the -/// same semantic container to be dropped. +/// Causes the semantics of all earlier render objects below the same semantic +/// boundary to be dropped. /// -/// This is useful in a stack where an overlay should prevent interactions -/// with the underlying layers. +/// This is useful in a stack where an opaque mask should prevent interactions +/// with the render objects painted below the mask. class RenderBlockSemantics extends RenderProxyBox { + /// Create a render object that blocks semantics for nodes below it in paint + /// order. RenderBlockSemantics({ RenderBox child }) : super(child); @override diff --git a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart index 498f133216..e969582f6a 100644 --- a/packages/flutter/lib/src/rendering/sliver_persistent_header.dart +++ b/packages/flutter/lib/src/rendering/sliver_persistent_header.dart @@ -35,6 +35,7 @@ abstract class RenderSliverPersistentHeader extends RenderSliver with RenderObje /// child changes its intrinsic dimensions. double get minExtent; + /// The dimension of the child in the main axis. @protected double get childExtent { if (child == null) diff --git a/packages/flutter/lib/src/services/image_provider.dart b/packages/flutter/lib/src/services/image_provider.dart index 306435b7be..1f10d738ff 100644 --- a/packages/flutter/lib/src/services/image_provider.dart +++ b/packages/flutter/lib/src/services/image_provider.dart @@ -19,6 +19,13 @@ import 'image_stream.dart'; /// Configuration information passed to the [ImageProvider.resolve] method to /// select a specific image. +/// +/// See also: +/// +/// * [createLocalImageConfiguration], which creates an [ImageConfiguration] +/// based on ambient configuration in a [Widget] environment. +/// * [ImageProvider], which uses [ImageConfiguration] objects to determine +/// which image to obtain. @immutable class ImageConfiguration { /// Creates an object holding the configuration information for an [ImageProvider]. @@ -149,6 +156,80 @@ class ImageConfiguration { /// /// The type argument does not have to be specified when using the type as an /// argument (where any image provider is acceptable). +/// +/// ## Sample code +/// +/// The following shows the code required to write a widget that fully conforms +/// to the [ImageProvider] and [Widget] protocols. +/// +/// ```dart +/// class Picture extends StatefulWidget { +/// const Picture({ +/// Key key, +/// @required this.imageProvider, +/// }) : assert(imageProvider != null), +/// super(key: key); +/// +/// final ImageProvider imageProvider; +/// +/// @override +/// _PictureState createState() => new _PictureState(); +/// } +/// +/// class _PictureState extends State { +/// ImageStream _imageStream; +/// ImageInfo _imageInfo; +/// +/// @override +/// void didChangeDependencies() { +/// super.didChangeDependencies(); +/// // We call _getImage here because createLocalImageConfiguration() needs to +/// // be called again if the dependencies changed, in case the changes relate +/// // to the DefaultAssetBundle, MediaQuery, etc, which that method uses. +/// _getImage(); +/// } +/// +/// @override +/// void didUpdateWidget(Picture oldWidget) { +/// super.didUpdateWidget(oldWidget); +/// if (widget.imageProvider != oldWidget.imageProvider) +/// _getImage(); +/// } +/// +/// void _getImage() { +/// final ImageStream oldImageStream = _imageStream; +/// _imageStream = widget.imageProvider.resolve(createLocalImageConfiguration(context)); +/// if (_imageStream.key != oldImageStream?.key) { +/// // If the keys are the same, then we got the same image back, and so we don't +/// // need to update the listeners. If the key changed, though, we must make sure +/// // to switch our listeners to the new image stream. +/// oldImageStream?.removeListener(_updateImage); +/// _imageStream.addListener(_updateImage); +/// } +/// } +/// +/// void _updateImage(ImageInfo imageInfo, bool synchronousCall) { +/// setState(() { +/// // Trigger a build whenever the image changes. +/// _imageInfo = imageInfo; +/// }); +/// } +/// +/// @override +/// void dispose() { +/// _imageStream.removeListener(_updateImage); +/// super.dispose(); +/// } +/// +/// @override +/// Widget build(BuildContext context) { +/// return new RawImage( +/// image: _imageInfo?.image, // this is a dart:ui Image object +/// scale: _imageInfo?.scale ?? 1.0, +/// ); +/// } +/// } +/// ``` @optionalTypeArgs abstract class ImageProvider { /// Abstract const constructor. This constructor enables subclasses to provide diff --git a/packages/flutter/lib/src/services/image_stream.dart b/packages/flutter/lib/src/services/image_stream.dart index f6a1ca5725..55a3cdfee3 100644 --- a/packages/flutter/lib/src/services/image_stream.dart +++ b/packages/flutter/lib/src/services/image_stream.dart @@ -44,10 +44,14 @@ class ImageInfo { /// Signature for callbacks reporting that an image is available. /// -/// synchronousCall is true if the listener is being invoked during the call -/// to addListener. -/// /// Used by [ImageStream]. +/// +/// The `synchronousCall` argument is true if the listener is being invoked +/// during the call to addListener. This can be useful if, for example, +/// [ImageStream.addListener] is invoked during a frame, so that a new rendering +/// frame is requested if the call was asynchronous (after the current frame) +/// and no rendering frame is requested if the call was synchronous (within the +/// same stack frame as the call to [ImageStream.addListener]). typedef void ImageListener(ImageInfo image, bool synchronousCall); /// A handle to an image resource. @@ -61,6 +65,11 @@ typedef void ImageListener(ImageInfo image, bool synchronousCall); /// loading. /// /// ImageStream objects are backed by [ImageStreamCompleter] objects. +/// +/// See also: +/// +/// * [ImageProvider], which has an example that includes the use of an +/// [ImageStream] in a [Widget]. class ImageStream { /// Create an initially unbound image stream. /// diff --git a/packages/flutter/lib/src/widgets/animated_cross_fade.dart b/packages/flutter/lib/src/widgets/animated_cross_fade.dart index 8c64b889a4..a0231e4720 100644 --- a/packages/flutter/lib/src/widgets/animated_cross_fade.dart +++ b/packages/flutter/lib/src/widgets/animated_cross_fade.dart @@ -38,6 +38,26 @@ enum CrossFadeState { /// width. In the case where the two children have different heights, the /// animation crops overflowing children during the animation by aligning their /// top edge, which means that the bottom will be clipped. +/// +/// ## Sample code +/// +/// This code fades between two representations of the Flutter logo. It depends +/// on a global boolean `_on`; when `_on` is true, the first logo is shown, +/// otherwise the second logo is shown. +/// +/// ```dart +/// new AnimatedCrossFade( +/// duration: const Duration(seconds: 3), +/// firstChild: const FlutterLogo(style: FlutterLogoStyle.horizontal, size: 100.0), +/// secondChild: const FlutterLogo(style: FlutterLogoStyle.stacked, size: 100.0), +/// crossFadeState: _on ? CrossFadeState.showFirst : CrossFadeState.showSecond, +/// ) +/// ``` +/// +/// See also: +/// +/// * [AnimatedSize], the lower-level widget which [AnimatedCrossFade] uses to +/// automatically change size. class AnimatedCrossFade extends StatefulWidget { /// Creates a cross-fade animation widget. /// @@ -99,6 +119,14 @@ class AnimatedCrossFade extends StatefulWidget { @override _AnimatedCrossFadeState createState() => new _AnimatedCrossFadeState(); + + @override + void debugFillDescription(List description) { + super.debugFillDescription(description); + description.add('$crossFadeState'); + if (alignment != FractionalOffset.topCenter) + description.add('alignment: $alignment'); + } } class _AnimatedCrossFadeState extends State with TickerProviderStateMixin { @@ -212,4 +240,13 @@ class _AnimatedCrossFadeState extends State with TickerProvid ), ); } + + @override + void debugFillDescription(List description) { + super.debugFillDescription(description); + description.add('${widget.crossFadeState}'); + description.add('$_controller'); + if (widget.alignment != FractionalOffset.topCenter) + description.add('alignment: ${widget.alignment}'); + } } diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index ce45f9cc13..f2a75a75f8 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -80,6 +80,8 @@ export 'package:flutter/rendering.dart' show /// See also: /// /// * [ShaderMask], which can apply more elaborate effects to its child. +/// * [Transform], which applies an arbitrary transform to its child widget at +/// paint time. class Opacity extends SingleChildRenderObjectWidget { /// Creates a widget that makes its child partially transparent. /// @@ -147,6 +149,7 @@ class Opacity extends SingleChildRenderObjectWidget { /// * [Opacity], which can apply a uniform alpha effect to its child. /// * [CustomPaint], which lets you draw directly on the canvas. /// * [DecoratedBox], for another approach at decorating child widgets. +/// * [BackdropFilter], which applies an image filter to the background. class ShaderMask extends SingleChildRenderObjectWidget { /// Creates a widget that applies a mask generated by a [Shader] to its child. /// @@ -196,6 +199,11 @@ class ShaderMask extends SingleChildRenderObjectWidget { /// /// This effect is relatively expensive, especially if the filter is non-local, /// such as a blur. +/// +/// See also: +/// +/// * [DecoratedBox], which draws a background under (or over) a widget. +/// * [Opacity], which changes the opacity of the widget itself. class BackdropFilter extends SingleChildRenderObjectWidget { /// Creates a backdrop filter. /// @@ -547,6 +555,11 @@ class ClipPath extends SingleChildRenderObjectWidget { /// /// Physical layers cast shadows based on an [elevation] which is nominally in /// logical pixels, coming vertically out of the rendering surface. +/// +/// See also: +/// +/// * [DecoratedBox], which can apply more arbitrary shadow effects. +/// * [ClipRect], which applies a clip to its child. class PhysicalModel extends SingleChildRenderObjectWidget { /// Creates a physical model with a rounded-rectangular clip. /// @@ -607,6 +620,32 @@ class PhysicalModel extends SingleChildRenderObjectWidget { // POSITIONING AND SIZING NODES /// A widget that applies a transformation before painting its child. +/// +/// ## Sample code +/// +/// This example rotates and skews an orange box containing text, keeping the +/// top right corner pinned to its original position. +/// +/// ```dart +/// new Container( +/// color: Colors.black, +/// child: new Transform( +/// alignment: FractionalOffset.topRight, +/// transform: new Matrix4.skewY(0.3)..rotateZ(-math.PI / 12.0), +/// child: new Container( +/// padding: const EdgeInsets.all(8.0), +/// color: const Color(0xFFE8581C), +/// child: const Text('Apartment for rent!'), +/// ), +/// ), +/// ) +/// ``` +/// +/// See also: +/// * [RotatedBox], which rotates the child widget during layout, not just +/// during painting. +/// * [FittedBox], which sizes and positions its child widget to fit the parent +/// according to a given [BoxFit] discipline. class Transform extends SingleChildRenderObjectWidget { /// Creates a widget that transforms its child. /// @@ -617,10 +656,41 @@ class Transform extends SingleChildRenderObjectWidget { this.origin, this.alignment, this.transformHitTests: true, - Widget child + Widget child, }) : assert(transform != null), super(key: key, child: child); + /// Creates a widget that transforms its child using a rotation around the + /// center. + /// + /// The `angle` argument must not be null. It gives the rotation in clockwise + /// radians. + /// + /// ## Sample code + /// + /// This example rotates an orange box containing text around its center by + /// fifteen degrees. + /// + /// ```dart + /// new Transform.rotate( + /// angle: -math.PI / 12.0, + /// child: new Container( + /// padding: const EdgeInsets.all(8.0), + /// color: const Color(0xFFE8581C), + /// child: const Text('Apartment for rent!'), + /// ), + /// ) + /// ``` + Transform.rotate({ + Key key, + @required double angle, + this.origin, + this.alignment: FractionalOffset.center, + this.transformHitTests: true, + Widget child, + }) : transform = new Matrix4.rotationZ(angle), + super(key: key, child: child); + /// The matrix to transform the child by during painting. final Matrix4 transform; @@ -659,6 +729,11 @@ class Transform extends SingleChildRenderObjectWidget { } /// Scales and positions its child within itself according to [fit]. +/// +/// See also: +/// +/// * [Transform], which applies an arbitrary transform to its child widget at +/// paint time. class FittedBox extends SingleChildRenderObjectWidget { /// Creates a widget that scales and positions its child within itself according to [fit]. /// diff --git a/packages/flutter/lib/src/widgets/binding.dart b/packages/flutter/lib/src/widgets/binding.dart index f6649822e1..6bc6363af5 100644 --- a/packages/flutter/lib/src/widgets/binding.dart +++ b/packages/flutter/lib/src/widgets/binding.dart @@ -27,6 +27,50 @@ export 'dart:ui' show AppLifecycleState, Locale; /// handlers, or can used with the `implements` keyword, in which case all the /// handlers must be implemented (and the analyzer will list those that have /// been omitted). +/// +/// ## Sample code +/// +/// This [StatefulWidget] implements the parts of the [State] and +/// [WidgetsBindingObserver] protocols necessary to react to application +/// lifecycle messages. See [didChangeAppLifecycleState]. +/// +/// ```dart +/// class Reactor extends StatefulWidget { +/// const Reactor({ Key key }) : super(key: key); +/// +/// @override +/// _ReactorState createState() => new _ReactorState(); +/// } +/// +/// class _ReactorState extends State with WidgetsBindingObserver { +/// @override +/// void initState() { +/// super.initState(); +/// WidgetsBinding.instance.addObserver(this); +/// } +/// +/// @override +/// void dispose() { +/// WidgetsBinding.instance.removeObserver(this); +/// super.dispose(); +/// } +/// +/// AppLifecycleState _notification; +/// +/// @override +/// void didChangeAppLifecycleState(AppLifecycleState state) { +/// setState(() { _notification = state; }); +/// } +/// +/// @override +/// Widget build(BuildContext context) { +/// return new Text('Last notification: $_notification'); +/// } +/// } +/// ``` +/// +/// To respond to other notifications, replace the [didChangeAppLifecycleState] +/// method above with other methods from this class. abstract class WidgetsBindingObserver { /// Called when the system tells the app to pop the current route. /// For example, on Android, this is called when the user presses @@ -52,6 +96,56 @@ abstract class WidgetsBindingObserver { /// Called when the application's dimensions change. For example, /// when a phone is rotated. + /// + /// ## Sample code + /// + /// This [StatefulWidget] implements the parts of the [State] and + /// [WidgetsBindingObserver] protocols necessary to react when the device is + /// rotated (or otherwise changes dimensions). + /// + /// ```dart + /// class Reactor extends StatefulWidget { + /// const Reactor({ Key key }) : super(key: key); + /// + /// @override + /// _ReactorState createState() => new _ReactorState(); + /// } + /// + /// class _ReactorState extends State with WidgetsBindingObserver { + /// @override + /// void initState() { + /// super.initState(); + /// WidgetsBinding.instance.addObserver(this); + /// } + /// + /// @override + /// void dispose() { + /// WidgetsBinding.instance.removeObserver(this); + /// super.dispose(); + /// } + /// + /// Size _lastSize; + /// + /// @override + /// void didChangeMetrics() { + /// setState(() { _lastSize = ui.window.physicalSize; }); + /// } + /// + /// @override + /// Widget build(BuildContext context) { + /// return new Text('Last size: $_lastSize'); + /// } + /// } + /// ``` + /// + /// In general, this is unnecessary as the layout system takes care of + /// automatically recomputing the application geometry when the application + /// size changes. + /// + /// See also: + /// + /// * [MediaQuery.of], which provides a similar service with less + /// boilerplate. void didChangeMetrics() { } /// Called when the system tells the app that the user's locale has @@ -61,6 +155,9 @@ abstract class WidgetsBindingObserver { /// Called when the system puts the app in the background or returns /// the app to the foreground. + /// + /// An example of implementing this method is provided in the class-level + /// documentation for the [WidgetsBindingObserver] class. void didChangeAppLifecycleState(AppLifecycleState state) { } /// Called when the system is running low on memory. @@ -159,11 +256,21 @@ abstract class WidgetsBinding extends BindingBase with GestureBinding, RendererB /// [MediaQuery.of] static method and (implicitly) the /// [InheritedWidget] mechanism to be notified whenever the screen /// size changes (e.g. whenever the screen rotates). + /// + /// See also: + /// + /// * [removeObserver], to release the resources reserved by this method. + /// * [WidgetsBindingObserver], which has an example of using this method. void addObserver(WidgetsBindingObserver observer) => _observers.add(observer); /// Unregisters the given observer. This should be used sparingly as /// it is relatively expensive (O(N) in the number of registered /// observers). + /// + /// See also: + /// + /// * [addObserver], for the method that adds observers in the first place. + /// * [WidgetsBindingObserver], which has an example of using this method. bool removeObserver(WidgetsBindingObserver observer) => _observers.remove(observer); /// Called when the system metrics change. diff --git a/packages/flutter/lib/src/widgets/container.dart b/packages/flutter/lib/src/widgets/container.dart index 53f93bff09..98c0eec85f 100644 --- a/packages/flutter/lib/src/widgets/container.dart +++ b/packages/flutter/lib/src/widgets/container.dart @@ -146,7 +146,7 @@ class DecoratedBox extends SingleChildRenderObjectWidget { /// The [constraints] are set to fit the font size plus ample headroom /// vertically, while expanding horizontally to fit the parent. The [padding] is /// used to make sure there is space between the contents and the text. The -/// [color] makes the box teal. The [alignment] causes the [child] to be +/// `color` makes the box teal. The [alignment] causes the [child] to be /// centered in the box. The [foregroundDecoration] overlays a nine-patch image /// onto the text. Finally, the [transform] applies a slight rotation to the /// entire contraption to complete the effect. diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 3a7fb14c8f..a0f9fd8fee 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -1452,7 +1452,7 @@ abstract class ParentDataWidget extends ProxyWidge /// /// Sometimes, the `of` method returns the data rather than the inherited /// widget; for example, in this case it could have returned a [Color] instead -/// of the [FrogColor] widget. +/// of the `FrogColor` widget. /// /// Occasionally, the inherited widget is an implementation detail of another /// class, and is therefore private. The `of` method in that case is typically diff --git a/packages/flutter/lib/src/widgets/image.dart b/packages/flutter/lib/src/widgets/image.dart index 2a3dfac9a3..ee4011fa44 100644 --- a/packages/flutter/lib/src/widgets/image.dart +++ b/packages/flutter/lib/src/widgets/image.dart @@ -25,6 +25,15 @@ export 'package:flutter/services.dart' show /// /// This is the object that must be passed to [BoxPainter.paint] and to /// [ImageProvider.resolve]. +/// +/// If this is not called from a build method, then it should be reinvoked +/// whenever the dependencies change, e.g. by calling it from +/// [State.didChangeDependencies], so that any changes in the environement are +/// picked up (e.g. if the device pixel ratio changes). +/// +/// See also: +/// +/// * [ImageProvider], which has an example showing how this might be used. ImageConfiguration createLocalImageConfiguration(BuildContext context, { Size size }) { return new ImageConfiguration( bundle: DefaultAssetBundle.of(context), diff --git a/packages/flutter/lib/src/widgets/navigation_toolbar.dart b/packages/flutter/lib/src/widgets/navigation_toolbar.dart index 5a4ef6af2a..a03497c76b 100644 --- a/packages/flutter/lib/src/widgets/navigation_toolbar.dart +++ b/packages/flutter/lib/src/widgets/navigation_toolbar.dart @@ -13,7 +13,7 @@ import 'framework.dart'; /// widgets along a horizontal axis that's sensible for an application's /// navigation bar such as in Material Design and in iOS. /// -/// [leading] and [trailing] widgets occupy the edges of the widget with +/// The [leading] and [trailing] widgets occupy the edges of the widget with /// reasonable size constraints while the [middle] widget occupies the remaining /// space in either a center aligned or start aligned fashion. /// @@ -21,6 +21,8 @@ import 'framework.dart'; /// the iOS [CupertinoNavigationBar] or wrap this widget with more theming /// specifications for your own custom app bar. class NavigationToolbar extends StatelessWidget { + /// Creates a widget that lays out its children in a manner suitable for a + /// toolbar. const NavigationToolbar({ Key key, this.leading, diff --git a/packages/flutter/lib/src/widgets/nested_scroll_view.dart b/packages/flutter/lib/src/widgets/nested_scroll_view.dart index a68905bb85..05e2c9f26a 100644 --- a/packages/flutter/lib/src/widgets/nested_scroll_view.dart +++ b/packages/flutter/lib/src/widgets/nested_scroll_view.dart @@ -25,6 +25,11 @@ import 'sliver.dart'; import 'ticker_provider.dart'; /// Signature used by [NestedScrollView] for building its header. +/// +/// The `innerBoxIsScrolled` argument is typically used to control the +/// [SliverAppBar.forceElevated] property to ensure that the app bar shows a +/// shadow, since it would otherwise not necessarily be aware that it had +/// content ostensibly below it. typedef List NestedScrollViewHeaderSliversBuilder(BuildContext context, bool innerBoxIsScrolled); // TODO(abarth): Make this configurable with a controller. @@ -73,8 +78,18 @@ class NestedScrollView extends StatefulWidget { /// Defaults to matching platform conventions. final ScrollPhysics physics; + /// A builder for any widgets that are to precede the inner scroll views (as + /// given by [body]). + /// + /// Typically this is used to create a [SliverAppBar] with a [TabBar]. final NestedScrollViewHeaderSliversBuilder headerSliverBuilder; + /// The widget to show inside the [NestedScrollView]. + /// + /// Typically this will be [TabBarView]. + /// + /// The [body] is built in a context that provides a [PrimaryScrollController] + /// that interacts with the [NestedScrollView]'s scroll controller. final Widget body; List _buildSlivers(BuildContext context, ScrollController innerController, bool bodyIsScrolled) { diff --git a/packages/flutter/test/widgets/transform_test.dart b/packages/flutter/test/widgets/transform_test.dart index eb8c7cbdd7..928b209005 100644 --- a/packages/flutter/test/widgets/transform_test.dart +++ b/packages/flutter/test/widgets/transform_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:math' as math; + import 'package:flutter_test/flutter_test.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/widgets.dart'; @@ -171,4 +173,26 @@ void main() { final Matrix4 transform = layer.transform; expect(transform.getTranslation(), equals(new Vector3(100.0, 75.0, 0.0))); }); + + testWidgets('Transform.rotate', (WidgetTester tester) async { + await tester.pumpWidget( + new Transform.rotate( + angle: math.PI / 2.0, + child: new Opacity(opacity: 0.5, child: new Container()), + ), + ); + + final List layers = tester.layers + ..retainWhere((Layer layer) => layer is TransformLayer); + expect(layers.length, 2); + // The first transform is from the render view. + final TransformLayer layer = layers[1]; + final Matrix4 transform = layer.transform; + expect(transform.storage, [ + moreOrLessEquals(0.0), 1.0, 0.0, 0.0, + -1.0, moreOrLessEquals(0.0), 0.0, 0.0, + 0.0, 0.0, 1.0, 0.0, + 700.0, -100.0, 0.0, 1.0, + ]); + }); } diff --git a/packages/flutter_driver/lib/src/health.dart b/packages/flutter_driver/lib/src/health.dart index a146570ffe..da10a27e89 100644 --- a/packages/flutter_driver/lib/src/health.dart +++ b/packages/flutter_driver/lib/src/health.dart @@ -16,7 +16,6 @@ class GetHealth extends Command { GetHealth.deserialize(Map json) : super.deserialize(json); } -/// Application health status. enum HealthStatus { /// Application is known to be in a good shape and should be able to respond. ok, @@ -28,7 +27,6 @@ enum HealthStatus { final EnumIndex _healthStatusIndex = new EnumIndex(HealthStatus.values); -/// Application health status. class Health extends Result { /// Creates a [Health] object with the given [status]. Health(this.status) { @@ -40,7 +38,6 @@ class Health extends Result { return new Health(_healthStatusIndex.lookupBySimpleName(json['status'])); } - /// Health status final HealthStatus status; @override diff --git a/packages/flutter_test/lib/src/all_elements.dart b/packages/flutter_test/lib/src/all_elements.dart index b0db191d65..9cdca78e46 100644 --- a/packages/flutter_test/lib/src/all_elements.dart +++ b/packages/flutter_test/lib/src/all_elements.dart @@ -17,7 +17,7 @@ import 'package:flutter/widgets.dart'; /// one, for example the results of calling `where` on this iterable /// are also cached. Iterable collectAllElementsFrom(Element rootElement, { - @required bool skipOffstage + @required bool skipOffstage, }) { return new CachingIterable(new _DepthFirstChildIterator(rootElement, skipOffstage)); } diff --git a/packages/flutter_test/lib/src/binding.dart b/packages/flutter_test/lib/src/binding.dart index ee8ff34efe..b200029c54 100644 --- a/packages/flutter_test/lib/src/binding.dart +++ b/packages/flutter_test/lib/src/binding.dart @@ -89,6 +89,10 @@ abstract class TestWidgetsFlutterBinding extends BindingBase // Services binding omitted to avoid dragging in the licenses code. WidgetsBinding { + /// Constructor for [TestWidgetsFlutterBinding]. + /// + /// This constructor overrides the [debugPrint] global hook to point to + /// [debugPrintOverride], which can be overridden by subclasses. TestWidgetsFlutterBinding() { debugPrint = debugPrintOverride; } diff --git a/packages/flutter_test/lib/src/finders.dart b/packages/flutter_test/lib/src/finders.dart index 90a136b656..1e111c086f 100644 --- a/packages/flutter_test/lib/src/finders.dart +++ b/packages/flutter_test/lib/src/finders.dart @@ -236,6 +236,9 @@ abstract class Finder { /// [Offstage] widgets, as well as children of inactive [Route]s. final bool skipOffstage; + /// Returns all the [Element]s that will be considered by this finder. + /// + /// See [collectAllElementsFrom]. @protected Iterable get allCandidates { return collectAllElementsFrom(