diff --git a/packages/material_ui/example/analysis_options.yaml b/packages/material_ui/example/analysis_options.yaml index 561497259820..16500c69a9ca 100644 --- a/packages/material_ui/example/analysis_options.yaml +++ b/packages/material_ui/example/analysis_options.yaml @@ -1,5 +1,3 @@ -# This file is also used by dev/bots/analyze_snippet_code.dart to analyze code snippets (`{@tool snippet}` sections). - # The following line activates a set of recommended lints for Flutter apps, # packages, and plugins designed to encourage good coding practices. analyzer: diff --git a/packages/material_ui/lib/src/about.dart b/packages/material_ui/lib/src/about.dart index b534f31f56c6..aa93f685e28d 100644 --- a/packages/material_ui/lib/src/about.dart +++ b/packages/material_ui/lib/src/about.dart @@ -51,12 +51,15 @@ import 'theme.dart'; /// If your application does not have a [Drawer], you should provide an /// affordance to call [showAboutDialog] or (at least) [showLicensePage]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows two ways to open [AboutDialog]. The first one /// uses an [AboutListTile], and the second uses the [showAboutDialog] function. /// -/// ** See code in examples/api/lib/material/about/about_list_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/about/about_list_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. class AboutListTile extends StatelessWidget { /// Creates a list tile for showing an about box. /// diff --git a/packages/material_ui/lib/src/action_chip.dart b/packages/material_ui/lib/src/action_chip.dart index f7f405cd3736..ad5549771c39 100644 --- a/packages/material_ui/lib/src/action_chip.dart +++ b/packages/material_ui/lib/src/action_chip.dart @@ -45,12 +45,15 @@ enum _ChipVariant { flat, elevated } /// /// Requires one of its ancestors to be a [Material] widget. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create an [ActionChip] with a leading icon. /// The icon is updated when the [ActionChip] is pressed. /// -/// ** See code in examples/api/lib/material/action_chip/action_chip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/action_chip/action_chip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Material Design 3 /// diff --git a/packages/material_ui/lib/src/action_icons_theme.dart b/packages/material_ui/lib/src/action_icons_theme.dart index 04b4809616d6..a08374252afb 100644 --- a/packages/material_ui/lib/src/action_icons_theme.dart +++ b/packages/material_ui/lib/src/action_icons_theme.dart @@ -146,12 +146,15 @@ class ActionIconThemeData with Diagnosticable { /// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this /// widget's subtree. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to define custom builders for drawer and back /// buttons. /// -/// ** See code in examples/api/lib/material/action_buttons/action_icon_theme.0.dart ** -/// {@end-tool} +/// {@example /example/lib/action_buttons/action_icon_theme.0.dart} +/// +// TODO(framework): End of the @dartpad directive. class ActionIconTheme extends InheritedTheme { /// Creates a theme that overrides the default icon of [BackButtonIcon], /// [CloseButtonIcon], [DrawerButtonIcon], and [EndDrawerButtonIcon] in this diff --git a/packages/material_ui/lib/src/adaptive_text_selection_toolbar.dart b/packages/material_ui/lib/src/adaptive_text_selection_toolbar.dart index 1f77aa63c891..b4a5651b1755 100644 --- a/packages/material_ui/lib/src/adaptive_text_selection_toolbar.dart +++ b/packages/material_ui/lib/src/adaptive_text_selection_toolbar.dart @@ -239,12 +239,15 @@ class AdaptiveTextSelectionToolbar extends StatelessWidget { /// button appearance for the given platform, but where the toolbar and/or the /// button actions and labels may be custom. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to use `getAdaptiveButtons` to generate /// default button widgets in a custom toolbar. /// - /// ** See code in examples/api/lib/material/context_menu/editable_text_toolbar_builder.2.dart ** - /// {@end-tool} + /// {@example /example/lib/context_menu/editable_text_toolbar_builder.2.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/animated_icons/animated_icons.dart b/packages/material_ui/lib/src/animated_icons/animated_icons.dart index e3223202acc9..e544da1d9cb6 100644 --- a/packages/material_ui/lib/src/animated_icons/animated_icons.dart +++ b/packages/material_ui/lib/src/animated_icons/animated_icons.dart @@ -16,12 +16,15 @@ part of material_animated_icons; // ignore: use_string_in_part_of_directives /// /// {@youtube 560 315 https://www.youtube.com/watch?v=pJcbh8pbvJs} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create an animated icon. The icon is animated /// forward and reverse in a loop. /// -/// ** See code in examples/api/lib/material/animated_icon/animated_icon.0.dart ** -/// {@end-tool} +/// {@example /example/lib/animated_icon/animated_icon.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/animated_icons/animated_icons_data.dart b/packages/material_ui/lib/src/animated_icons/animated_icons_data.dart index 2d197a6a8fee..889618532f5a 100644 --- a/packages/material_ui/lib/src/animated_icons/animated_icons_data.dart +++ b/packages/material_ui/lib/src/animated_icons/animated_icons_data.dart @@ -14,12 +14,15 @@ part of material_animated_icons; // ignore: use_string_in_part_of_directives /// /// Use with [AnimatedIcon] class to show specific animated icons. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create an animated icon. The icon is animated /// forward and reverse in a loop. /// -/// ** See code in examples/api/lib/material/animated_icon/animated_icons_data.0.dart ** -/// {@end-tool} +/// {@example /example/lib/animated_icon/animated_icons_data.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/app.dart b/packages/material_ui/lib/src/app.dart index ae9a02b8c496..fdfef4617901 100644 --- a/packages/material_ui/lib/src/app.dart +++ b/packages/material_ui/lib/src/app.dart @@ -118,7 +118,11 @@ enum ThemeMode { /// If [home], [routes], [onGenerateRoute], and [onUnknownRoute] are all null, /// and [builder] is not null, then no [Navigator] is created. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This example shows how to create a [MaterialApp] that disables the "debug" /// banner with a [home] route that will be displayed when the app is launched. /// @@ -134,9 +138,14 @@ enum ThemeMode { /// debugShowCheckedModeBanner: false, /// ) /// ``` -/// {@end-tool} /// -/// {@tool snippet} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This example shows how to create a [MaterialApp] that uses the [routes] /// `Map` to define the "home" route and an "about" route. /// @@ -160,9 +169,14 @@ enum ThemeMode { /// }, /// ) /// ``` -/// {@end-tool} /// -/// {@tool snippet} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This example shows how to create a [MaterialApp] that defines a [theme] that /// will be used for material widgets in the app. /// @@ -181,7 +195,8 @@ enum ThemeMode { /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Troubleshooting /// @@ -679,7 +694,11 @@ class MaterialApp extends StatefulWidget { final bool debugShowCheckedModeBanner; /// {@macro flutter.widgets.widgetsApp.shortcuts} - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to add a single shortcut for /// [LogicalKeyboardKey.select] to the default shortcuts without needing to /// add your own [Shortcuts] widget. @@ -702,12 +721,17 @@ class MaterialApp extends StatefulWidget { /// ); /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@macro flutter.widgets.widgetsApp.shortcuts.seeAlso} final Map? shortcuts; /// {@macro flutter.widgets.widgetsApp.actions} - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to add a single action handling an /// [ActivateAction] to the default actions without needing to /// add your own [Actions] widget. @@ -735,7 +759,8 @@ class MaterialApp extends StatefulWidget { /// ); /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@macro flutter.widgets.widgetsApp.actions.seeAlso} final Map>? actions; @@ -791,12 +816,15 @@ class MaterialApp extends StatefulWidget { /// /// To disable the theme animation, use [AnimationStyle.noAnimation]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override the theme animation curve and /// duration in the [MaterialApp] widget using [AnimationStyle]. /// - /// ** See code in examples/api/lib/material/app/app.0.dart ** - /// {@end-tool} + /// {@example /example/lib/app/app.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final AnimationStyle? themeAnimationStyle; @override diff --git a/packages/material_ui/lib/src/app_bar.dart b/packages/material_ui/lib/src/app_bar.dart index cdbb452b5009..569451926577 100644 --- a/packages/material_ui/lib/src/app_bar.dart +++ b/packages/material_ui/lib/src/app_bar.dart @@ -123,21 +123,27 @@ class _PreferredAppBarSize extends Size { /// to suddenly jump. Wrap the [AppBar] in a [MediaQuery] widget, and adjust its /// padding such that the animation is smooth. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows an [AppBar] with two simple actions. The first action /// opens a [SnackBar], while the second action navigates to a new page. /// -/// ** See code in examples/api/lib/material/app_bar/app_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/app_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// Material Design 3 introduced new types of app bar. -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows the creation of an [AppBar] widget with the [shadowColor] and /// [scrolledUnderElevation] properties set, as described in: /// https://m3.material.io/components/top-app-bar/overview /// -/// ** See code in examples/api/lib/material/app_bar/app_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/app_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Troubleshooting /// @@ -157,20 +163,26 @@ class _PreferredAppBarSize extends Size { /// [ColorScheme.primary]. To remedy the problem, override /// [TextButton.style]: /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows an [AppBar] with two action buttons with their primary /// color set to [ColorScheme.onPrimary]. /// -/// ** See code in examples/api/lib/material/app_bar/app_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/app_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to listen to a nested Scrollable's scroll notification /// in a nested scroll view using the [notificationPredicate] property and use it /// to make [scrolledUnderElevation] take effect. /// -/// ** See code in examples/api/lib/material/app_bar/app_bar.3.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/app_bar.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -260,7 +272,10 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { /// will use a [BackButton] that calls [Navigator.maybePop]. /// {@endtemplate} /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// The following code shows how the drawer button could be manually specified /// instead of relying on [automaticallyImplyLeading]: @@ -278,7 +293,8 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { /// ), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// The [Builder] is used in this example to ensure that the `context` refers /// to that part of the subtree. That way this code snippet can be used even @@ -357,7 +373,10 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { /// widget with an [IconButton] that opens the end drawer (using [Icons.menu]). /// {@endtemplate} /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Scaffold( @@ -381,7 +400,8 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { /// ), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final List? actions; /// {@template flutter.material.appbar.automaticallyImplyActions} @@ -508,12 +528,16 @@ class AppBar extends StatefulWidget implements PreferredSizeWidget { /// zero. /// {@endtemplate} /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to implement a custom app bar shape for the /// [shape] property. /// - /// ** See code in examples/api/lib/material/app_bar/app_bar.4.dart ** - /// {@end-tool} + /// {@example /example/lib/app_bar/app_bar.4.dart} + /// + // TODO(framework): End of the @dartpad directive. + /// /// See also: /// /// * [elevation], which defines the size of the shadow below the app bar. @@ -1492,7 +1516,10 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { /// [actions], above the [bottom] (if any). If a [flexibleSpace] widget is /// specified then it is stacked behind the toolbar and the bottom widget. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This is an example that could be included in a [CustomScrollView]'s /// [CustomScrollView.slivers] list: @@ -1512,21 +1539,28 @@ class _SliverAppBarDelegate extends SliverPersistentHeaderDelegate { /// ] /// ) /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of [SliverAppBar] when using [stretch] and [onStretchTrigger]. /// -/// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.4.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/sliver_app_bar.4.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// /// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows a [SliverAppBar] and its behavior when using the /// [pinned], [snap] and [floating] parameters. /// -/// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/app_bar/sliver_app_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Animated Examples /// @@ -1626,11 +1660,14 @@ class SliverAppBar extends StatefulWidget { /// title will fade in on the main row. The reverse will happen if it is /// expanded again. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [SliverAppBar.medium] in a [CustomScrollView]. /// - /// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.2.dart ** - /// {@end-tool} + /// {@example /example/lib/app_bar/sliver_app_bar.2.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1697,11 +1734,14 @@ class SliverAppBar extends StatefulWidget { /// title will fade in on the main row. The reverse will happen if it is /// expanded again. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [SliverAppBar.large] in a [CustomScrollView]. /// - /// ** See code in examples/api/lib/material/app_bar/sliver_app_bar.3.dart ** - /// {@end-tool} + /// {@example /example/lib/app_bar/sliver_app_bar.3.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/autocomplete.dart b/packages/material_ui/lib/src/autocomplete.dart index d37a901acf18..627049497815 100644 --- a/packages/material_ui/lib/src/autocomplete.dart +++ b/packages/material_ui/lib/src/autocomplete.dart @@ -14,43 +14,58 @@ import 'theme.dart'; /// /// {@youtube 560 315 https://www.youtube.com/watch?v=-Nny8kzW380} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create a very basic Autocomplete widget using the /// default UI. /// -/// ** See code in examples/api/lib/material/autocomplete/autocomplete.0.dart ** -/// {@end-tool} +/// {@example /example/lib/autocomplete/autocomplete.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to create an Autocomplete widget with a custom type. /// Try searching with text from the name or email field. /// -/// ** See code in examples/api/lib/material/autocomplete/autocomplete.1.dart ** -/// {@end-tool} +/// {@example /example/lib/autocomplete/autocomplete.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to create an Autocomplete widget whose options are /// fetched over the network. /// -/// ** See code in examples/api/lib/material/autocomplete/autocomplete.2.dart ** -/// {@end-tool} +/// {@example /example/lib/autocomplete/autocomplete.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to create an Autocomplete widget whose options are /// fetched over the network. It uses debouncing to wait to perform the network /// request until after the user finishes typing. /// -/// ** See code in examples/api/lib/material/autocomplete/autocomplete.3.dart ** -/// {@end-tool} +/// {@example /example/lib/autocomplete/autocomplete.3.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to create an Autocomplete widget whose options are /// fetched over the network. It includes both debouncing and error handling, so /// that failed network requests show an error to the user and can be recovered /// from. Try toggling the network Switch widget to simulate going offline. /// -/// ** See code in examples/api/lib/material/autocomplete/autocomplete.4.dart ** -/// {@end-tool} +/// {@example /example/lib/autocomplete/autocomplete.4.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/badge.dart b/packages/material_ui/lib/src/badge.dart index cda14987c03a..43dd3950484e 100644 --- a/packages/material_ui/lib/src/badge.dart +++ b/packages/material_ui/lib/src/badge.dart @@ -31,12 +31,15 @@ import 'theme.dart'; /// configuration is intended to work well with a default sized (24) /// [Icon]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create a [Badge] with label and count /// wrapped on an icon in an [IconButton]. /// -/// ** See code in examples/api/lib/material/badge/badge.0.dart ** -/// {@end-tool} +/// {@example /example/lib/badge/badge.0.dart} +/// +// TODO(framework): End of the @dartpad directive. class Badge extends StatelessWidget { /// Create a Badge that stacks [label] on top of [child]. /// diff --git a/packages/material_ui/lib/src/banner.dart b/packages/material_ui/lib/src/banner.dart index 482369255ee4..f64704937197 100644 --- a/packages/material_ui/lib/src/banner.dart +++ b/packages/material_ui/lib/src/banner.dart @@ -71,18 +71,24 @@ enum MaterialBannerClosedReason { /// They are persistent and non-modal, allowing the user to either ignore them or /// interact with them at any time. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Banners placed directly into the widget tree are static. /// -/// ** See code in examples/api/lib/material/banner/material_banner.0.dart ** -/// {@end-tool} +/// {@example /example/lib/banner/material_banner.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// MaterialBanner's can also be presented through a [ScaffoldMessenger]. /// Here is an example where ScaffoldMessengerState.showMaterialBanner() is used to show the MaterialBanner. /// -/// ** See code in examples/api/lib/material/banner/material_banner.1.dart ** -/// {@end-tool} +/// {@example /example/lib/banner/material_banner.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// The [actions] will be placed beside the [content] if there is only one. /// Otherwise, the [actions] will be placed below the [content]. Use diff --git a/packages/material_ui/lib/src/bottom_app_bar.dart b/packages/material_ui/lib/src/bottom_app_bar.dart index b3ff0e3c71e7..41849b89592f 100644 --- a/packages/material_ui/lib/src/bottom_app_bar.dart +++ b/packages/material_ui/lib/src/bottom_app_bar.dart @@ -27,7 +27,11 @@ import 'theme.dart'; /// /// Typically used with a [Scaffold] and a [FloatingActionButton]. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// ```dart /// Scaffold( /// bottomNavigationBar: BottomAppBar( @@ -37,24 +41,31 @@ import 'theme.dart'; /// floatingActionButton: const FloatingActionButton(onPressed: null), /// ) /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows the [BottomAppBar], which can be configured to have a notch using the /// [BottomAppBar.shape] property. This also includes an optional [FloatingActionButton], which illustrates /// the [FloatingActionButtonLocation]s in relation to the [BottomAppBar]. /// -/// ** See code in examples/api/lib/material/bottom_app_bar/bottom_app_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_app_bar/bottom_app_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows Material 3 [BottomAppBar] with its expected look and behaviors. /// /// This also includes an optional [FloatingActionButton], which illustrates /// the [FloatingActionButtonLocation.endContained]. /// -/// ** See code in examples/api/lib/material/bottom_app_bar/bottom_app_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_app_bar/bottom_app_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/bottom_navigation_bar.dart b/packages/material_ui/lib/src/bottom_navigation_bar.dart index 961bb801bade..710b1eedd1a7 100644 --- a/packages/material_ui/lib/src/bottom_navigation_bar.dart +++ b/packages/material_ui/lib/src/bottom_navigation_bar.dart @@ -134,7 +134,9 @@ enum BottomNavigationBarLandscapeLayout { /// /// ## Using [BottomNavigationBar] /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem] /// widgets, which means it defaults to [BottomNavigationBarType.fixed], and @@ -142,17 +144,23 @@ enum BottomNavigationBarLandscapeLayout { /// amber. The `_onItemTapped` function changes the selected item's index /// and displays a corresponding message in the center of the [Scaffold]. /// -/// ** See code in examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_navigation_bar/bottom_navigation_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how you would migrate the above [BottomNavigationBar] /// to the new [NavigationBar]. /// -/// ** See code in examples/api/lib/material/navigation_bar/navigation_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_bar/navigation_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has four [BottomNavigationBarItem] /// widgets, which means it defaults to [BottomNavigationBarType.shifting], and @@ -163,17 +171,21 @@ enum BottomNavigationBarLandscapeLayout { /// selected item's index and displays a corresponding message in the center of /// the [Scaffold]. /// -/// ** See code in examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_navigation_bar/bottom_navigation_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows [BottomNavigationBar] used in a [Scaffold] Widget with /// different interaction patterns. Tapping twice on the first [BottomNavigationBarItem] /// uses the [ScrollController] to animate the [ListView] to the top. The second /// [BottomNavigationBarItem] shows a Modal Dialog. /// -/// ** See code in examples/api/lib/material/bottom_navigation_bar/bottom_navigation_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_navigation_bar/bottom_navigation_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// See also: /// /// * [BottomNavigationBarItem] diff --git a/packages/material_ui/lib/src/bottom_sheet.dart b/packages/material_ui/lib/src/bottom_sheet.dart index ff719beb6133..e9c9180c7d8c 100644 --- a/packages/material_ui/lib/src/bottom_sheet.dart +++ b/packages/material_ui/lib/src/bottom_sheet.dart @@ -1228,21 +1228,27 @@ class ModalBottomSheetRoute extends PopupRoute { /// Will default to [MaterialLocalizations.modalBarrierDismissLabel] of context /// if not set. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example demonstrates how to use [showModalBottomSheet] to display a /// bottom sheet that obscures the content behind it when a user taps a button. /// It also demonstrates how to close the bottom sheet using the [Navigator] /// when a user taps on a button inside the bottom sheet. /// -/// ** See code in examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.0.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_sheet/show_modal_bottom_sheet.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of [showModalBottomSheet], as described in: /// https://m3.material.io/components/bottom-sheets/overview /// -/// ** See code in examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.1.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_sheet/show_modal_bottom_sheet.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// The [sheetAnimationStyle] parameter is used to override the modal bottom sheet /// animation duration and reverse animation duration. @@ -1261,12 +1267,15 @@ class ModalBottomSheetRoute extends PopupRoute { /// /// To disable the bottom sheet animation, use [AnimationStyle.noAnimation]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample showcases how to override the [showModalBottomSheet] animation /// duration and reverse animation duration using [AnimationStyle]. /// -/// ** See code in examples/api/lib/material/bottom_sheet/show_modal_bottom_sheet.2.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_sheet/show_modal_bottom_sheet.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1365,12 +1374,15 @@ Future showModalBottomSheet({ /// /// To disable the bottom sheet animation, use [AnimationStyle.noAnimation]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample showcases how to override the [showBottomSheet] animation /// duration and reverse animation duration using [AnimationStyle]. /// -/// ** See code in examples/api/lib/material/bottom_sheet/show_bottom_sheet.0.dart ** -/// {@end-tool} +/// {@example /example/lib/bottom_sheet/show_bottom_sheet.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// To rebuild the bottom sheet (e.g. if it is stateful), call /// [PersistentBottomSheetController.setState] on the controller returned by diff --git a/packages/material_ui/lib/src/button_style.dart b/packages/material_ui/lib/src/button_style.dart index e251296f42ed..673bbf2dc85b 100644 --- a/packages/material_ui/lib/src/button_style.dart +++ b/packages/material_ui/lib/src/button_style.dart @@ -146,11 +146,14 @@ typedef ButtonLayerBuilder = /// | Outlined | [OutlinedButton] | /// | Text | [TextButton] | /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to create each of the Material 3 button types with Flutter. /// -/// ** See code in examples/api/lib/material/button_style/button_style.0.dart ** -/// {@end-tool} +/// {@example /example/lib/button_style/button_style.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/button_style_button.dart b/packages/material_ui/lib/src/button_style_button.dart index 7c14c6316bdf..65e12b9b9378 100644 --- a/packages/material_ui/lib/src/button_style_button.dart +++ b/packages/material_ui/lib/src/button_style_button.dart @@ -44,12 +44,15 @@ import 'tooltip.dart'; /// /// Defaults to [IconAlignment.start]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to use `iconAlignment` to align the button icon to the start /// or the end of the button. /// -/// ** See code in examples/api/lib/material/icon_alignment/icon_alignment.0.dart ** -/// {@end-tool} +/// {@example /example/lib/icon_alignment/icon_alignment.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// {@endtemplate} enum IconAlignment { diff --git a/packages/material_ui/lib/src/card.dart b/packages/material_ui/lib/src/card.dart index d841fa93b7b3..09ebec9b9ca1 100644 --- a/packages/material_ui/lib/src/card.dart +++ b/packages/material_ui/lib/src/card.dart @@ -29,23 +29,29 @@ enum _CardVariant { elevated, filled, outlined } /// some text describing a musical, and the other with buttons for buying /// tickets or listening to the show.](https://flutter.github.io/assets-for-api-docs/assets/material/card.png) /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows creation of a [Card] widget that shows album information /// and two actions. /// -/// ** See code in examples/api/lib/material/card/card.0.dart ** -/// {@end-tool} +/// {@example /example/lib/card/card.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// Sometimes the primary action area of a card is the card itself. Cards can be /// one large touch target that shows a detail screen when tapped. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows creation of a [Card] widget that can be tapped. When /// tapped this [Card]'s [InkWell] displays an "ink splash" that fills the /// entire card. /// -/// ** See code in examples/api/lib/material/card/card.1.dart ** -/// {@end-tool} +/// {@example /example/lib/card/card.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// For Material Design 2 (when [ThemeData.useMaterial3] is false), there is a /// single card type: the elevated card. In that mode the named constructors @@ -57,12 +63,15 @@ enum _CardVariant { elevated, filled, outlined } /// so theme properties (for example [CardThemeData.shape]) apply to every card /// variant within the theme's scope. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows creation of [Card] widgets for elevated, filled and /// outlined types, as described in: https://m3.material.io/components/cards/overview /// -/// ** See code in examples/api/lib/material/card/card.2.dart ** -/// {@end-tool} +/// {@example /example/lib/card/card.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/carousel.dart b/packages/material_ui/lib/src/carousel.dart index f3d3127bf81d..7ef95af25ef5 100644 --- a/packages/material_ui/lib/src/carousel.dart +++ b/packages/material_ui/lib/src/carousel.dart @@ -51,7 +51,10 @@ import 'theme.dart'; /// [CarouselView.weighted] is used, then set the [flexWeights] to only have /// one integer in the array. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This code snippet shows how to get a vertical full-screen carousel by using /// [itemExtent] in [CarouselView]. @@ -82,7 +85,8 @@ import 'theme.dart'; /// ), /// ), /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// In [CarouselView.weighted], weights are relative proportions. For example, /// if the layout weights is `[3, 2, 1]`, it means the first visible item occupies @@ -108,7 +112,9 @@ import 'theme.dart'; /// visible items may be slightly compressed during scrolling. The [shrinkExtent] /// property controls the minimum allowable size for these compressed items. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example to show different carousel layouts that [CarouselView] /// and [CarouselView.weighted] can build. /// @@ -121,8 +127,9 @@ import 'theme.dart'; /// This key-driven behavior is dictated by the [ScrollBehavior.pointerAxisModifiers], /// while [ScrollBehavior.dragDevices] manages what devices can drag a scrollable. /// -/// ** See code in examples/api/lib/material/carousel/carousel.0.dart ** -/// {@end-tool} +/// {@example /example/lib/carousel/carousel.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -229,11 +236,14 @@ class CarouselView extends StatefulWidget { /// The [itemBuilder] callback will be called only with indices greater than /// or equal to zero and less than [itemCount]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to create a carousel with 1000 items using lazy loading: /// - /// ** See code in examples/api/lib/material/carousel/carousel.1.dart ** - /// {@end-tool} + /// {@example /example/lib/carousel/carousel.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -274,7 +284,11 @@ class CarouselView extends StatefulWidget { /// The [flexWeights] parameter determines the layout, and [itemBuilder] /// creates items as they become visible. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to create a weighted carousel with lazy loading: /// /// ```dart @@ -291,7 +305,8 @@ class CarouselView extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/checkbox.dart b/packages/material_ui/lib/src/checkbox.dart index 1330063ade06..1a6e53f4dbd6 100644 --- a/packages/material_ui/lib/src/checkbox.dart +++ b/packages/material_ui/lib/src/checkbox.dart @@ -40,21 +40,27 @@ enum _CheckboxType { material, adaptive } /// /// Requires one of its ancestors to be a [Material] widget. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how you can override the default theme of /// a [Checkbox] with a [WidgetStateProperty]. /// In this example, the checkbox's color will be `Colors.blue` when the [Checkbox] /// is being pressed, hovered, or focused. Otherwise, the checkbox's color will /// be `Colors.red`. /// -/// ** See code in examples/api/lib/material/checkbox/checkbox.0.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox/checkbox.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows what the checkbox error state looks like. /// -/// ** See code in examples/api/lib/material/checkbox/checkbox.1.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox/checkbox.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -215,7 +221,11 @@ class Checkbox extends StatefulWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [fillColor] based on the current [WidgetState] /// of the [Checkbox], providing a different [Color] when it is /// [WidgetState.disabled]. @@ -232,7 +242,8 @@ class Checkbox extends StatefulWidget { /// }) /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// If null, then the value of [activeColor] is used in the selected diff --git a/packages/material_ui/lib/src/checkbox_list_tile.dart b/packages/material_ui/lib/src/checkbox_list_tile.dart index b1ad98f78c68..5bf87f9e0670 100644 --- a/packages/material_ui/lib/src/checkbox_list_tile.dart +++ b/packages/material_ui/lib/src/checkbox_list_tile.dart @@ -61,7 +61,11 @@ enum _CheckboxType { material, adaptive } /// In this case, one can wrap a [Material] widget around the [CheckboxListTile], /// e.g.: /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// ```dart /// ColoredBox( /// color: Colors.green, @@ -75,7 +79,8 @@ enum _CheckboxType { material, adaptive } /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Performance considerations when wrapping [CheckboxListTile] with [Material] /// @@ -86,7 +91,9 @@ enum _CheckboxType { material, adaptive } /// To show the [CheckboxListTile] as disabled, pass null as the [onChanged] /// callback. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![CheckboxListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile.png) /// /// This widget shows a checkbox that, when checked, slows down all animations @@ -95,15 +102,19 @@ enum _CheckboxType { material, adaptive } /// This sample requires that you also import 'package:flutter/scheduler.dart', /// so that you can reference [timeDilation]. /// -/// ** See code in examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox_list_tile/checkbox_list_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample demonstrates how [CheckboxListTile] positions the checkbox widget /// relative to the text in different configurations. /// -/// ** See code in examples/api/lib/material/checkbox_list_tile/checkbox_list_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox_list_tile/checkbox_list_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Semantics in CheckboxListTile /// @@ -122,15 +133,18 @@ enum _CheckboxType { material, adaptive } /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Checkbox list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_semantics.png) /// /// Here is an example of a custom labeled checkbox widget, called /// LinkedLabelCheckbox, that includes an interactive [RichText] widget that /// handles tap gestures. /// -/// ** See code in examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.0.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox_list_tile/custom_labeled_checkbox.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## CheckboxListTile isn't exactly what I want /// @@ -139,14 +153,17 @@ enum _CheckboxType { material, adaptive } /// combining [Checkbox] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Custom checkbox list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/checkbox_list_tile_custom.png) /// /// Here is an example of a custom LabeledCheckbox widget, but you can easily /// make your own configurable widget. /// -/// ** See code in examples/api/lib/material/checkbox_list_tile/custom_labeled_checkbox.1.dart ** -/// {@end-tool} +/// {@example /example/lib/checkbox_list_tile/custom_labeled_checkbox.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -279,7 +296,10 @@ class CheckboxListTile extends StatelessWidget { /// /// If null, the checkbox will be displayed as disabled. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// The callback provided to [onChanged] should update the state of the parent /// [StatefulWidget] using the [State.setState] method, so that the parent @@ -296,7 +316,8 @@ class CheckboxListTile extends StatelessWidget { /// title: const Text('Throw away your shot'), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final ValueChanged? onChanged; /// The cursor for a mouse pointer when it enters or is hovering over the diff --git a/packages/material_ui/lib/src/chip.dart b/packages/material_ui/lib/src/chip.dart index 1731b1dc1699..93601ea6735c 100644 --- a/packages/material_ui/lib/src/chip.dart +++ b/packages/material_ui/lib/src/chip.dart @@ -244,11 +244,14 @@ abstract interface class ChipAttributes { /// Specifying this parameter enables creation of avatar smaller than /// the minimum size, but it is not recommended. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [avatarBoxConstraints] to adjust avatar size constraints /// - /// ** See code in examples/api/lib/material/chip/chip_attributes.avatar_box_constraints.0.dart ** - /// {@end-tool} + /// {@example /example/lib/chip/chip_attributes.avatar_box_constraints.0.dart} + /// + // TODO(framework): End of the @dartpad directive. BoxConstraints? get avatarBoxConstraints; /// Used to override the default chip animations durations. @@ -269,12 +272,15 @@ abstract interface class ChipAttributes { /// is provided, it will be used to override the chip delete icon animation duration. /// If it is null, then default duration will be 150ms. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override the chip animations durations using /// [ChipAnimationStyle]. /// - /// ** See code in examples/api/lib/material/chip/chip_attributes.chip_animation_style.0.dart ** - /// {@end-tool} + /// {@example /example/lib/chip/chip_attributes.chip_animation_style.0.dart} + /// + // TODO(framework): End of the @dartpad directive. ChipAnimationStyle? get chipAnimationStyle; /// The cursor for a mouse pointer when it enters or is hovering over the @@ -328,12 +334,15 @@ abstract interface class DeletableChipAttributes { /// that the user tapped the delete button. In order to delete the chip, you /// have to do something similar to the following sample: /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [onDeleted] to remove an entry when the /// delete button is tapped. /// - /// ** See code in examples/api/lib/material/chip/deletable_chip_attributes.on_deleted.0.dart ** - /// {@end-tool} + /// {@example /example/lib/chip/deletable_chip_attributes.on_deleted.0.dart} + /// + // TODO(framework): End of the @dartpad directive. VoidCallback? get onDeleted; /// Used to define the delete icon's color with an [IconTheme] that @@ -367,12 +376,15 @@ abstract interface class DeletableChipAttributes { /// Specifying this parameter enables creation of delete icon smaller than /// the minimum size, but it is not recommended. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [deleteIconBoxConstraints] to adjust delete icon /// size constraints. /// - /// ** See code in examples/api/lib/material/chip/deletable_chip_attributes.delete_icon_box_constraints.0.dart ** - /// {@end-tool} + /// {@example /example/lib/chip/deletable_chip_attributes.delete_icon_box_constraints.0.dart} + /// + // TODO(framework): End of the @dartpad directive. BoxConstraints? get deleteIconBoxConstraints; } @@ -448,7 +460,10 @@ abstract interface class SelectableChipAttributes { /// The [onSelected] and [TappableChipAttributes.onPressed] callbacks must not /// both be specified at the same time. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// A [StatefulWidget] that illustrates use of onSelected in an [InputChip]. /// @@ -477,7 +492,8 @@ abstract interface class SelectableChipAttributes { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. ValueChanged? get onSelected; /// Elevation to be applied on the chip relative to its parent during the @@ -579,7 +595,10 @@ abstract interface class TappableChipAttributes { /// taps on the label or avatar parts of the chip. If [onPressed] is null, /// then the chip will be disabled. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// class Blacksmith extends StatelessWidget { @@ -598,7 +617,8 @@ abstract interface class TappableChipAttributes { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. VoidCallback? get onPressed; /// Elevation to be applied on the chip relative to its parent during the @@ -658,7 +678,10 @@ class ChipAnimationStyle { /// [MaterialApp] and [Scaffold]. The [label] and [clipBehavior] arguments must /// not be null. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Chip( @@ -669,7 +692,8 @@ class ChipAnimationStyle { /// label: const Text('Aaron Burr'), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/chip_theme.dart b/packages/material_ui/lib/src/chip_theme.dart index cb0fbb189fbd..9d931d76ebdd 100644 --- a/packages/material_ui/lib/src/chip_theme.dart +++ b/packages/material_ui/lib/src/chip_theme.dart @@ -62,7 +62,10 @@ class ChipTheme extends InheritedTheme { /// Defaults to the ambient [ThemeData.chipTheme] if there is no /// [ChipTheme] in the given build context. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// class Spaceship extends StatelessWidget { @@ -80,7 +83,8 @@ class ChipTheme extends InheritedTheme { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -122,7 +126,10 @@ class ChipTheme extends InheritedTheme { /// you get from [ChipTheme.of], or create an entirely new one with /// [ChipThemeData.fromDefaults]. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// class CarColor extends StatefulWidget { @@ -152,7 +159,8 @@ class ChipTheme extends InheritedTheme { /// } /// } /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/choice_chip.dart b/packages/material_ui/lib/src/choice_chip.dart index 046d2805d7b5..0e886f3ffacf 100644 --- a/packages/material_ui/lib/src/choice_chip.dart +++ b/packages/material_ui/lib/src/choice_chip.dart @@ -30,12 +30,15 @@ enum _ChipVariant { flat, elevated } /// /// Requires one of its ancestors to be a [Material] widget. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create [ChoiceChip]s with [onSelected]. When the /// user taps, the chip will be selected. /// -/// ** See code in examples/api/lib/material/choice_chip/choice_chip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/choice_chip/choice_chip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Material Design 3 /// diff --git a/packages/material_ui/lib/src/circle_avatar.dart b/packages/material_ui/lib/src/circle_avatar.dart index 2921f6692065..d5d5cc579015 100644 --- a/packages/material_ui/lib/src/circle_avatar.dart +++ b/packages/material_ui/lib/src/circle_avatar.dart @@ -29,7 +29,10 @@ import 'theme.dart'; /// The [onForegroundImageError] parameter must be null if the [foregroundImage] /// is null. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// If the avatar is to have an image, the image should be specified in the /// [backgroundImage] property: @@ -39,11 +42,15 @@ import 'theme.dart'; /// backgroundImage: NetworkImage(userAvatarUrl), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// The image will be cropped to have a circle shape. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// If the avatar is to just have the user's initials, they are typically /// provided using a [Text] widget as the [child] and a [backgroundColor]: @@ -54,7 +61,8 @@ import 'theme.dart'; /// child: const Text('AH'), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/color_scheme.dart b/packages/material_ui/lib/src/color_scheme.dart index f142daf0d216..e5d7d16920db 100644 --- a/packages/material_ui/lib/src/color_scheme.dart +++ b/packages/material_ui/lib/src/color_scheme.dart @@ -114,12 +114,15 @@ enum DynamicSchemeVariant { /// with on '-Fixed' roles, such as [onPrimaryFixed], they provide a /// lower-emphasis option for text and icons. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows all Material [ColorScheme] roles in light and dark /// brightnesses. /// -/// ** See code in examples/api/lib/material/color_scheme/color_scheme.0.dart ** -/// {@end-tool} +/// {@example /example/lib/color_scheme/color_scheme.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ### Setting Colors in Flutter /// @@ -251,13 +254,16 @@ class ColorScheme with Diagnosticable { /// -1.0 is the lowest; 1.0 is the highest. From Material Design guideline, the /// medium and high contrast correspond to 0.5 and 1.0 respectively. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [ColorScheme.fromSeed] to create dynamic /// color schemes with different [DynamicSchemeVariant]s and different /// contrast level. /// - /// ** See code in examples/api/lib/material/color_scheme/color_scheme.0.dart ** - /// {@end-tool} + /// {@example /example/lib/color_scheme/color_scheme.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -429,7 +435,11 @@ class ColorScheme with Diagnosticable { /// For Material 3, use [ColorScheme.fromSeed] to create a color scheme /// from a single seed color based on the Material 3 color system. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example demonstrates how to create a color scheme similar to [ColorScheme.light] /// using the [ColorScheme.fromSeed] constructor: /// @@ -443,7 +453,8 @@ class ColorScheme with Diagnosticable { /// onError: Colors.white, /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. const ColorScheme.light({ this.brightness = Brightness.light, this.primary = const Color(0xff6200ee), @@ -519,7 +530,11 @@ class ColorScheme with Diagnosticable { /// Override the `brightness` property of [ColorScheme.fromSeed] to create a /// dark color scheme. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example demonstrates how to create a color scheme similar to [ColorScheme.dark] /// using the [ColorScheme.fromSeed] constructor: /// @@ -536,7 +551,8 @@ class ColorScheme with Diagnosticable { /// onError: Colors.black, /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. const ColorScheme.dark({ this.brightness = Brightness.dark, this.primary = const Color(0xffbb86fc), @@ -611,7 +627,11 @@ class ColorScheme with Diagnosticable { /// from a single seed color based on the Material 3 color system. To create a /// high-contrast color scheme, set `contrastLevel` to 1.0. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example demonstrates how to create a color scheme similar to [ColorScheme.highContrastLight] /// using the [ColorScheme.fromSeed] constructor: /// @@ -625,7 +645,8 @@ class ColorScheme with Diagnosticable { /// onError: Colors.white, /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. const ColorScheme.highContrastLight({ this.brightness = Brightness.light, this.primary = const Color(0xff0000ba), @@ -702,7 +723,11 @@ class ColorScheme with Diagnosticable { /// dark color scheme. To create a high-contrast color scheme, set /// `contrastLevel` to 1.0. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example demonstrates how to create a color scheme similar to [ColorScheme.highContrastDark] /// using the [ColorScheme.fromSeed] constructor: /// @@ -719,7 +744,8 @@ class ColorScheme with Diagnosticable { /// onError: Colors.white, /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. const ColorScheme.highContrastDark({ this.brightness = Brightness.dark, this.primary = const Color(0xffefb7ff), @@ -1697,12 +1723,15 @@ class ColorScheme with Diagnosticable { /// The provided image will be scaled down to a maximum size of 112x112 pixels /// during color extraction. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to use [ColorScheme.fromImageProvider] to create /// content-based dynamic color schemes. /// - /// ** See code in examples/api/lib/material/color_scheme/dynamic_content_color.0.dart ** - /// {@end-tool} + /// {@example /example/lib/color_scheme/dynamic_content_color.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/colors.dart b/packages/material_ui/lib/src/colors.dart index 8c1412c8e61b..822ff7649ac7 100644 --- a/packages/material_ui/lib/src/colors.dart +++ b/packages/material_ui/lib/src/colors.dart @@ -187,7 +187,10 @@ 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. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// To select a specific color from one of the swatches, index into the swatch /// using an integer for the specific color desired, as follows: @@ -195,8 +198,12 @@ class MaterialAccentColor extends ColorSwatch { /// ```dart /// Color selection = Colors.green[400]!; // Selects a mid-range green. /// ``` -/// {@end-tool} -/// {@tool snippet} +/// +// TODO(framework): End of the blue example container. +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Each [ColorSwatch] constant is a color and can used directly. For example: /// @@ -205,7 +212,8 @@ class MaterialAccentColor extends ColorSwatch { /// color: Colors.blue, // same as Colors.blue[500] or Colors.blue.shade500 /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Color palettes /// @@ -517,7 +525,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pink.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pinkAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -525,7 +536,8 @@ abstract final class Colors { /// color: Colors.red[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -558,7 +570,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pink.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pinkAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -566,7 +581,8 @@ abstract final class Colors { /// color: Colors.redAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -593,7 +609,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.purple.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.purpleAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -601,7 +620,8 @@ abstract final class Colors { /// color: Colors.pink[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -634,7 +654,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.purple.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.purpleAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -642,7 +665,8 @@ abstract final class Colors { /// color: Colors.pinkAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -670,7 +694,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pink.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pinkAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -678,7 +705,8 @@ abstract final class Colors { /// color: Colors.purple[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -711,7 +739,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pink.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.pinkAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -719,7 +750,8 @@ abstract final class Colors { /// color: Colors.purpleAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -747,7 +779,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.indigo.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.indigoAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -755,7 +790,8 @@ abstract final class Colors { /// color: Colors.deepPurple[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -788,7 +824,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.indigo.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.indigoAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -796,7 +835,8 @@ abstract final class Colors { /// color: Colors.deepPurpleAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -824,7 +864,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepPurple.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepPurpleAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -832,7 +875,8 @@ abstract final class Colors { /// color: Colors.indigo[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -865,7 +909,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepPurple.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepPurpleAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -873,7 +920,8 @@ abstract final class Colors { /// color: Colors.indigoAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -903,7 +951,10 @@ abstract final class Colors { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.blueGrey.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -911,7 +962,8 @@ abstract final class Colors { /// color: Colors.blue[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -944,7 +996,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lightBlue.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lightBlueAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -952,7 +1007,8 @@ abstract final class Colors { /// color: Colors.blueAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -980,7 +1036,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyan.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyanAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -988,7 +1047,8 @@ abstract final class Colors { /// color: Colors.lightBlue[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1021,7 +1081,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyan.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyanAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1029,7 +1092,8 @@ abstract final class Colors { /// color: Colors.lightBlueAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1059,7 +1123,10 @@ abstract final class Colors { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.blueGrey.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1067,7 +1134,8 @@ abstract final class Colors { /// color: Colors.cyan[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1100,7 +1168,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.teal.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.tealAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1108,7 +1179,8 @@ abstract final class Colors { /// color: Colors.cyanAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1136,7 +1208,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyan.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyanAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1144,7 +1219,8 @@ abstract final class Colors { /// color: Colors.teal[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1177,7 +1253,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyan.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.cyanAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1185,7 +1264,8 @@ abstract final class Colors { /// color: Colors.tealAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1216,7 +1296,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lime.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.limeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1224,7 +1307,8 @@ abstract final class Colors { /// color: Colors.green[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1260,7 +1344,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lime.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.limeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1268,7 +1355,8 @@ abstract final class Colors { /// color: Colors.greenAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1296,7 +1384,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lime.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.limeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1304,7 +1395,8 @@ abstract final class Colors { /// color: Colors.lightGreen[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1337,7 +1429,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.lime.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.limeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1345,7 +1440,8 @@ abstract final class Colors { /// color: Colors.lightGreenAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1373,7 +1469,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.yellow.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.yellowAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1381,7 +1480,8 @@ abstract final class Colors { /// color: Colors.lime[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1414,7 +1514,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.yellow.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.yellowAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1422,7 +1525,8 @@ abstract final class Colors { /// color: Colors.limeAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1450,7 +1554,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.amber.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.amberAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1458,7 +1565,8 @@ abstract final class Colors { /// color: Colors.yellow[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1491,7 +1599,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.amber.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.amberAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1499,7 +1610,8 @@ abstract final class Colors { /// color: Colors.yellowAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1527,7 +1639,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.orange.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.orangeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1535,7 +1650,8 @@ abstract final class Colors { /// color: Colors.amber[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1568,7 +1684,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.orange.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.orangeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1576,7 +1695,8 @@ abstract final class Colors { /// color: Colors.amberAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1606,7 +1726,10 @@ abstract final class Colors { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.brown.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1614,7 +1737,8 @@ abstract final class Colors { /// color: Colors.orange[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1647,7 +1771,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepOrange.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.deepOrangeAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1655,7 +1782,8 @@ abstract final class Colors { /// color: Colors.orangeAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1685,7 +1813,10 @@ abstract final class Colors { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.brown.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1693,7 +1824,8 @@ abstract final class Colors { /// color: Colors.deepOrange[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1726,7 +1858,10 @@ abstract final class Colors { /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.red.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/Colors.redAccent.png) /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1734,7 +1869,8 @@ abstract final class Colors { /// color: Colors.deepOrangeAccent[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1761,7 +1897,10 @@ abstract final class Colors { /// /// This swatch has no corresponding accent color and swatch. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1769,7 +1908,8 @@ abstract final class Colors { /// color: Colors.brown[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1805,7 +1945,10 @@ abstract final 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]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1813,7 +1956,8 @@ abstract final class Colors { /// color: Colors.grey[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1850,7 +1994,10 @@ abstract final class Colors { /// /// This swatch has no corresponding accent swatch. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Icon( @@ -1858,7 +2005,8 @@ abstract final class Colors { /// color: Colors.blueGrey[400], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/data_table.dart b/packages/material_ui/lib/src/data_table.dart index 8aaaa98be5d1..40a0e5b051e8 100644 --- a/packages/material_ui/lib/src/data_table.dart +++ b/packages/material_ui/lib/src/data_table.dart @@ -408,7 +408,9 @@ class DataCell { /// multiple pages. /// * [CustomScrollView], for greater control over scrolling effects. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display a [DataTable] with three columns: name, age, and /// role. The columns are defined by three [DataColumn] objects. The table /// contains three rows of data for three example users, the data for which @@ -416,16 +418,20 @@ class DataCell { /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/data_table.png) /// -/// ** See code in examples/api/lib/material/data_table/data_table.0.dart ** -/// {@end-tool} +/// {@example /example/lib/data_table/data_table.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display a [DataTable] with alternate colors per /// row, and a custom color for when the row is selected. /// -/// ** See code in examples/api/lib/material/data_table/data_table.1.dart ** -/// {@end-tool} +/// {@example /example/lib/data_table/data_table.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// [DataTable] can be sorted on the basis of any column in [columns] in /// ascending or descending order. If [sortColumnIndex] is non-null, then the diff --git a/packages/material_ui/lib/src/date.dart b/packages/material_ui/lib/src/date.dart index 00bb8dd2cff5..b621334c6c07 100644 --- a/packages/material_ui/lib/src/date.dart +++ b/packages/material_ui/lib/src/date.dart @@ -18,12 +18,15 @@ import 'material_localizations.dart'; /// navigated within the picker. Different calendar systems (e.g., Gregorian, /// Nepali, Hijri, Buddhist) can be supported by providing custom implementations. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example demonstrates how a [CalendarDelegate] is used to implement a /// custom calendar system in the date picker. /// -/// ** See code in examples/api/lib/material/date_picker/custom_calendar_date_picker.0.dart ** -/// {@end-tool} +/// {@example /example/lib/date_picker/custom_calendar_date_picker.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/date_picker.dart b/packages/material_ui/lib/src/date_picker.dart index 7c7c9b3a2fea..b74bf0a749a5 100644 --- a/packages/material_ui/lib/src/date_picker.dart +++ b/packages/material_ui/lib/src/date_picker.dart @@ -157,12 +157,15 @@ const double _fontSizeToScale = 14.0; /// /// {@macro flutter.widgets.RawDialogRoute} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to create a basic date picker. /// Tapping the button displays a date picker which returns the selected date. /// -/// ** See code in examples/api/lib/material/date_picker/show_date_picker.1.dart ** -/// {@end-tool} +/// {@example /example/lib/date_picker/show_date_picker.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ### State Restoration /// @@ -175,14 +178,17 @@ const double _fontSizeToScale = 14.0; /// /// {@macro flutter.widgets.RestorationManager} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to create a restorable Material date picker. /// This is accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to /// push [DatePickerDialog] when the button is tapped. /// -/// ** See code in examples/api/lib/material/date_picker/show_date_picker.0.dart ** -/// {@end-tool} +/// {@example /example/lib/date_picker/show_date_picker.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1146,14 +1152,17 @@ typedef SelectableDayForRangePredicate = /// /// {@macro flutter.widgets.RestorationManager} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to create a restorable Material date range picker. /// This is accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to /// push [DateRangePickerDialog] when the button is tapped. /// -/// ** See code in examples/api/lib/material/date_picker/show_date_range_picker.0.dart ** -/// {@end-tool} +/// {@example /example/lib/date_picker/show_date_range_picker.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/date_picker_theme.dart b/packages/material_ui/lib/src/date_picker_theme.dart index e629927bd1c8..55a5036bce72 100644 --- a/packages/material_ui/lib/src/date_picker_theme.dart +++ b/packages/material_ui/lib/src/date_picker_theme.dart @@ -243,13 +243,16 @@ class DatePickerThemeData with Diagnosticable { /// value of [dayBackgroundColor] is used to paint the shape decoration of /// the day label. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to customize the day selector shape decoration /// using the [dayShape], [todayForegroundColor], [todayBackgroundColor], and /// [todayBorder] properties. /// - /// ** See code in examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart ** - /// {@end-tool} + /// {@example /example/lib/date_picker/date_picker_theme_day_shape.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final WidgetStateProperty? dayShape; /// Overrides the default color used to paint the @@ -259,13 +262,16 @@ class DatePickerThemeData with Diagnosticable { /// /// This will be used instead of the [TextStyle.color] provided in [dayStyle]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to customize the day selector shape decoration /// using the [dayShape], [todayForegroundColor], [todayBackgroundColor], and /// [todayBorder] properties. /// - /// ** See code in examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart ** - /// {@end-tool} + /// {@example /example/lib/date_picker/date_picker_theme_day_shape.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final WidgetStateProperty? todayForegroundColor; /// Overrides the default color used to paint the background of the @@ -281,13 +287,16 @@ class DatePickerThemeData with Diagnosticable { /// is used as specified. To omit the border entirely, /// set [todayBorder] to [BorderSide.none]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to customize the day selector shape decoration /// using the [dayShape], [todayForegroundColor], [todayBackgroundColor], and /// [todayBorder] properties. /// - /// ** See code in examples/api/lib/material/date_picker/date_picker_theme_day_shape.0.dart ** - /// {@end-tool} + /// {@example /example/lib/date_picker/date_picker_theme_day_shape.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final BorderSide? todayBorder; /// Overrides the default text style used to paint each of the year diff --git a/packages/material_ui/lib/src/dialog.dart b/packages/material_ui/lib/src/dialog.dart index b1d86ededd3d..9739a4efbb76 100644 --- a/packages/material_ui/lib/src/dialog.dart +++ b/packages/material_ui/lib/src/dialog.dart @@ -38,11 +38,14 @@ const EdgeInsets _defaultInsetPadding = EdgeInsets.symmetric(horizontal: 40.0, v /// or [SimpleDialog], which implement specific kinds of Material Design /// dialogs. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows the creation of [Dialog] and [Dialog.fullscreen] widgets. /// -/// ** See code in examples/api/lib/material/dialog/dialog.0.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/dialog.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Contraints /// The Material 3 guideline recommends that a dialog should have a maximal width of 560dp. @@ -50,13 +53,18 @@ const EdgeInsets _defaultInsetPadding = EdgeInsets.symmetric(horizontal: 40.0, v /// For applications targeting large screens such as desktop or Web, it is recommended to /// set the [constraints] property. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This sample shows a [Dialog] using [BoxConstraints] defined by the Material 3 specification. /// /// ```dart /// const Dialog(constraints: BoxConstraints(maxWidth: 560, minHeight: 280)); /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// @@ -337,7 +345,10 @@ class Dialog extends StatelessWidget { /// /// {@animation 350 622 https://flutter.github.io/assets-for-api-docs/assets/material/alert_dialog.mp4} /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This snippet shows a method in a [State] which, when called, displays a dialog box /// and returns a [Future] that completes when the dialog is dismissed. @@ -371,22 +382,29 @@ class Dialog extends StatelessWidget { /// ); /// } /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This demo shows a [TextButton] which when pressed, calls [showDialog]. When called, this method /// displays a Material dialog above the current contents of the app and returns /// a [Future] that completes when the dialog is dismissed. /// -/// ** See code in examples/api/lib/material/dialog/alert_dialog.0.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/alert_dialog.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of [AlertDialog], as described in: /// https://m3.material.io/components/dialogs/overview /// -/// ** See code in examples/api/lib/material/dialog/alert_dialog.1.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/alert_dialog.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Alert dialogs and scrolling /// @@ -472,7 +490,9 @@ class AlertDialog extends StatelessWidget { /// /// The target platform is based on the current [Theme]: [ThemeData.platform]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This demo shows a [TextButton] which when pressed, calls [showAdaptiveDialog]. /// When called, this method displays an adaptive dialog above the current /// contents of the app, with different behaviors depending on target platform. @@ -480,8 +500,9 @@ class AlertDialog extends StatelessWidget { /// [CupertinoDialogAction] is conditionally used as the child to show more /// platform specific design. /// - /// ** See code in examples/api/lib/material/dialog/adaptive_alert_dialog.0.dart ** - /// {@end-tool} + /// {@example /example/lib/dialog/adaptive_alert_dialog.0.dart} + /// + // TODO(framework): End of the @dartpad directive. const factory AlertDialog.adaptive({ Key? key, Widget? icon, @@ -625,7 +646,11 @@ class AlertDialog extends StatelessWidget { /// /// If there are no [actions], then no padding will be included. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This is an example of a set of actions aligned with the content widget. /// ```dart /// AlertDialog( @@ -638,7 +663,8 @@ class AlertDialog extends StatelessWidget { /// actionsPadding: const EdgeInsets.symmetric(horizontal: 8.0), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -1035,7 +1061,10 @@ class _AdaptiveAlertDialog extends AlertDialog { /// title and the first option, and 24 pixels of spacing between the last option /// and the bottom of the dialog. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// SimpleDialogOption( @@ -1043,7 +1072,8 @@ class _AdaptiveAlertDialog extends AlertDialog { /// child: const Text('Treasury department'), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// @@ -1103,7 +1133,10 @@ class SimpleDialogOption extends StatelessWidget { /// /// {@animation 350 622 https://flutter.github.io/assets-for-api-docs/assets/material/simple_dialog.mp4} /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// In this example, the user is asked to select between two options. These /// options are represented as an enum. The [showDialog] method here returns @@ -1149,7 +1182,8 @@ class SimpleDialogOption extends StatelessWidget { /// } /// } /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// @@ -1575,18 +1609,24 @@ class _DialogContentPage extends Page { /// Returns a [Future] that resolves to the value (if any) that was passed to /// [Navigator.pop] when the dialog was closed. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to use [showDialog] to display a dialog box. /// -/// ** See code in examples/api/lib/material/dialog/show_dialog.0.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/show_dialog.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of [showDialog], as described in: /// https://m3.material.io/components/dialogs/overview /// -/// ** See code in examples/api/lib/material/dialog/show_dialog.1.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/show_dialog.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ### State Restoration in Dialogs /// @@ -1596,7 +1636,9 @@ class _DialogContentPage extends Page { /// /// For more information about state restoration, see [RestorationManager]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to create a restorable Material dialog. This is /// accomplished by enabling state restoration by specifying /// [MaterialApp.restorationScopeId] and using [Navigator.restorablePush] to @@ -1604,8 +1646,9 @@ class _DialogContentPage extends Page { /// /// {@macro flutter.widgets.RestorationManager} /// -/// ** See code in examples/api/lib/material/dialog/show_dialog.2.dart ** -/// {@end-tool} +/// {@example /example/lib/dialog/show_dialog.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/divider.dart b/packages/material_ui/lib/src/divider.dart index b3f0f59d2d50..214d06fee3f3 100644 --- a/packages/material_ui/lib/src/divider.dart +++ b/packages/material_ui/lib/src/divider.dart @@ -29,7 +29,9 @@ import 'theme.dart'; /// The box's total height is controlled by [height]. The appropriate /// padding is automatically computed from the height. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display a Divider between an orange and blue box /// inside a column. The Divider is 20 logical pixels in height and contains a /// vertically centered black line that is 5 logical pixels thick. The black @@ -37,15 +39,19 @@ import 'theme.dart'; /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/divider.png) /// -/// ** See code in examples/api/lib/material/divider/divider.0.dart ** -/// {@end-tool} +/// {@example /example/lib/divider/divider.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of [Divider] widget, as described in: /// https://m3.material.io/components/divider/overview /// -/// ** See code in examples/api/lib/material/divider/divider.1.dart ** -/// {@end-tool} +/// {@example /example/lib/divider/divider.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -122,14 +128,18 @@ class Divider extends StatelessWidget { /// also null, then [ThemeData.dividerColor] is used. /// {@endtemplate} /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// const Divider( /// color: Colors.deepOrange, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final Color? color; /// Computes the [BorderSide] that represents a divider. @@ -145,7 +155,10 @@ class Divider extends StatelessWidget { /// If [context] is null, the default color of [BorderSide] is used and the /// default width of 0.0 is used. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// This example uses this method to create a box that has a divider above and /// below it. This is sometimes useful with lists, for instance, to separate a @@ -162,7 +175,8 @@ class Divider extends StatelessWidget { /// // child: ... /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. static BorderSide createBorderSide(BuildContext? context, {Color? color, double? width}) { final DividerThemeData? dividerTheme = context != null ? DividerTheme.of(context) : null; final DividerThemeData? defaults = context != null @@ -220,21 +234,27 @@ class Divider extends StatelessWidget { /// The box's total width is controlled by [width]. The appropriate /// padding is automatically computed from the width. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display a [VerticalDivider] between a purple and orange box /// inside a [Row]. The [VerticalDivider] is 20 logical pixels in width and contains a /// horizontally centered black line that is 1 logical pixels thick. The grey /// line is indented by 20 logical pixels. /// -/// ** See code in examples/api/lib/material/divider/vertical_divider.0.dart ** -/// {@end-tool} +/// {@example /example/lib/divider/vertical_divider.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of [VerticalDivider] widget, as described in: /// https://m3.material.io/components/divider/overview /// -/// ** See code in examples/api/lib/material/divider/vertical_divider.1.dart ** -/// {@end-tool} +/// {@example /example/lib/divider/vertical_divider.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -294,14 +314,18 @@ class VerticalDivider extends StatelessWidget { /// If this is null, then the [DividerThemeData.color] is used. If that is /// also null, then [ThemeData.dividerColor] is used. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// const Divider( /// color: Colors.deepOrange, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final Color? color; /// The amount of radius for the border of the divider. diff --git a/packages/material_ui/lib/src/drawer.dart b/packages/material_ui/lib/src/drawer.dart index b40c12671fd6..2443856d51c3 100644 --- a/packages/material_ui/lib/src/drawer.dart +++ b/packages/material_ui/lib/src/drawer.dart @@ -96,21 +96,27 @@ const Duration _kBaseSettleDuration = Duration(milliseconds: 246); /// [NavigationDrawerDestination] widgets and/or customized widgets like headlines /// and dividers. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create a [Scaffold] that contains an [AppBar] and /// a [Drawer]. A user taps the "menu" icon in the [AppBar] to open the /// [Drawer]. The [Drawer] displays four items: A header and three menu items. /// The [Drawer] displays the four items using a [ListView], which allows the /// user to scroll through the items if need be. /// -/// ** See code in examples/api/lib/material/drawer/drawer.0.dart ** -/// {@end-tool} +/// {@example /example/lib/drawer/drawer.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to migrate the above [Drawer] to a [NavigationDrawer]. /// -/// ** See code in examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_drawer/navigation_drawer.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// An open drawer may be closed with a swipe to close gesture, pressing the /// escape key, by tapping the scrim, or by calling pop route function such as @@ -416,12 +422,17 @@ class DrawerController extends StatefulWidget { /// The closest instance of [DrawerController] that encloses the given /// context, or null if none is found. /// - /// {@tool snippet} Typical usage is as follows: + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// Typical usage is as follows: /// /// ```dart /// DrawerController? controller = DrawerController.maybeOf(context); /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Calling this method will create a dependency on the closest /// [DrawerController] in the [context], if there is one. @@ -443,12 +454,17 @@ class DrawerController extends StatefulWidget { /// Calling this method will create a dependency on the closest /// [DrawerController] in the [context]. /// - /// {@tool snippet} Typical usage is as follows: + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// Typical usage is as follows: /// /// ```dart /// DrawerController controller = DrawerController.of(context); /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. static DrawerController of(BuildContext context) { final DrawerController? controller = maybeOf(context); assert(() { diff --git a/packages/material_ui/lib/src/dropdown.dart b/packages/material_ui/lib/src/dropdown.dart index e7bb5d899703..026359cd11b8 100644 --- a/packages/material_ui/lib/src/dropdown.dart +++ b/packages/material_ui/lib/src/dropdown.dart @@ -939,15 +939,18 @@ class DropdownButtonHideUnderline extends InheritedWidget { /// dropdown with the new value. /// /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows a [DropdownButton] with a large arrow icon, /// purple text style, and bold purple underline, whose value is one of "One", /// "Two", "Three", or "Four". /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/dropdown_button.png) /// -/// ** See code in examples/api/lib/material/dropdown/dropdown_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/dropdown/dropdown_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// If the [onChanged] callback is null or the list of [items] is null /// then the dropdown button will be disabled, i.e. its arrow will be @@ -956,12 +959,15 @@ class DropdownButtonHideUnderline extends InheritedWidget { /// [disabledHint] is null and [hint] is non-null, the [hint] widget will /// instead be displayed. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how you would rewrite the above [DropdownButton] /// to use the [DropdownMenu]. /// -/// ** See code in examples/api/lib/material/dropdown_menu/dropdown_menu.1.dart ** -/// {@end-tool} +/// {@example /example/lib/dropdown_menu/dropdown_menu.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// /// See also: @@ -1149,12 +1155,15 @@ class DropdownButton extends StatefulWidget { /// from the list corresponds to the [DropdownMenuItem] of the same index /// in [items]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows a `DropdownButton` with a button with [Text] that /// corresponds to but is unique from [DropdownMenuItem]. /// - /// ** See code in examples/api/lib/material/dropdown/dropdown_button.selected_item_builder.0.dart ** - /// {@end-tool} + /// {@example /example/lib/dropdown/dropdown_button.selected_item_builder.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// If this callback is null, the [DropdownMenuItem] from [items] /// that matches [value] will be displayed. @@ -1177,12 +1186,15 @@ class DropdownButton extends StatefulWidget { /// To use a separate text style for selected item when it's displayed within /// the dropdown button, consider using [selectedItemBuilder]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows a `DropdownButton` with a dropdown button text style /// that is different than its menu items. /// - /// ** See code in examples/api/lib/material/dropdown/dropdown_button.style.0.dart ** - /// {@end-tool} + /// {@example /example/lib/dropdown/dropdown_button.style.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// Defaults to the [TextTheme.titleMedium] value of the current /// [ThemeData.textTheme] of the current [Theme]. diff --git a/packages/material_ui/lib/src/dropdown_menu.dart b/packages/material_ui/lib/src/dropdown_menu.dart index 1172f990ae74..662daab7db3c 100644 --- a/packages/material_ui/lib/src/dropdown_menu.dart +++ b/packages/material_ui/lib/src/dropdown_menu.dart @@ -101,13 +101,16 @@ class DropdownMenuEntry { /// To control the text that appears in the text field for a selected item, /// set the [label] property to a descriptive string. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to override the default label [Text] /// widget with one that forces the menu entry to appear on one line /// by specifying [Text.maxLines] and [Text.overflow]. /// - /// ** See code in examples/api/lib/material/dropdown_menu/dropdown_menu_entry_label_widget.0.dart ** - /// {@end-tool} + /// {@example /example/lib/dropdown_menu/dropdown_menu_entry_label_widget.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final Widget? labelWidget; /// An optional icon to display before the label. @@ -161,11 +164,14 @@ enum DropdownMenuCloseBehavior { /// /// The menu can be scrollable if not all items in the list are displayed at once. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display outlined [DropdownMenu] and filled [DropdownMenu]. /// -/// ** See code in examples/api/lib/material/dropdown_menu/dropdown_menu.0.dart ** -/// {@end-tool} +/// {@example /example/lib/dropdown_menu/dropdown_menu.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -242,12 +248,15 @@ class DropdownMenu extends StatefulWidget { /// /// Defaults to true. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how the [enabled] and [requestFocusOnTap] properties /// affect the textfield's hover cursor. /// - /// ** See code in examples/api/lib/material/dropdown_menu/dropdown_menu.2.dart ** - /// {@end-tool} + /// {@example /example/lib/dropdown_menu/dropdown_menu.2.dart} + /// + // TODO(framework): End of the @dartpad directive. final bool enabled; /// Determine the width of the [DropdownMenu]. @@ -514,12 +523,15 @@ class DropdownMenu extends StatefulWidget { /// /// Set this to true or false explicitly to override the default behavior. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how the [enabled] and [requestFocusOnTap] properties /// affect the textfield's hover cursor. /// - /// ** See code in examples/api/lib/material/dropdown_menu/dropdown_menu.2.dart ** - /// {@end-tool} + /// {@example /example/lib/dropdown_menu/dropdown_menu.2.dart} + /// + // TODO(framework): End of the @dartpad directive. final bool? requestFocusOnTap; /// Determines if the dropdown menu behaves as a 'select' component. @@ -564,7 +576,10 @@ class DropdownMenu extends StatefulWidget { /// When [DropdownMenu.enableFilter] is true, this callback is used to /// compute the list of filtered items. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// In this example the `filterCallback` returns the items that contains the /// trimmed query. @@ -587,7 +602,8 @@ class DropdownMenu extends StatefulWidget { /// dropdownMenuEntries: const >[], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Defaults to null. If this parameter is null and the /// [DropdownMenu.enableFilter] property is set to true, the default behavior @@ -599,7 +615,10 @@ class DropdownMenu extends StatefulWidget { /// When [DropdownMenu.enableSearch] is true, this callback is used to compute /// the index of the search result to be highlighted. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// In this example the `searchCallback` returns the index of the search result /// that exactly matches the query. @@ -617,7 +636,8 @@ class DropdownMenu extends StatefulWidget { /// dropdownMenuEntries: const >[], /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Defaults to null. If this is null and [DropdownMenu.enableSearch] is true, /// the default function will return the index of the first matching result diff --git a/packages/material_ui/lib/src/elevated_button.dart b/packages/material_ui/lib/src/elevated_button.dart index 25a0af018af3..e06a9ba42ecc 100644 --- a/packages/material_ui/lib/src/elevated_button.dart +++ b/packages/material_ui/lib/src/elevated_button.dart @@ -52,11 +52,14 @@ import 'theme_data.dart'; /// If [onPressed] and [onLongPress] callbacks are null, then the /// button will be disabled. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample produces an enabled and a disabled ElevatedButton. /// -/// ** See code in examples/api/lib/material/elevated_button/elevated_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/elevated_button/elevated_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/expansion_panel.dart b/packages/material_ui/lib/src/expansion_panel.dart index f6dc5ba8bf0e..a1690b4af005 100644 --- a/packages/material_ui/lib/src/expansion_panel.dart +++ b/packages/material_ui/lib/src/expansion_panel.dart @@ -171,11 +171,14 @@ class ExpansionPanelRadio extends ExpansionPanel { /// previously open panel, which is closing, and the previously closed panel, /// which is opening. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is a simple example of how to use [ExpansionPanelList]. /// -/// ** See code in examples/api/lib/material/expansion_panel/expansion_panel_list.0.dart ** -/// {@end-tool} +/// {@example /example/lib/expansion_panel/expansion_panel_list.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -205,11 +208,14 @@ class ExpansionPanelList extends StatefulWidget { /// expand/collapse button is pushed. The [children] objects must be instances /// of [ExpansionPanelRadio]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Here is a simple example of how to implement ExpansionPanelList.radio. /// - /// ** See code in examples/api/lib/material/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart ** - /// {@end-tool} + /// {@example /example/lib/expansion_panel/expansion_panel_list.expansion_panel_list_radio.0.dart} + /// + // TODO(framework): End of the @dartpad directive. const ExpansionPanelList.radio({ super.key, this.children = const [], diff --git a/packages/material_ui/lib/src/expansion_tile.dart b/packages/material_ui/lib/src/expansion_tile.dart index c8afe4e720b0..8639fd7448dc 100644 --- a/packages/material_ui/lib/src/expansion_tile.dart +++ b/packages/material_ui/lib/src/expansion_tile.dart @@ -34,7 +34,9 @@ const Duration _kExpand = Duration(milliseconds: 200); /// or look up the tile's automatically created [ExpansionTileController] /// with [ExpansibleController.of]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Typical usage of the [ExpansibleController.of] function is to call it from within the /// `build` method of a descendant of an [ExpansionTile]. /// @@ -46,8 +48,9 @@ const Duration _kExpand = Duration(milliseconds: 200); /// add a [Builder] widget, which provides a new scope with a /// [BuildContext] that is "under" the [ExpansionTile]: /// -/// ** See code in examples/api/lib/material/expansion_tile/expansion_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/expansion_tile/expansion_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// A more efficient solution is to split your build function into /// several widgets. This introduces a new context from which you @@ -86,19 +89,25 @@ typedef ExpansionTileController = ExpansibleController; /// (i.e. the trailing edge). This can be changed using [controlAffinity]. This maps /// to the [leading] and [trailing] properties of [ExpansionTile]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example demonstrates how the [ExpansionTile] icon's location and appearance /// can be customized. /// -/// ** See code in examples/api/lib/material/expansion_tile/expansion_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/expansion_tile/expansion_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example demonstrates how an [ExpansibleController] can be used to /// programmatically expand or collapse an [ExpansionTile]. /// -/// ** See code in examples/api/lib/material/expansion_tile/expansion_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/expansion_tile/expansion_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Accessibility /// @@ -470,12 +479,15 @@ class ExpansionTile extends StatefulWidget { /// /// To disable the theme animation, use [AnimationStyle.noAnimation]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override the [ExpansionTile] expansion /// animation curve and duration using [AnimationStyle]. /// - /// ** See code in examples/api/lib/material/expansion_tile/expansion_tile.2.dart ** - /// {@end-tool} + /// {@example /example/lib/expansion_tile/expansion_tile.2.dart} + /// + // TODO(framework): End of the @dartpad directive. final AnimationStyle? expansionAnimationStyle; /// Whether to add button:true to the semantics if onTap is provided. diff --git a/packages/material_ui/lib/src/filled_button.dart b/packages/material_ui/lib/src/filled_button.dart index 8e252ae39fc8..4e9d1cce6ba5 100644 --- a/packages/material_ui/lib/src/filled_button.dart +++ b/packages/material_ui/lib/src/filled_button.dart @@ -54,12 +54,15 @@ enum _FilledButtonVariant { filled, tonal } /// /// To create a 'filled tonal' button, use [FilledButton.tonal]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample produces enabled and disabled filled and filled tonal /// buttons. /// -/// ** See code in examples/api/lib/material/filled_button/filled_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/filled_button/filled_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Visual density effects /// diff --git a/packages/material_ui/lib/src/filter_chip.dart b/packages/material_ui/lib/src/filter_chip.dart index bba0121aad9a..2c4fe2c0145f 100644 --- a/packages/material_ui/lib/src/filter_chip.dart +++ b/packages/material_ui/lib/src/filter_chip.dart @@ -36,11 +36,14 @@ enum _ChipVariant { flat, elevated } /// /// Requires one of its ancestors to be a [Material] widget. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to use [FilterChip]s to filter through exercises. /// -/// ** See code in examples/api/lib/material/filter_chip/filter_chip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/filter_chip/filter_chip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Material Design 3 /// diff --git a/packages/material_ui/lib/src/flexible_space_bar.dart b/packages/material_ui/lib/src/flexible_space_bar.dart index c196417be1e8..496f21305c80 100644 --- a/packages/material_ui/lib/src/flexible_space_bar.dart +++ b/packages/material_ui/lib/src/flexible_space_bar.dart @@ -60,7 +60,9 @@ enum StretchMode { /// [FlexibleSpaceBar.createSettings], to convey sizing information down to the /// [FlexibleSpaceBar]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample application demonstrates the different features of the /// [FlexibleSpaceBar] when used in a [SliverAppBar]. This app bar is configured /// to stretch into the overscroll space, and uses the @@ -68,8 +70,9 @@ enum StretchMode { /// `zoomBackground`. The app bar also makes use of [CollapseMode.parallax] by /// default. /// -/// ** See code in examples/api/lib/material/flexible_space_bar/flexible_space_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/flexible_space_bar/flexible_space_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/floating_action_button.dart b/packages/material_ui/lib/src/floating_action_button.dart index b77189cd123b..3b271afa5856 100644 --- a/packages/material_ui/lib/src/floating_action_button.dart +++ b/packages/material_ui/lib/src/floating_action_button.dart @@ -49,28 +49,37 @@ enum _FloatingActionButtonType { regular, small, large, extended } /// disabled. Consider changing the [backgroundColor] if disabling the floating /// action button. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [FloatingActionButton] in its usual position within a /// [Scaffold]. Pressing the button cycles it through a few variations in its /// [foregroundColor], [backgroundColor], and [shape]. The button automatically /// animates its segue from one set of visual parameters to another. /// -/// ** See code in examples/api/lib/material/floating_action_button/floating_action_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/floating_action_button/floating_action_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows all the variants of [FloatingActionButton] widget as /// described in: https://m3.material.io/components/floating-action-button/overview. /// -/// ** See code in examples/api/lib/material/floating_action_button/floating_action_button.1.dart ** -/// {@end-tool} +/// {@example /example/lib/floating_action_button/floating_action_button.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows [FloatingActionButton] with additional color mappings as /// described in: https://m3.material.io/components/floating-action-button/overview. /// -/// ** See code in examples/api/lib/material/floating_action_button/floating_action_button.2.dart ** -/// {@end-tool} +/// {@example /example/lib/floating_action_button/floating_action_button.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/floating_action_button_location.dart b/packages/material_ui/lib/src/floating_action_button_location.dart index 7dfdc84579c4..6342f79d04b2 100644 --- a/packages/material_ui/lib/src/floating_action_button_location.dart +++ b/packages/material_ui/lib/src/floating_action_button_location.dart @@ -467,7 +467,9 @@ abstract class FloatingActionButtonLocation { /// You can create your own subclass of [StandardFabLocation] /// to implement a custom [FloatingActionButtonLocation]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This is an example of a user-defined [FloatingActionButtonLocation]. /// /// The example shows a [Scaffold] with an [AppBar], a [BottomAppBar], and a @@ -480,8 +482,9 @@ abstract class FloatingActionButtonLocation { /// [FloatingActionButtonLocation] slightly different from /// [FloatingActionButtonLocation.endFloat]. /// -/// ** See code in examples/api/lib/material/floating_action_button_location/standard_fab_location.0.dart ** -/// {@end-tool} +/// {@example /example/lib/floating_action_button_location/standard_fab_location.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// abstract class StandardFabLocation extends FloatingActionButtonLocation { /// Abstract const constructor. This constructor enables subclasses to provide @@ -942,12 +945,15 @@ abstract class FloatingActionButtonAnimator { /// does not animate on entrance and exit when [FloatingActionButtonLocation] is shown /// or hidden and when transitioning between [FloatingActionButtonLocation]s. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override [FloatingActionButton] entrance and exit animations /// using [FloatingActionButtonAnimator.noAnimation] in [Scaffold.floatingActionButtonAnimator]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold.floating_action_button_animator.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold.floating_action_button_animator.0.dart} + /// + // TODO(framework): End of the @dartpad directive. static const FloatingActionButtonAnimator noAnimation = _NoAnimationFabMotionAnimator(); @override diff --git a/packages/material_ui/lib/src/icon_button.dart b/packages/material_ui/lib/src/icon_button.dart index 9f026b7aa3dc..6c74b2acf084 100644 --- a/packages/material_ui/lib/src/icon_button.dart +++ b/packages/material_ui/lib/src/icon_button.dart @@ -61,14 +61,17 @@ enum _IconButtonVariant { standard, filled, filledTonal, outlined } /// requirements in the Material Design specification. The [alignment] controls /// how the icon itself is positioned within the hit region. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows an [IconButton] that uses the Material icon "volume_up" to /// increase the volume. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button.png) /// -/// ** See code in examples/api/lib/material/icon_button/icon_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/icon_button/icon_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ### Icon sizes /// @@ -113,7 +116,9 @@ enum _IconButtonVariant { standard, filled, filledTonal, outlined } /// the underlying [Material] along with the splash and highlight /// [InkResponse] contributed by descendant widgets. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// In this sample the icon button's background color is defined with an [Ink] /// widget whose child is an [IconButton]. The icon button's filled background /// is a light shade of blue, it's a filled circle, and it's as big as the @@ -121,8 +126,9 @@ enum _IconButtonVariant { standard, filled, filledTonal, outlined } /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/icon_button_background.png) /// -/// ** See code in examples/api/lib/material/icon_button/icon_button.1.dart ** -/// {@end-tool} +/// {@example /example/lib/icon_button/icon_button.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// Material Design 3 introduced new types (standard and contained) of [IconButton]s. /// The default [IconButton] is the standard type. To create a filled icon button, @@ -148,20 +154,26 @@ enum _IconButtonVariant { standard, filled, filledTonal, outlined } /// the [IconButton.visualDensity] is set to [VisualDensity.compact]. Users can /// customize it by using [IconButtonTheme], [IconButton.style] or [IconButton.visualDensity]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows creation of [IconButton] widgets for standard, filled, /// filled tonal and outlined types, as described in: https://m3.material.io/components/icon-buttons/overview /// -/// ** See code in examples/api/lib/material/icon_button/icon_button.2.dart ** -/// {@end-tool} +/// {@example /example/lib/icon_button/icon_button.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows creation of [IconButton] widgets with toggle feature for /// standard, filled, filled tonal and outlined types, as described /// in: https://m3.material.io/components/icon-buttons/overview /// -/// ** See code in examples/api/lib/material/icon_button/icon_button.3.dart ** -/// {@end-tool} +/// {@example /example/lib/icon_button/icon_button.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/icons.dart b/packages/material_ui/lib/src/icons.dart index d330a20646f8..e0f636c73259 100644 --- a/packages/material_ui/lib/src/icons.dart +++ b/packages/material_ui/lib/src/icons.dart @@ -125,7 +125,11 @@ final class PlatformAdaptiveIcons implements Icons { /// uses-material-design: true /// ``` /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This example shows how to create a [Row] of [Icon]s in different colors and /// sizes. The first [Icon] uses a [Icon.semanticLabel] to announce in accessibility /// modes like TalkBack and VoiceOver. @@ -155,7 +159,8 @@ final class PlatformAdaptiveIcons implements Icons { /// ], /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// @@ -172,7 +177,11 @@ abstract final class Icons { /// /// Use with the [Icon] class to show specific icons. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to create a share icon that uses the material icon /// named "share" on non-Apple platforms, and the icon named "ios share" on /// Apple platforms. @@ -182,7 +191,8 @@ abstract final class Icons { /// Icons.adaptive.share, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/ink_decoration.dart b/packages/material_ui/lib/src/ink_decoration.dart index dc921feabced..5414d9c652f0 100644 --- a/packages/material_ui/lib/src/ink_decoration.dart +++ b/packages/material_ui/lib/src/ink_decoration.dart @@ -47,7 +47,10 @@ import 'material.dart'; /// generally speaking will match the order they are given in the widget tree, /// but this order may appear to be somewhat random in more dynamic situations. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This example shows how a [Material] widget can have a yellow rectangle drawn /// on it using [Ink], while still having ink effects over the yellow rectangle: @@ -70,8 +73,12 @@ import 'material.dart'; /// ), /// ) /// ``` -/// {@end-tool} -/// {@tool snippet} +/// +// TODO(framework): End of the blue example container. +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// The following example shows how an image can be printed on a [Material] /// widget with an [InkWell] above it: @@ -105,11 +112,14 @@ import 'material.dart'; /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// What to do if you want to clip this [Ink.image]? /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Wrapping the [Ink] in a clipping widget directly will not work since the /// [Material] it will be printed on is responsible for clipping. /// @@ -117,16 +127,20 @@ import 'material.dart'; /// it is being rendered onto the Scaffold body Material, which isn't wrapped in /// the [ClipRRect]. /// -/// ** See code in examples/api/lib/material/ink/ink.image_clip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/ink/ink.image_clip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// One solution would be to deliberately wrap the [Ink.image] in a [Material]. /// This makes sure the Material that the image is painted on is also responsible /// for clipping said content. /// -/// ** See code in examples/api/lib/material/ink/ink.image_clip.1.dart ** -/// {@end-tool} +/// {@example /example/lib/ink/ink.image_clip.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/ink_sparkle.dart b/packages/material_ui/lib/src/ink_sparkle.dart index 77eed69e11bd..e08e3658e78f 100644 --- a/packages/material_ui/lib/src/ink_sparkle.dart +++ b/packages/material_ui/lib/src/ink_sparkle.dart @@ -43,7 +43,10 @@ import 'material.dart'; /// /// When the ripple is removed, [onRemoved] will be called. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// For typical use, pass the [InkSparkle.splashFactory] to the `splashFactory` /// parameter of a button style or [ThemeData]. @@ -55,7 +58,8 @@ import 'material.dart'; /// onPressed: () { }, /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. class InkSparkle extends InteractiveInkFeature { /// Begin a sparkly ripple effect, centered at [position] relative to /// [referenceBox]. diff --git a/packages/material_ui/lib/src/ink_well.dart b/packages/material_ui/lib/src/ink_well.dart index 2c246f4d356c..69abb76f5ee0 100644 --- a/packages/material_ui/lib/src/ink_well.dart +++ b/packages/material_ui/lib/src/ink_well.dart @@ -1487,12 +1487,15 @@ class _InkResponseState extends State<_InkResponseStateWidget> /// /// An example of this situation is as follows: /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Tap the container to cause it to grow. Then, tap it again and hold before /// the widget reaches its maximum size to observe the clipped ink splash. /// -/// ** See code in examples/api/lib/material/ink_well/ink_well.0.dart ** -/// {@end-tool} +/// {@example /example/lib/ink_well/ink_well.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// An InkWell's splashes will not properly update to conform to changes if the /// size of its underlying [Material], where the splashes are rendered, changes diff --git a/packages/material_ui/lib/src/input_border.dart b/packages/material_ui/lib/src/input_border.dart index c6c33ecff8ca..123e8fb269c6 100644 --- a/packages/material_ui/lib/src/input_border.dart +++ b/packages/material_ui/lib/src/input_border.dart @@ -589,12 +589,15 @@ class OutlineInputBorder extends InputBorder { /// The input decorator's "container" is the optionally filled area above the /// decorator's helper, error, and counter. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to use [ShapedInputBorder] with different /// [ShapeBorder] implementations. /// -/// ** See code in examples/api/lib/material/shaped_input_border/shaped_input_border.0.dart ** -/// {@end-tool} +/// {@example /example/lib/shaped_input_border/shaped_input_border.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/input_chip.dart b/packages/material_ui/lib/src/input_chip.dart index 590210a89410..759bc22e11e4 100644 --- a/packages/material_ui/lib/src/input_chip.dart +++ b/packages/material_ui/lib/src/input_chip.dart @@ -40,23 +40,29 @@ import 'theme_data.dart'; /// * In a horizontally scrollable list, for example configured such as a /// [ListView] with [ListView.scrollDirection] set to [Axis.horizontal]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create [InputChip]s with [onSelected] and /// [onDeleted] callbacks. When the user taps the chip, the chip will be selected. /// When the user taps the delete icon, the chip will be deleted. /// -/// ** See code in examples/api/lib/material/input_chip/input_chip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/input_chip/input_chip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// The following example shows how to generate [InputChip]s from /// user text input. When the user enters a pizza topping in the text field, /// the user is presented with a list of suggestions. When selecting one of the /// suggestions, an [InputChip] is generated in the text field. /// -/// ** See code in examples/api/lib/material/input_chip/input_chip.1.dart ** -/// {@end-tool} +/// {@example /example/lib/input_chip/input_chip.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Material Design 3 /// diff --git a/packages/material_ui/lib/src/input_decorator.dart b/packages/material_ui/lib/src/input_decorator.dart index 818a32397cd7..28a0c03d15b9 100644 --- a/packages/material_ui/lib/src/input_decorator.dart +++ b/packages/material_ui/lib/src/input_decorator.dart @@ -2702,7 +2702,9 @@ class _InputDecoratorState extends State with TickerProviderStat /// to describe their decoration. (In fact, this class is merely the /// configuration of an [InputDecorator], which does all the heavy lifting.) /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to style a `TextField` using an `InputDecorator`. The /// TextField displays a "send message" icon to the left of the input area, /// which is surrounded by a border an all sides. It displays the `hintText` @@ -2711,53 +2713,69 @@ class _InputDecoratorState extends State with TickerProviderStat /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration.png) /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.0.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows how to style a "collapsed" `TextField` using an /// `InputDecorator`. The collapsed `TextField` surrounds the hint text and /// input area with a border, but does not add padding around them. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_collapsed.png) /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.1.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows how to create a `TextField` with hint text, a red border /// on all sides, and an error message. To display a red border and error /// message, provide `errorText` to the [InputDecoration] constructor. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_error.png) /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.2.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows how to style a `TextField` with a round border and /// additional text before and after the input area. It displays "Prefix" before /// the input area, and "Suffix" after the input area. /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/input_decoration_prefix_suffix.png) /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.3.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.3.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows how to style a `TextField` with a prefixIcon that changes color /// based on the `WidgetState`. The color defaults to gray and is green while focused. /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.widget_state.0.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.widget_state.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows how to style a `TextField` with a prefixIcon that changes color /// based on the `WidgetState` through the use of `ThemeData`. The color defaults /// to gray, be blue while focused and red if in an error state. /// -/// ** See code in examples/api/lib/material/input_decorator/input_decoration.widget_state.1.dart ** -/// {@end-tool} +/// {@example /example/lib/input_decorator/input_decoration.widget_state.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -2993,12 +3011,15 @@ class InputDecoration { /// This can be used, for example, to add multiple [TextStyle]'s to a label that would /// otherwise be specified using [labelText], which only takes one [TextStyle]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows a `TextField` with a [Text.rich] widget as the [label]. /// The widget contains multiple [Text] widgets with different [TextStyle]'s. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.label.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.label.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// Only one of [label] and [labelText] can be specified. final Widget? label; @@ -3029,7 +3050,9 @@ class InputDecoration { /// of [InputDecoration] that changes the color of the label to the /// [InputDecoration.errorStyle] color or [ColorScheme.error]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// It's possible to override the label style for just the error state, or /// just the default state, or both. /// @@ -3037,8 +3060,9 @@ class InputDecoration { /// which resolves to a text style whose color depends on the decorator's /// error state. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.label_style_error.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.label_style_error.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// {@endtemplate} final TextStyle? labelStyle; @@ -3062,7 +3086,9 @@ class InputDecoration { /// When the input field receives focus, the font size of [InputDecoration.label] is /// scaled down by 75%. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// It's possible to override the label style for just the error state, or /// just the default state, or both. /// @@ -3070,8 +3096,9 @@ class InputDecoration { /// [WidgetStateProperty] which resolves to a text style whose color depends /// on the decorator's error state. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.floating_label_style_error.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.floating_label_style_error.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// {@endtemplate} final TextStyle? floatingLabelStyle; @@ -3081,12 +3108,15 @@ class InputDecoration { /// the same location as [error]. If a non-null [error] or [errorText] value is /// specified then the [helper] is not shown. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows a `TextField` with a [Text.rich] widget as the [helper]. /// The widget contains [Text] and [Icon] widgets with different styles. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.helper.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.helper.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// Only one of [helper] and [helperText] can be specified. final Widget? helper; @@ -3384,12 +3414,15 @@ class InputDecoration { /// The prefix icon alignment can be changed using [Align] with a fixed `widthFactor` and /// `heightFactor`. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how the prefix icon alignment can be changed using [Align] with /// a fixed `widthFactor` and `heightFactor`. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.prefix_icon.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.prefix_icon.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -3411,7 +3444,9 @@ class InputDecoration { /// setting [isDense] to true and setting the constraints' minimum height /// and width to a value lower than the minimum tappable size. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows the differences between two `TextField` widgets when /// [prefixIconConstraints] is set to the default value and when one is not. /// @@ -3421,8 +3456,9 @@ class InputDecoration { /// If null, [BoxConstraints] with a minimum width and height of 48px is /// used. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.prefix_icon_constraints.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final BoxConstraints? prefixIconConstraints; /// Optional widget to place on the line before the input. @@ -3507,12 +3543,15 @@ class InputDecoration { /// The suffix icon alignment can be changed using [Align] with a fixed `widthFactor` and /// `heightFactor`. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how the suffix icon alignment can be changed using [Align] with /// a fixed `widthFactor` and `heightFactor`. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.suffix_icon.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.suffix_icon.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -3589,7 +3628,9 @@ class InputDecoration { /// If null, a [BoxConstraints] with a minimum width and height of 48px is /// used. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows the differences between two `TextField` widgets when /// [suffixIconConstraints] is set to the default value and when one is not. /// @@ -3599,8 +3640,9 @@ class InputDecoration { /// If null, [BoxConstraints] with a minimum width and height of 48px is /// used. /// - /// ** See code in examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart ** - /// {@end-tool} + /// {@example /example/lib/input_decorator/input_decoration.suffix_icon_constraints.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final BoxConstraints? suffixIconConstraints; /// Optional text to place below the line as a character count. diff --git a/packages/material_ui/lib/src/list_tile.dart b/packages/material_ui/lib/src/list_tile.dart index b5abbf0a8d94..5d826b614bcf 100644 --- a/packages/material_ui/lib/src/list_tile.dart +++ b/packages/material_ui/lib/src/list_tile.dart @@ -203,7 +203,11 @@ enum ListTileTitleAlignment { /// ancestor. In this case, one can wrap a [Material] widget around the /// [ListTile], e.g.: /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// ```dart /// const ColoredBox( /// color: Colors.green, @@ -215,7 +219,8 @@ enum ListTileTitleAlignment { /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Performance considerations when wrapping [ListTile] with [Material] /// @@ -227,46 +232,65 @@ enum ListTileTitleAlignment { /// [selectedTileColor], [focusColor], and [hoverColor] as these colors /// are not drawn by the list tile itself but by the material widget ancestor. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example showcases how [ListTile] needs to be wrapped in a [Material] /// widget to animate colors. /// -/// ** See code in examples/api/lib/material/list_tile/list_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/list_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example uses a [ListView] to demonstrate different configurations of /// [ListTile]s in [Card]s. /// /// ![Different variations of ListTile](https://flutter.github.io/assets-for-api-docs/assets/material/list_tile.png) /// -/// ** See code in examples/api/lib/material/list_tile/list_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/list_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of a [ListTile] using [ThemeData.useMaterial3] flag, /// as described in: https://m3.material.io/components/lists/overview. /// -/// ** See code in examples/api/lib/material/list_tile/list_tile.2.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/list_tile.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows [ListTile]'s [textColor] and [iconColor] can use /// [WidgetStateColor] color to change the color of the text and icon /// when the [ListTile] is enabled, selected, or disabled. /// -/// ** See code in examples/api/lib/material/list_tile/list_tile.3.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/list_tile.3.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows [ListTile.titleAlignment] can be used to configure the /// [leading] and [trailing] widgets alignment relative to the [title] and /// [subtitle] widgets. /// -/// ** See code in examples/api/lib/material/list_tile/list_tile.4.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/list_tile.4.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// -/// {@tool snippet} /// To use a [ListTile] within a [Row], it needs to be wrapped in an /// [Expanded] widget. [ListTile] requires fixed width constraints, /// whereas a [Row] does not constrain its children. @@ -289,8 +313,12 @@ enum ListTileTitleAlignment { /// ], /// ) /// ``` -/// {@end-tool} -/// {@tool snippet} +/// +// TODO(framework): End of the blue example container. +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Tiles can be much more elaborate. Here is a tile which can be tapped, but /// which is disabled when the `_act` variable is not 2. When the tile is @@ -305,7 +333,8 @@ enum ListTileTitleAlignment { /// onTap: () { /* react to the tile being tapped */ } /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// To be accessible, tappable [leading] and [trailing] widgets have to /// be at least 48x48 in size. However, to adhere to the Material spec, @@ -319,7 +348,10 @@ enum ListTileTitleAlignment { /// that are large enough, but it is up to the developer to ensure that /// their widgets follow the Material spec. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Here is an example of a one-line, non-[dense] ListTile with a /// tappable leading widget that adheres to accessibility requirements and @@ -343,7 +375,8 @@ enum ListTileTitleAlignment { /// dense: false, /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## The ListTile layout isn't exactly what I want /// @@ -351,20 +384,26 @@ enum ListTileTitleAlignment { /// you're looking for, it's easy to create custom list items with a /// combination of other widgets, such as [Row]s and [Column]s. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of a custom list item that resembles a YouTube-related /// video list item created with [Expanded] and [Container] widgets. /// -/// ** See code in examples/api/lib/material/list_tile/custom_list_item.0.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/custom_list_item.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// Here is an example of an article list item with multiline titles and /// subtitles. It utilizes [Row]s and [Column]s, as well as [Expanded] and /// [AspectRatio] widgets to organize its layout. /// -/// ** See code in examples/api/lib/material/list_tile/custom_list_item.1.dart ** -/// {@end-tool} +/// {@example /example/lib/list_tile/custom_list_item.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -660,13 +699,16 @@ class ListTile extends StatelessWidget { /// By default the selected color is the theme's primary color. The selected color /// can be overridden with a [ListTileTheme]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Here is an example of using a [StatefulWidget] to keep track of the /// selected index, and using that to set the [selected] property on the /// corresponding [ListTile]. /// - /// ** See code in examples/api/lib/material/list_tile/list_tile.selected.0.dart ** - /// {@end-tool} + /// {@example /example/lib/list_tile/list_tile.selected.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final bool selected; /// The color for the tile's [Material] when it has the input focus. diff --git a/packages/material_ui/lib/src/material_state.dart b/packages/material_ui/lib/src/material_state.dart index 783070c2586c..ec3c0b311bd6 100644 --- a/packages/material_ui/lib/src/material_state.dart +++ b/packages/material_ui/lib/src/material_state.dart @@ -107,7 +107,10 @@ typedef MaterialPropertyResolver = WidgetPropertyResolver; /// to provide a `defaultValue` to the super constructor, so that we can know /// at compile-time what its default color is. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This example defines a [MaterialStateColor] with a const constructor. /// @@ -130,7 +133,8 @@ typedef MaterialPropertyResolver = WidgetPropertyResolver; /// } /// } /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also /// @@ -157,12 +161,15 @@ typedef MaterialStateColor = WidgetStateColor; /// To use a [MaterialStateMouseCursor], you should create a subclass of /// [MaterialStateMouseCursor] and implement the abstract `resolve` method. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example defines a mouse cursor that resolves to /// [SystemMouseCursors.forbidden] when its widget is disabled. /// -/// ** See code in examples/api/lib/material/material_state/material_state_mouse_cursor.0.dart ** -/// {@end-tool} +/// {@example /example/lib/material_state/material_state_mouse_cursor.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// This class should only be used for parameters which are documented to take /// [MaterialStateMouseCursor], otherwise only the default state will be used. @@ -192,12 +199,15 @@ typedef MaterialStateMouseCursor = WidgetStateMouseCursor; /// property values. [MaterialStateBorderSide] should only be used with widgets that document /// their support, like [ActionChip.side]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example defines a subclass of [MaterialStateBorderSide], that resolves /// to a red border side when its widget is selected. /// -/// ** See code in examples/api/lib/material/material_state/material_state_border_side.0.dart ** -/// {@end-tool} +/// {@example /example/lib/material_state/material_state_border_side.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// This class should only be used for parameters which are documented to take /// [MaterialStateBorderSide], otherwise only the default state will be used. @@ -220,13 +230,16 @@ typedef MaterialStateBorderSide = WidgetStateBorderSide; /// [OutlinedBorder] and implement [MaterialStateOutlinedBorder]'s abstract /// `resolve` method. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example defines a subclass of [RoundedRectangleBorder] and an /// implementation of [MaterialStateOutlinedBorder], that resolves to /// [RoundedRectangleBorder] when its widget is selected. /// -/// ** See code in examples/api/lib/widgets/widget_state/widget_state_outlined_border.0.dart ** -/// {@end-tool} +/// {@example /example/lib/material_state/material_state_outlined_border.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// This class should only be used for parameters which are documented to take /// [MaterialStateOutlinedBorder], otherwise only the default state will be used. @@ -456,12 +469,15 @@ class _MaterialStateUnderlineInputBorder extends MaterialStateUnderlineInputBord /// resolves the input border in the given states. /// 3. Using [WidgetStateInputBorder.fromMap] to assign a border with a [WidgetStateMap]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to use [WidgetStateInputBorder] to create /// a [TextField] with an appearance that responds to user interaction. /// -/// ** See code in examples/api/lib/material/widget_state_input_border/widget_state_input_border.0.dart ** -/// {@end-tool} +/// {@example /example/lib/widget_state_input_border/widget_state_input_border.0.dart} +/// +// TODO(framework): End of the @dartpad directive. abstract interface class WidgetStateInputBorder implements InputBorder, WidgetStateProperty { /// Creates a [WidgetStateInputBorder] using a [WidgetPropertyResolver] @@ -520,15 +536,18 @@ class _WidgetInputBorderMapper extends WidgetStateMapper /// of their current material state and [resolve] the button style's /// material state properties when their value is needed. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how you can override the default text and icon /// color (the "foreground color") of a [TextButton] with a /// [MaterialStateProperty]. In this example, the button's text color /// will be `Colors.blue` when the button is being pressed, hovered, /// or focused. Otherwise, the text color will be `Colors.red`. /// -/// ** See code in examples/api/lib/material/material_state/material_state_property.0.dart ** -/// {@end-tool} +/// {@example /example/lib/material_state/material_state_property.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/material_state_mixin.dart b/packages/material_ui/lib/src/material_state_mixin.dart index 224eb9164d6f..5222cbcf12fe 100644 --- a/packages/material_ui/lib/src/material_state_mixin.dart +++ b/packages/material_ui/lib/src/material_state_mixin.dart @@ -19,7 +19,11 @@ import 'package:flutter/widgets.dart'; /// to manage the set of active [WidgetState]s, and the calling of [setState] /// as necessary. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// This example shows how to write a [StatefulWidget] that uses the /// [MaterialStateMixin] class to watch [WidgetState] values. /// @@ -47,7 +51,8 @@ import 'package:flutter/widgets.dart'; /// } /// } /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. @optionalTypeArgs mixin MaterialStateMixin on State { /// Managed set of active [WidgetState] values; designed to be passed to @@ -71,7 +76,11 @@ mixin MaterialStateMixin on State { /// If supplied, the [onChanged] function is only called when child widgets /// report events that make changes to the current set of [WidgetState]s. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to use the [updateMaterialState] callback factory /// in other widgets, including the optional [onChanged] callback. /// @@ -105,7 +114,8 @@ mixin MaterialStateMixin on State { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. @protected ValueChanged updateMaterialState(WidgetState key, {ValueChanged? onChanged}) { return (bool value) { diff --git a/packages/material_ui/lib/src/menu_anchor.dart b/packages/material_ui/lib/src/menu_anchor.dart index 1126c8c2e03a..817cefa2a8aa 100644 --- a/packages/material_ui/lib/src/menu_anchor.dart +++ b/packages/material_ui/lib/src/menu_anchor.dart @@ -211,29 +211,38 @@ class _TweenCurve extends Curve { /// to retrieve the controller for the closest [MenuAnchor] ancestor of a given [BuildContext]. /// More detailed usage of [MenuController] is available in its class documentation. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to use a [MenuAnchor] to wrap a button and open a /// cascading menu from the button. This example also shows how to use /// [onAnimationStatusChanged] to track animation status and toggle the menu. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_anchor.0.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_anchor.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to use a [MenuAnchor] to create a cascading context /// menu in a region of the view, positioned where the user clicks the mouse /// with Ctrl pressed. The [anchorTapClosesMenu] attribute is set to true so /// that clicks on the [MenuAnchor] area will cause the menus to be closed. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_anchor.1.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_anchor.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example demonstrates a simplified cascading menu using the [MenuAnchor] /// widget. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_anchor.3.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_anchor.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// The [MenuStyle.visualDensity] setting only affects horizontal padding, /// and it will never make it negative. Vertical padding is not affected at all. @@ -403,7 +412,11 @@ class MenuAnchor extends StatefulWidget { /// therefore cannot be used on its own to determine the current animation /// direction. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example shows how to use the [onAnimationStatusChanged] callback to /// create a [MenuAnchor] that will toggle between opening and closing. /// @@ -429,7 +442,8 @@ class MenuAnchor extends StatefulWidget { /// }, /// ); /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Defaults to null. final ValueChanged? onAnimationStatusChanged; @@ -811,13 +825,16 @@ class _MenuAnchorState extends State with SingleTickerProviderStateM /// sure that selecting a menu item and triggering the shortcut do the same /// thing, it is recommended that they call the same callback. /// -/// {@tool dartpad} This example shows a [MenuBar] that contains a single top +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// This example shows a [MenuBar] that contains a single top /// level menu, containing three items: "About", a checkbox menu item for /// showing a message, and "Quit". The items are identified with an enum value, /// and the shortcuts are registered globally with the [ShortcutRegistry]. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// {@endtemplate} /// /// {@macro flutter.material.MenuAcceleratorLabel.accelerator_sample} @@ -1330,12 +1347,15 @@ class _MenuItemButtonState extends State { /// To style the checkbox separately from the button, add a [CheckboxTheme] /// ancestor. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a menu with a checkbox that shows a message in the body /// of the app if checked. /// -/// ** See code in examples/api/lib/material/menu_anchor/checkbox_menu_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/checkbox_menu_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1526,12 +1546,15 @@ class CheckboxMenuButton extends StatelessWidget { /// To style the radio button separately from the overall button, add a /// [RadioTheme] ancestor. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a menu with three radio buttons with shortcuts that /// changes the background color of the body when the buttons are selected. /// -/// ** See code in examples/api/lib/material/menu_anchor/radio_menu_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/radio_menu_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -2918,15 +2941,18 @@ typedef MenuAcceleratorChildBuilder = /// not necessary to provide one. /// /// {@template flutter.material.MenuAcceleratorLabel.accelerator_sample} -/// {@tool dartpad} This example shows a [MenuBar] that handles keyboard +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// This example shows a [MenuBar] that handles keyboard /// accelerators using [MenuAcceleratorLabel]. To use the accelerators, press /// the Alt key to see which letters are underlined in the menu bar, and then /// press the appropriate letter. Accelerators are not supported on macOS or iOS /// since those platforms don't support them natively, so this demo will only /// show a regular Material menu bar on those platforms. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_accelerator_label.0.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_accelerator_label.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// {@endtemplate} class MenuAcceleratorLabel extends StatefulWidget { /// Creates a const [MenuAcceleratorLabel]. diff --git a/packages/material_ui/lib/src/navigation_bar.dart b/packages/material_ui/lib/src/navigation_bar.dart index d8420a1bda27..69aa716f71fd 100644 --- a/packages/material_ui/lib/src/navigation_bar.dart +++ b/packages/material_ui/lib/src/navigation_bar.dart @@ -54,25 +54,33 @@ const double _kMaxLabelTextScaleFactor = 1.3; /// This widget holds a collection of destinations (usually /// [NavigationDestination]s). /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [NavigationBar] as it is used within a [Scaffold] /// widget. The [NavigationBar] has three [NavigationDestination] widgets and /// the initial [selectedIndex] is set to index 0. The [onDestinationSelected] /// callback changes the selected item's index and displays a corresponding /// widget in the body of the [Scaffold]. /// -/// ** See code in examples/api/lib/material/navigation_bar/navigation_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_bar/navigation_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example showcases [NavigationBar] label behaviors. When tapping on one /// of the label behavior options, the [labelBehavior] of the [NavigationBar] /// will be updated. /// -/// ** See code in examples/api/lib/material/navigation_bar/navigation_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_bar/navigation_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a [NavigationBar] within a main [Scaffold] /// widget that's used to control the visibility of destination pages. /// Each destination has its own scaffold and a nested navigator that @@ -86,8 +94,9 @@ const double _kMaxLabelTextScaleFactor = 1.3; /// fades in the new one. Destinations that aren't visible or animating /// are kept [Offstage]. /// -/// ** See code in examples/api/lib/material/navigation_bar/navigation_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_bar/navigation_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// See also: /// /// * [NavigationDestination] diff --git a/packages/material_ui/lib/src/navigation_drawer.dart b/packages/material_ui/lib/src/navigation_drawer.dart index fb8b916101b8..46f118ddad18 100644 --- a/packages/material_ui/lib/src/navigation_drawer.dart +++ b/packages/material_ui/lib/src/navigation_drawer.dart @@ -33,15 +33,18 @@ import 'theme.dart'; /// They are treated as a group and when one is selected, the [onDestinationSelected] /// is called with the index into the group that corresponds to the selected destination. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [NavigationDrawer] used within a [Scaffold] /// widget. The [NavigationDrawer] has headline widget, divider widget and three /// [NavigationDrawerDestination] widgets. The initial [selectedIndex] is 0. /// The [onDestinationSelected] callback changes the selected item's index and displays /// a corresponding widget in the body of the [Scaffold]. /// -/// ** See code in examples/api/lib/material/navigation_drawer/navigation_drawer.0.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_drawer/navigation_drawer.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/navigation_rail.dart b/packages/material_ui/lib/src/navigation_rail.dart index 20b0ba29d5ed..703a4c62ea06 100644 --- a/packages/material_ui/lib/src/navigation_rail.dart +++ b/packages/material_ui/lib/src/navigation_rail.dart @@ -48,12 +48,15 @@ const double _kIndicatorHeight = 32; /// [the adaptive_scaffold.dart sample](https://github.com/flutter/demos/blob/main/web_dashboard/lib/src/widgets/third_party/adaptive_scaffold.dart) /// for an example. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows the creation of [NavigationRail] widget used within a Scaffold with 3 /// [NavigationRailDestination]s, as described in: https://m3.material.io/components/navigation-rail/overview /// -/// ** See code in examples/api/lib/material/navigation_rail/navigation_rail.0.dart ** -/// {@end-tool} +/// {@example /example/lib/navigation_rail/navigation_rail.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -375,7 +378,9 @@ class NavigationRail extends StatefulWidget { /// This can be used to synchronize animations in the [leading] or [trailing] /// widget, such as an animated menu or a [FloatingActionButton] animation. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to use this animation to create a [FloatingActionButton] /// that animates itself between the normal and extended states of the /// [NavigationRail]. @@ -383,8 +388,9 @@ class NavigationRail extends StatefulWidget { /// An instance of `MyNavigationRailFab` is created for [NavigationRail.leading]. /// Pressing the FAB button toggles the "extended" state of the [NavigationRail]. /// - /// ** See code in examples/api/lib/material/navigation_rail/navigation_rail.extended_animation.0.dart ** - /// {@end-tool} + /// {@example /example/lib/navigation_rail/navigation_rail.extended_animation.0.dart} + /// + // TODO(framework): End of the @dartpad directive. static Animation extendedAnimation(BuildContext context) { return context .dependOnInheritedWidgetOfExactType<_ExtendedNavigationRailAnimation>()! diff --git a/packages/material_ui/lib/src/outlined_button.dart b/packages/material_ui/lib/src/outlined_button.dart index 6ae8aa6f12b2..63ae4d37c90e 100644 --- a/packages/material_ui/lib/src/outlined_button.dart +++ b/packages/material_ui/lib/src/outlined_button.dart @@ -53,11 +53,14 @@ import 'theme_data.dart'; /// appearance of its outline, both the [ButtonStyle.shape] and /// [ButtonStyle.side] properties must be specified. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of a basic [OutlinedButton]. /// -/// ** See code in examples/api/lib/material/outlined_button/outlined_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/outlined_button/outlined_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// The static [styleFrom] method is a convenient way to create a /// outlined button [ButtonStyle] from simple values. diff --git a/packages/material_ui/lib/src/page_transitions_theme.dart b/packages/material_ui/lib/src/page_transitions_theme.dart index 72488265f8bf..00fb9e07a06c 100644 --- a/packages/material_ui/lib/src/page_transitions_theme.dart +++ b/packages/material_ui/lib/src/page_transitions_theme.dart @@ -428,11 +428,14 @@ class _FadeForwardsPageTransition extends StatelessWidget { /// transition animation that looks like the default page transition /// used on Android U. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows the default page transition on Android. /// -/// ** See code in examples/api/lib/material/page_transitions_theme/page_transitions_theme.3.dart ** -/// {@end-tool} +/// {@example /example/lib/page_transitions_theme/page_transitions_theme.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -607,12 +610,15 @@ class ZoomPageTransitionsBuilder extends PageTransitionsBuilder { /// while the route animation plays may appear frozen - unless they are a hero /// animation or something that is drawn in a separate overlay. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows a [MaterialApp] that disables snapshotting for the zoom /// transitions on Android. /// - /// ** See code in examples/api/lib/material/page_transitions_theme/page_transitions_theme.1.dart ** - /// {@end-tool} + /// {@example /example/lib/page_transitions_theme/page_transitions_theme.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -730,11 +736,14 @@ class ZoomPageTransitionsBuilder extends PageTransitionsBuilder { /// If a builder with a matching platform is not found, then the /// [ZoomPageTransitionsBuilder] is used. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [MaterialApp] that defines a custom [PageTransitionsTheme]. /// -/// ** See code in examples/api/lib/material/page_transitions_theme/page_transitions_theme.0.dart ** -/// {@end-tool} +/// {@example /example/lib/page_transitions_theme/page_transitions_theme.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/paginated_data_table.dart b/packages/material_ui/lib/src/paginated_data_table.dart index 5932b77a27d2..d346cf46c821 100644 --- a/packages/material_ui/lib/src/paginated_data_table.dart +++ b/packages/material_ui/lib/src/paginated_data_table.dart @@ -38,22 +38,28 @@ import 'theme.dart'; /// If the [key] is a [PageStorageKey], the [initialFirstRowIndex] is persisted /// to [PageStorage]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// /// This sample shows how to display a [DataTable] with three columns: name, /// age, and role. The columns are defined by three [DataColumn] objects. The /// table contains three rows of data for three example users, the data for /// which is defined by three [DataRow] objects. /// -/// ** See code in examples/api/lib/material/paginated_data_table/paginated_data_table.0.dart ** -/// {@end-tool} +/// {@example /example/lib/paginated_data_table/paginated_data_table.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// /// This example shows how paginated data tables can supported sorted data. /// -/// ** See code in examples/api/lib/material/paginated_data_table/paginated_data_table.1.dart ** -/// {@end-tool} +/// {@example /example/lib/paginated_data_table/paginated_data_table.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/popup_menu.dart b/packages/material_ui/lib/src/popup_menu.dart index 304c48dd46a5..c933e06ed56b 100644 --- a/packages/material_ui/lib/src/popup_menu.dart +++ b/packages/material_ui/lib/src/popup_menu.dart @@ -148,14 +148,18 @@ class PopupMenuDivider extends PopupMenuEntry { /// {@macro flutter.material.Divider.color} /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// const PopupMenuDivider( /// color: Colors.deepOrange, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final Color? color; @override @@ -241,7 +245,10 @@ class _RenderMenuItem extends RenderShiftedBox { /// [PopupMenuItem] is [kMinInteractiveDimension] pixels high. If you use a widget /// with a different height, it must be specified in the [height] property. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Here, a [Text] widget is used with a popup menu item. The `Menu` type /// is an enum, not shown here. @@ -252,7 +259,8 @@ class _RenderMenuItem extends RenderShiftedBox { /// child: Text('Item 1'), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See the example at [PopupMenuButton] for how this example could be used in a /// complete menu, and see the example at [CheckedPopupMenuItem] for one way to @@ -494,7 +502,10 @@ class PopupMenuItemState> extends State { /// layout uses [ListTile]; the checkmark is an [Icons.done] icon, shown in the /// [ListTile.leading] position. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Suppose a `Commands` enum exists that lists the possible commands from a /// particular popup menu, including `Commands.heroAndScholar` and @@ -531,7 +542,8 @@ class PopupMenuItemState> extends State { /// ], /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// In particular, observe how the second menu item uses a [ListTile] with a /// blank [Icon] in the [ListTile.leading] position to get the same alignment as @@ -1291,32 +1303,44 @@ typedef PopupMenuItemBuilder = List> Function(BuildContext /// Use the sample below for an example of migrating from [PopupMenuButton] to /// [MenuAnchor]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a menu with three items, selecting between an enum's /// values and setting a `selectedMenu` field based on the selection. /// -/// ** See code in examples/api/lib/material/popup_menu/popup_menu.0.dart ** -/// {@end-tool} +/// {@example /example/lib/popup_menu/popup_menu.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to migrate the above to a [MenuAnchor]. /// -/// ** See code in examples/api/lib/material/menu_anchor/menu_anchor.2.dart ** -/// {@end-tool} +/// {@example /example/lib/menu_anchor/menu_anchor.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of a popup menu, as described in: /// https://m3.material.io/components/menus/overview /// -/// ** See code in examples/api/lib/material/popup_menu/popup_menu.1.dart ** -/// {@end-tool} +/// {@example /example/lib/popup_menu/popup_menu.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample showcases how to override the [PopupMenuButton] animation /// curves and duration using [AnimationStyle]. /// -/// ** See code in examples/api/lib/material/popup_menu/popup_menu.2.dart ** -/// {@end-tool} +/// {@example /example/lib/popup_menu/popup_menu.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/progress_indicator.dart b/packages/material_ui/lib/src/progress_indicator.dart index 8e8489d5dc8a..7a488475f3cd 100644 --- a/packages/material_ui/lib/src/progress_indicator.dart +++ b/packages/material_ui/lib/src/progress_indicator.dart @@ -384,21 +384,27 @@ class _LinearProgressIndicatorPainter extends CustomPainter { /// The minimum height of the indicator can be specified using [minHeight]. /// The indicator can be made taller by wrapping the widget with a [SizedBox]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example showcases determinate and indeterminate [LinearProgressIndicator]s. /// The [LinearProgressIndicator]s will use the ![updated Material 3 Design appearance](https://m3.material.io/components/progress-indicators/overview) /// when setting the [LinearProgressIndicator.year2023] flag to false. /// -/// ** See code in examples/api/lib/material/progress_indicator/linear_progress_indicator.0.dart ** -/// {@end-tool} +/// {@example /example/lib/progress_indicator/linear_progress_indicator.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of a [LinearProgressIndicator] with a changing value. /// When toggling the switch, [LinearProgressIndicator] uses a determinate value. /// As described in: https://m3.material.io/components/progress-indicators/overview /// -/// ** See code in examples/api/lib/material/progress_indicator/linear_progress_indicator.1.dart ** -/// {@end-tool} +/// {@example /example/lib/progress_indicator/linear_progress_indicator.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// {@macro flutter.material.ProgressIndicator.AnimationSynchronization} /// @@ -803,21 +809,27 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// The indicator arc is displayed with [valueColor], an animated value. To /// specify a constant color use: `AlwaysStoppedAnimation(color)`. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example showcases determinate and indeterminate [CircularProgressIndicator]s. /// The [CircularProgressIndicator]s will use the ![updated Material 3 Design appearance](https://m3.material.io/components/progress-indicators/overview) /// when setting the [CircularProgressIndicator.year2023] flag to false. /// -/// ** See code in examples/api/lib/material/progress_indicator/circular_progress_indicator.0.dart ** -/// {@end-tool} +/// {@example /example/lib/progress_indicator/circular_progress_indicator.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample shows the creation of a [CircularProgressIndicator] with a changing value. /// When toggling the switch, [CircularProgressIndicator] uses a determinate value. /// As described in: https://m3.material.io/components/progress-indicators/overview /// -/// ** See code in examples/api/lib/material/progress_indicator/circular_progress_indicator.1.dart ** -/// {@end-tool} +/// {@example /example/lib/progress_indicator/circular_progress_indicator.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// {@template flutter.material.ProgressIndicator.AnimationSynchronization} /// ## Animation synchronization @@ -839,7 +851,9 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// [controller] property of an individual indicator. /// {@endtemplate} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to synchronize the indeterminate animations /// of multiple [CircularProgressIndicator]s using a [Theme]. /// @@ -851,8 +865,9 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// This forces each indicator to create its own internal controller, /// causing their animations to become desynchronized. /// -/// ** See code in examples/api/lib/material/progress_indicator/circular_progress_indicator.2.dart ** -/// {@end-tool} +/// {@example /example/lib/progress_indicator/circular_progress_indicator.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/progress_indicator_theme.dart b/packages/material_ui/lib/src/progress_indicator_theme.dart index 6be38c4d6ca7..bb1bb427ba8e 100644 --- a/packages/material_ui/lib/src/progress_indicator_theme.dart +++ b/packages/material_ui/lib/src/progress_indicator_theme.dart @@ -316,7 +316,10 @@ class ProgressIndicatorThemeData with Diagnosticable { /// Values specified here are used for [ProgressIndicator] properties that are not /// given an explicit non-null value. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Here is an example of a progress indicator theme that applies a red indicator /// color. @@ -329,7 +332,8 @@ class ProgressIndicatorThemeData with Diagnosticable { /// child: LinearProgressIndicator() /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. class ProgressIndicatorTheme extends InheritedTheme { /// Creates a theme that controls the configurations for [ProgressIndicator] /// widgets. diff --git a/packages/material_ui/lib/src/radio.dart b/packages/material_ui/lib/src/radio.dart index 45328e8786aa..4220a4d8273c 100644 --- a/packages/material_ui/lib/src/radio.dart +++ b/packages/material_ui/lib/src/radio.dart @@ -44,7 +44,9 @@ const double _kInnerRadius = 4.5; /// [RadioGroup.groupValue], and the [Radio] under it with matching [value] /// will be selected. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of Radio widgets wrapped in ListTiles, which is similar /// to what you could get with the RadioListTile widget. /// @@ -60,10 +62,13 @@ const double _kInnerRadius = 4.5; /// /// Requires one of its ancestors to be a [Material] widget. /// -/// ** See code in examples/api/lib/material/radio/radio.0.dart ** -/// {@end-tool} +/// {@example /example/lib/radio/radio.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// Here is an example of how the you can override the default theme of a /// [Radio] with [WidgetStateProperty]. /// @@ -74,8 +79,9 @@ const double _kInnerRadius = 4.5; /// - The third [Radio] customizes the [side] property to display a different border color /// when selected or unselected. /// -/// ** See code in examples/api/lib/material/radio/radio.1.dart ** -/// {@end-tool} +/// {@example /example/lib/radio/radio.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -242,12 +248,15 @@ class Radio extends StatefulWidget { /// {@macro flutter.widget.RawRadio.toggleable} /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to enable deselecting a radio button by setting the /// [toggleable] attribute. /// - /// ** See code in examples/api/lib/material/radio/radio.toggleable.0.dart ** - /// {@end-tool} + /// {@example /example/lib/radio/radio.toggleable.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final bool toggleable; /// The color to use when this radio button is selected. @@ -267,7 +276,11 @@ class Radio extends StatefulWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [fillColor] based on the current [WidgetState] /// of the [Radio], providing a different [Color] when it is /// [WidgetState.disabled]. @@ -283,7 +296,8 @@ class Radio extends StatefulWidget { /// }) /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// If null, then the value of [activeColor] is used in the selected state. If diff --git a/packages/material_ui/lib/src/radio_list_tile.dart b/packages/material_ui/lib/src/radio_list_tile.dart index 1a35b2b1330c..4e2e76230634 100644 --- a/packages/material_ui/lib/src/radio_list_tile.dart +++ b/packages/material_ui/lib/src/radio_list_tile.dart @@ -63,7 +63,11 @@ enum _RadioType { material, adaptive } /// [RadioListTile] itself but by the [Material] widget ancestor. In this /// case, one can wrap a [Material] widget around the [RadioListTile], e.g.: /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// ```dart /// const ColoredBox( /// color: Colors.green, @@ -76,7 +80,8 @@ enum _RadioType { material, adaptive } /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Performance considerations when wrapping [RadioListTile] with [Material] /// @@ -84,21 +89,27 @@ enum _RadioType { material, adaptive } /// is expensive. Consider only wrapping the [RadioListTile]s that require it /// or include a common [Material] ancestor where possible. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![RadioListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile.png) /// /// This widget shows a pair of radio buttons that control the `_character` /// field. The field is of the type `SingingCharacter`, an enum. /// -/// ** See code in examples/api/lib/material/radio_list_tile/radio_list_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/radio_list_tile/radio_list_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample demonstrates how [RadioListTile] positions the radio widget /// relative to the text in different configurations. /// -/// ** See code in examples/api/lib/material/radio_list_tile/radio_list_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/radio_list_tile/radio_list_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Semantics in RadioListTile /// @@ -117,15 +128,18 @@ enum _RadioType { material, adaptive } /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Radio list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_semantics.png) /// /// Here is an example of a custom labeled radio widget, called /// LinkedLabelRadio, that includes an interactive [RichText] widget that /// handles tap gestures. /// -/// ** See code in examples/api/lib/material/radio_list_tile/custom_labeled_radio.0.dart ** -/// {@end-tool} +/// {@example /example/lib/radio_list_tile/custom_labeled_radio.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## RadioListTile isn't exactly what I want /// @@ -134,14 +148,17 @@ enum _RadioType { material, adaptive } /// combining [Radio] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Custom radio list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/radio_list_tile_custom.png) /// /// Here is an example of a custom LabeledRadio widget, but you can easily /// make your own configurable widget. /// -/// ** See code in examples/api/lib/material/radio_list_tile/custom_labeled_radio.1.dart ** -/// {@end-tool} +/// {@example /example/lib/radio_list_tile/custom_labeled_radio.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -351,12 +368,15 @@ class RadioListTile extends StatefulWidget { /// /// The default is false. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to enable deselecting a radio button by setting the /// [toggleable] attribute. /// - /// ** See code in examples/api/lib/material/radio_list_tile/radio_list_tile.toggleable.0.dart ** - /// {@end-tool} + /// {@example /example/lib/radio_list_tile/radio_list_tile.toggleable.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final bool toggleable; /// The color to use when this radio button is selected. diff --git a/packages/material_ui/lib/src/range_slider.dart b/packages/material_ui/lib/src/range_slider.dart index fb735a936cc7..44d5b8b277b8 100644 --- a/packages/material_ui/lib/src/range_slider.dart +++ b/packages/material_ui/lib/src/range_slider.dart @@ -47,7 +47,9 @@ typedef PaintRangeValueIndicator = void Function(PaintingContext context, Offset /// /// {@youtube 560 315 https://www.youtube.com/watch?v=ufb4gIPDmEs} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![A range slider widget, consisting of 5 divisions and showing the default /// value indicator.](https://flutter.github.io/assets-for-api-docs/assets/material/range_slider.png) /// @@ -55,8 +57,9 @@ typedef PaintRangeValueIndicator = void Function(PaintingContext context, Offset /// divisions, from 0 to 100. This means are values are split between 0, 20, 40, /// 60, 80, and 100. The range values are initialized with 40 and 80 in this demo. /// -/// ** See code in examples/api/lib/material/range_slider/range_slider.0.dart ** -/// {@end-tool} +/// {@example /example/lib/range_slider/range_slider.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// A range slider can be used to select from either a continuous or a discrete /// set of values. The default is to use a continuous range of values from [min] @@ -197,7 +200,10 @@ class RangeSlider extends StatefulWidget { /// [StatefulWidget] using the [State.setState] method, so that the parent /// gets rebuilt; for example: /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// RangeSlider( @@ -211,7 +217,8 @@ class RangeSlider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -229,7 +236,10 @@ class RangeSlider extends StatefulWidget { /// The values passed will be the last [values] that the slider had before the /// change began. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// RangeSlider( @@ -246,7 +256,8 @@ class RangeSlider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -264,7 +275,10 @@ class RangeSlider extends StatefulWidget { /// [onChanged] for that). Rather, it should be used to know when the user has /// completed selecting a new [values] by ending a drag or a click. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// RangeSlider( @@ -281,7 +295,8 @@ class RangeSlider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -377,7 +392,10 @@ class RangeSlider extends StatefulWidget { /// This is used by accessibility frameworks like TalkBack on Android to /// inform users what the currently selected value is with more context. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// In the example below, a slider for currency values is configured to /// announce a value with a currency label. @@ -397,7 +415,8 @@ class RangeSlider extends StatefulWidget { /// } /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final SemanticFormatterCallback? semanticFormatterCallback; /// Determines the padding around the [RangeSlider]. diff --git a/packages/material_ui/lib/src/refresh_indicator.dart b/packages/material_ui/lib/src/refresh_indicator.dart index e87af1acd8a0..9f75f6e7f0ba 100644 --- a/packages/material_ui/lib/src/refresh_indicator.dart +++ b/packages/material_ui/lib/src/refresh_indicator.dart @@ -87,24 +87,33 @@ enum _IndicatorType { material, adaptive, noSpinner } /// /// The trigger mode is configured by [RefreshIndicator.triggerMode]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how [RefreshIndicator] can be triggered in different ways. /// -/// ** See code in examples/api/lib/material/refresh_indicator/refresh_indicator.0.dart ** -/// {@end-tool} +/// {@example /example/lib/refresh_indicator/refresh_indicator.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to trigger [RefreshIndicator] in a nested scroll view using /// the [notificationPredicate] property. /// -/// ** See code in examples/api/lib/material/refresh_indicator/refresh_indicator.1.dart ** -/// {@end-tool} +/// {@example /example/lib/refresh_indicator/refresh_indicator.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to use [RefreshIndicator] without the spinner. /// -/// ** See code in examples/api/lib/material/refresh_indicator/refresh_indicator.2.dart ** -/// {@end-tool} +/// {@example /example/lib/refresh_indicator/refresh_indicator.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Troubleshooting /// diff --git a/packages/material_ui/lib/src/reorderable_list.dart b/packages/material_ui/lib/src/reorderable_list.dart index 940c653554d7..becfbf5e5c16 100644 --- a/packages/material_ui/lib/src/reorderable_list.dart +++ b/packages/material_ui/lib/src/reorderable_list.dart @@ -26,10 +26,13 @@ import 'theme.dart'; /// The [onReorderItem] parameter will be called when a child /// widget is dragged to a new position. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.0.dart ** -/// {@end-tool} +/// +/// {@example /example/lib/reorderable_list/reorderable_list_view.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// By default, on [TargetPlatformVariant.desktop] platforms each item will /// have a drag handle added on top of it that will allow the user to grab it @@ -43,26 +46,32 @@ import 'theme.dart'; /// This example demonstrates using the [ReorderableListView.proxyDecorator] callback /// to customize the appearance of a list item while it's being dragged. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// While a drag is underway, the widget returned by the [ReorderableListView.proxyDecorator] /// callback serves as a "proxy" (a substitute) for the item in the list. The proxy is /// created with the original list item as its child. The [ReorderableListView.proxyDecorator] /// callback in this example is similar to the default one except that it changes the /// proxy item's background color. /// -/// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.1.dart ** -/// {@end-tool} +/// {@example /example/lib/reorderable_list/reorderable_list_view.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// This example demonstrates using the [ReorderableListView.proxyDecorator] callback to /// customize the appearance of a [Card] while it's being dragged. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// The default [proxyDecorator] wraps the dragged item in a [Material] widget and animates /// its elevation. This example demonstrates how to use the [ReorderableListView.proxyDecorator] /// callback to update the dragged card elevation without inserted a new [Material] widget. /// -/// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.2.dart ** -/// {@end-tool} +/// {@example /example/lib/reorderable_list/reorderable_list_view.2.dart} +/// +// TODO(framework): End of the @dartpad directive. class ReorderableListView extends StatefulWidget { /// Creates a reorderable list from a pre-built list of widgets. /// @@ -154,10 +163,13 @@ class ReorderableListView extends StatefulWidget { /// This example creates a list using the /// [ReorderableListView.builder] constructor. Using the [IndexedWidgetBuilder], The /// list items are built lazily on demand. - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// + /// + /// {@example /example/lib/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart} /// - /// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.reorderable_list_view_builder.0.dart ** - /// {@end-tool} + // TODO(framework): End of the @dartpad directive. /// See also: /// /// * [ReorderableListView], which allows you to build a reorderable @@ -261,11 +273,14 @@ class ReorderableListView extends StatefulWidget { /// The following sample specifies `buildDefaultDragHandles: false`, and /// uses a [Card] at the leading edge of each item for the item's drag handle. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// + /// /// + /// {@example /example/lib/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart} /// - /// ** See code in examples/api/lib/material/reorderable_list/reorderable_list_view.build_default_drag_handles.0.dart ** - /// {@end-tool} + // TODO(framework): End of the @dartpad directive. final bool buildDefaultDragHandles; /// {@macro flutter.widgets.reorderable_list.padding} diff --git a/packages/material_ui/lib/src/scaffold.dart b/packages/material_ui/lib/src/scaffold.dart index a7a0175b78b4..3ebc163a0455 100644 --- a/packages/material_ui/lib/src/scaffold.dart +++ b/packages/material_ui/lib/src/scaffold.dart @@ -94,11 +94,14 @@ enum _ScaffoldSlot { /// Scaffolds, set a new scope by instantiating a new ScaffoldMessenger in /// between the levels of nesting. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of showing a [SnackBar] when the user presses a button. /// -/// ** See code in examples/api/lib/material/scaffold/scaffold_messenger.0.dart ** -/// {@end-tool} +/// {@example /example/lib/scaffold/scaffold_messenger.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -121,12 +124,15 @@ class ScaffoldMessenger extends StatefulWidget { /// The state from the closest instance of this class that encloses the given /// context. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Typical usage of the [ScaffoldMessenger.of] function is to call it in /// response to a user gesture or an application state change. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger.of.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger.of.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// A less elegant but more expedient solution is to assign a [GlobalKey] to the /// [ScaffoldMessenger], then use the `key.currentState` property to obtain the @@ -134,7 +140,9 @@ class ScaffoldMessenger extends StatefulWidget { /// function. The [MaterialApp.scaffoldMessengerKey] refers to the root /// ScaffoldMessenger that is provided by default. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Sometimes [SnackBar]s are produced by code that doesn't have ready access /// to a valid [BuildContext]. One such example of this is when you show a /// SnackBar from a method outside of the `build` function. In these @@ -142,8 +150,9 @@ class ScaffoldMessenger extends StatefulWidget { /// example shows a key being used to obtain the [ScaffoldMessengerState] /// provided by the [MaterialApp]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger.of.1.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger.of.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// If there is no [ScaffoldMessenger] in scope, then this will assert in /// debug mode, and throw an exception in release mode. @@ -266,11 +275,14 @@ class ScaffoldMessengerState extends State with TickerProvide /// See [ScaffoldMessenger.of] for information about how to obtain the /// [ScaffoldMessengerState]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Here is an example of showing a [SnackBar] when the user presses a button. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger_state.show_snack_bar.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// ## Relative positioning of floating SnackBars /// @@ -282,17 +294,23 @@ class ScaffoldMessengerState extends State with TickerProvide /// In this case, consider constraining the size of these widgets to allow room for /// the SnackBar to be visible. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Here is an example showing how to display a [SnackBar] with [showSnackBar] /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger_state.show_snack_bar.0.dart} + /// + // TODO(framework): End of the @dartpad directive. + /// + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// - /// {@tool dartpad} /// Here is an example showing that a floating [SnackBar] appears above [Scaffold.floatingActionButton]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.1.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger_state.show_snack_bar.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// If [AnimationStyle.duration] is provided in the [snackBarAnimationStyle] /// parameter, it will be used to override the snackbar show animation duration. @@ -304,12 +322,15 @@ class ScaffoldMessengerState extends State with TickerProvide /// /// To disable the snackbar animation, use [AnimationStyle.noAnimation]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override [SnackBar] show and hide animation /// duration using [AnimationStyle] in [ScaffoldMessengerState.showSnackBar]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_snack_bar.2.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger_state.show_snack_bar.2.dart} + /// + // TODO(framework): End of the @dartpad directive. /// ScaffoldFeatureController showSnackBar( SnackBar snackBar, { @@ -491,11 +512,14 @@ class ScaffoldMessengerState extends State with TickerProvide /// See [ScaffoldMessenger.of] for information about how to obtain the /// [ScaffoldMessengerState]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Here is an example of showing a [MaterialBanner] when the user presses a button. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_messenger_state.show_material_banner.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_messenger_state.show_material_banner.0.dart} + /// + // TODO(framework): End of the @dartpad directive. ScaffoldFeatureController showMaterialBanner( MaterialBanner materialBanner, ) { @@ -1551,16 +1575,21 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// [ScaffoldState] for the current [BuildContext] via [Scaffold.of] and use the /// [ScaffoldState.showBottomSheet] function. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a [Scaffold] with a [body] and [FloatingActionButton]. /// The [body] is a [Text] placed in a [Center] in order to center the text /// within the [Scaffold]. The [FloatingActionButton] is connected to a /// callback that increments a counter. /// -/// ** See code in examples/api/lib/material/scaffold/scaffold.0.dart ** -/// {@end-tool} +/// {@example /example/lib/scaffold/scaffold.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a [Scaffold] with a blueGrey [backgroundColor], [body] /// and [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in /// order to center the text within the [Scaffold]. The [FloatingActionButton] @@ -1568,10 +1597,13 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_background_color.png) /// -/// ** See code in examples/api/lib/material/scaffold/scaffold.1.dart ** -/// {@end-tool} +/// {@example /example/lib/scaffold/scaffold.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a [Scaffold] with an [AppBar], a [BottomAppBar] and a /// [FloatingActionButton]. The [body] is a [Text] placed in a [Center] in order /// to center the text within the [Scaffold]. The [FloatingActionButton] is @@ -1581,8 +1613,9 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// /// ![](https://flutter.github.io/assets-for-api-docs/assets/material/scaffold_bottom_app_bar.png) /// -/// ** See code in examples/api/lib/material/scaffold/scaffold.2.dart ** -/// {@end-tool} +/// {@example /example/lib/scaffold/scaffold.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Scaffold layout, the keyboard, and display "notches" /// @@ -1633,7 +1666,11 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// better to add a listener to the [TabController] that updates the /// AppBar /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// Add a listener to the app's tab controller so that the [AppBar] title of the /// app's one and only scaffold is reset each time a new tab is selected. /// @@ -1647,7 +1684,8 @@ class _FloatingActionButtonTransitionState extends State<_FloatingActionButtonTr /// } /// }) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// Although there are some use cases, like a presentation app that /// shows embedded flutter content, where nested scaffolds are @@ -1832,14 +1870,17 @@ class Scaffold extends StatefulWidget { /// To close the drawer, use either [ScaffoldState.closeDrawer], [Navigator.pop] /// or press the escape key on the keyboard. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// To disable the drawer edge swipe on mobile, set the /// [Scaffold.drawerEnableOpenDragGesture] to false. Then, use /// [ScaffoldState.openDrawer] to open the drawer and [Navigator.pop] to close /// it. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold.drawer.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold.drawer.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final Widget? drawer; /// Optional callback that is called when the [Scaffold.drawer] is opened or closed. @@ -1856,14 +1897,17 @@ class Scaffold extends StatefulWidget { /// To close the drawer, use either [ScaffoldState.closeEndDrawer], [Navigator.pop] /// or press the escape key on the keyboard. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// To disable the drawer edge swipe, set the /// [Scaffold.endDrawerEnableOpenDragGesture] to false. Then, use /// [ScaffoldState.openEndDrawer] to open the drawer and [Navigator.pop] to /// close it. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold.end_drawer.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold.end_drawer.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final Widget? endDrawer; /// Optional callback that is called when the [Scaffold.endDrawer] is opened or closed. @@ -2010,14 +2054,19 @@ class Scaffold extends StatefulWidget { /// /// This method can be expensive (it walks the element tree). /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Typical usage of the [Scaffold.of] function is to call it from within the /// `build` method of a child of a [Scaffold]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold.of.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold.of.0.dart} + /// + // TODO(framework): End of the @dartpad directive. + /// + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// - /// {@tool dartpad} /// When the [Scaffold] is actually created in the same `build` function, the /// `context` argument to the `build` function can't be used to find the /// [Scaffold] (since it's "above" the widget being returned in the widget @@ -2025,8 +2074,9 @@ class Scaffold extends StatefulWidget { /// to provide a new scope with a [BuildContext] that is "under" the /// [Scaffold]: /// - /// ** See code in examples/api/lib/material/scaffold/scaffold.of.1.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold.of.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// A more efficient solution is to split your build function into several /// widgets. This introduces a new context from which you can obtain the @@ -2612,13 +2662,16 @@ class ScaffoldState extends State /// of the app. Modal bottom sheets can be created and displayed with the /// [showModalBottomSheet] function. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example demonstrates how to use [showBottomSheet] to display a /// bottom sheet when a user taps a button. It also demonstrates how to /// close a bottom sheet using the Navigator. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.0.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_state.show_bottom_sheet.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// The [sheetAnimationStyle] parameter is used to override the bottom sheet /// animation duration and reverse animation duration. @@ -2633,12 +2686,15 @@ class ScaffoldState extends State /// /// To disable the bottom sheet animation, use [AnimationStyle.noAnimation]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases how to override the [showBottomSheet] animation /// duration and reverse animation duration using [AnimationStyle]. /// - /// ** See code in examples/api/lib/material/scaffold/scaffold_state.show_bottom_sheet.1.dart ** - /// {@end-tool} + /// {@example /example/lib/scaffold/scaffold_state.show_bottom_sheet.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// See also: /// /// * [BottomSheet], which becomes the parent of the widget returned by the diff --git a/packages/material_ui/lib/src/scrollbar.dart b/packages/material_ui/lib/src/scrollbar.dart index 6269d4521ac8..a724efff7280 100644 --- a/packages/material_ui/lib/src/scrollbar.dart +++ b/packages/material_ui/lib/src/scrollbar.dart @@ -33,15 +33,20 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600); /// or [WidgetState.hovered] on desktop and web platforms. These stateful /// color choices can be changed using [ScrollbarThemeData.thumbColor]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows a [Scrollbar] that executes a fade animation as scrolling /// occurs. The Scrollbar will fade into view as the user scrolls, and fade out /// when scrolling stops. /// -/// ** See code in examples/api/lib/material/scrollbar/scrollbar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/scrollbar/scrollbar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// When [thumbVisibility] is true, the scrollbar thumb will remain visible /// without the fade animation. This requires that a [ScrollController] is /// provided to controller, or that the [PrimaryScrollController] is available. @@ -50,8 +55,9 @@ const Duration _kScrollbarTimeToFade = Duration(milliseconds: 600); /// that the [Scrollbar] is always visible, since scrolling in the horizontal /// axis is less discoverable. /// -/// ** See code in examples/api/lib/material/scrollbar/scrollbar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/scrollbar/scrollbar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// A scrollbar track can be added using [trackVisibility]. This can also be /// drawn when triggered by a hover event, or based on any [WidgetState] by diff --git a/packages/material_ui/lib/src/search.dart b/packages/material_ui/lib/src/search.dart index e1de86a28db7..af089d1ec6c2 100644 --- a/packages/material_ui/lib/src/search.dart +++ b/packages/material_ui/lib/src/search.dart @@ -119,7 +119,11 @@ abstract class SearchDelegate { /// [keyboardType] and/or [textInputAction]. Only one of [searchFieldLabel] /// and [searchFieldDecorationTheme] may be non-null. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// ```dart /// class CustomSearchHintDelegate extends SearchDelegate { /// CustomSearchHintDelegate({ @@ -150,7 +154,8 @@ abstract class SearchDelegate { /// List buildActions(BuildContext context) => []; /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. SearchDelegate({ this.searchFieldLabel, this.searchFieldStyle, diff --git a/packages/material_ui/lib/src/search_anchor.dart b/packages/material_ui/lib/src/search_anchor.dart index 3763971e8faa..d7173130305f 100644 --- a/packages/material_ui/lib/src/search_anchor.dart +++ b/packages/material_ui/lib/src/search_anchor.dart @@ -86,32 +86,44 @@ typedef ViewBuilder = Widget Function(Iterable suggestions); /// is in full-screen mode, changing the window size, such as rotating a mobile /// device from portrait mode to landscape mode, will not close the search view. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to use an IconButton to open a search view in a [SearchAnchor]. /// It also shows how to use [SearchController] to open or close the search view route. /// -/// ** See code in examples/api/lib/material/search_anchor/search_anchor.2.dart ** -/// {@end-tool} +/// {@example /example/lib/search_anchor/search_anchor.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to set up a floating (or pinned) AppBar with a /// [SearchAnchor] for a title. /// -/// ** See code in examples/api/lib/material/search_anchor/search_anchor.1.dart ** -/// {@end-tool} +/// {@example /example/lib/search_anchor/search_anchor.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to fetch the search suggestions from a remote API. /// -/// ** See code in examples/api/lib/material/search_anchor/search_anchor.3.dart ** -/// {@end-tool} +/// {@example /example/lib/search_anchor/search_anchor.3.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example demonstrates fetching the search suggestions asynchronously and /// debouncing network calls. /// -/// ** See code in examples/api/lib/material/search_anchor/search_anchor.4.dart ** -/// {@end-tool} +/// {@example /example/lib/search_anchor/search_anchor.4.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -162,12 +174,15 @@ class SearchAnchor extends StatefulWidget { /// All the barX parameters are used to customize the anchor. Similarly, all the /// viewX parameters are used to override the view's defaults. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to use a [SearchAnchor.bar] which uses a default search /// bar to open a search view route. /// - /// ** See code in examples/api/lib/material/search_anchor/search_anchor.0.dart ** - /// {@end-tool} + /// {@example /example/lib/search_anchor/search_anchor.0.dart} + /// + // TODO(framework): End of the @dartpad directive. factory SearchAnchor.bar({ Widget? barLeading, Iterable? barTrailing, @@ -1387,13 +1402,16 @@ class SearchController extends TextEditingController { /// These actions can represent additional modes of searching (like voice search), /// a separate high-level action (such as current location) or an overflow menu. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example demonstrates how to use a [SearchBar] as the return value of the /// [SearchAnchor.builder] property. The [SearchBar] also includes a leading search /// icon and a trailing action to toggle the brightness. /// -/// ** See code in examples/api/lib/material/search_anchor/search_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/search_anchor/search_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/segmented_button.dart b/packages/material_ui/lib/src/segmented_button.dart index f52160deeb68..1ca049304d7b 100644 --- a/packages/material_ui/lib/src/segmented_button.dart +++ b/packages/material_ui/lib/src/segmented_button.dart @@ -93,18 +93,24 @@ class ButtonSegment { /// then the entire segmented button will be disabled, regardless of the /// individual segment settings. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to display a [SegmentedButton] with either a single or /// multiple selection. /// -/// ** See code in examples/api/lib/material/segmented_button/segmented_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/segmented_button/segmented_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample showcases how to customize [SegmentedButton] using [SegmentedButton.styleFrom]. /// -/// ** See code in examples/api/lib/material/segmented_button/segmented_button.1.dart ** -/// {@end-tool} +/// {@example /example/lib/segmented_button/segmented_button.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -244,14 +250,17 @@ class SegmentedButton extends StatefulWidget { /// All parameters default to null. By default this method returns /// a [ButtonStyle] that doesn't override anything. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// For example, to override the default text and icon colors for a /// [SegmentedButton], as well as its overlay color, with all of the /// standard opacity adjustments for the pressed, focused, and /// hovered states, one could write: /// - /// ** See code in examples/api/lib/material/segmented_button/segmented_button.1.dart ** + /// {@example /example/lib/segmented_button/segmented_button.1.dart} /// /// ```dart /// SegmentedButton( @@ -277,7 +286,8 @@ class SegmentedButton extends StatefulWidget { /// onSelectionChanged: (Set selection) {}, /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. static ButtonStyle styleFrom({ Color? foregroundColor, Color? backgroundColor, diff --git a/packages/material_ui/lib/src/selectable_text.dart b/packages/material_ui/lib/src/selectable_text.dart index dc54e090eb14..6d4c3b8a9bc3 100644 --- a/packages/material_ui/lib/src/selectable_text.dart +++ b/packages/material_ui/lib/src/selectable_text.dart @@ -95,7 +95,10 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur /// /// {@macro flutter.material.textfield.wantKeepAlive} /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// const SelectableText( @@ -104,14 +107,18 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur /// style: TextStyle(fontWeight: FontWeight.bold), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// Using the [SelectableText.rich] constructor, the [SelectableText] widget can /// display a paragraph with differently styled [TextSpan]s. The sample /// that follows displays "Hello beautiful world" with different styles /// for each word. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// const SelectableText.rich( @@ -124,7 +131,8 @@ class _SelectableTextSelectionGestureDetectorBuilder extends TextSelectionGestur /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Interactivity /// diff --git a/packages/material_ui/lib/src/selection_area.dart b/packages/material_ui/lib/src/selection_area.dart index 429d7e69ff64..c1fd841e73d1 100644 --- a/packages/material_ui/lib/src/selection_area.dart +++ b/packages/material_ui/lib/src/selection_area.dart @@ -31,11 +31,14 @@ import 'theme.dart'; /// contains a [MaterialLocalizations] delegate; using the [MaterialApp] widget /// ensures that such an ancestor is present. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to make a screen selectable. /// -/// ** See code in examples/api/lib/material/selection_area/selection_area.0.dart ** -/// {@end-tool} +/// {@example /example/lib/selection_area/selection_area.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -79,12 +82,15 @@ class SelectionArea extends StatefulWidget { /// If not provided, will build a default menu based on the ambient /// [ThemeData.platform]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to build a custom context menu for any selected /// content in a SelectionArea. /// - /// ** See code in examples/api/lib/material/context_menu/selectable_region_toolbar_builder.0.dart ** - /// {@end-tool} + /// {@example /example/lib/context_menu/selectable_region_toolbar_builder.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/slider.dart b/packages/material_ui/lib/src/slider.dart index 4b99d858f387..5d77348679f5 100644 --- a/packages/material_ui/lib/src/slider.dart +++ b/packages/material_ui/lib/src/slider.dart @@ -78,20 +78,26 @@ enum SliderInteraction { /// /// {@youtube 560 315 https://www.youtube.com/watch?v=ufb4gIPDmEs} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example showcases non-discrete and discrete [Slider]s. /// The [Slider]s will show the updated ![Material 3 Design appearance](https://m3.material.io/components/sliders/overview) /// when setting the [Slider.year2023] flag to false. /// -/// ** See code in examples/api/lib/material/slider/slider.0.dart ** -/// {@end-tool} +/// {@example /example/lib/slider/slider.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a [Slider] widget using the [Slider.secondaryTrackValue] /// to show a secondary track in the slider. /// -/// ** See code in examples/api/lib/material/slider/slider.1.dart ** -/// {@end-tool} +/// {@example /example/lib/slider/slider.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// A slider can be used to select from either a continuous or a discrete set of /// values. The default is to use a continuous range of values from [min] to @@ -290,7 +296,10 @@ class Slider extends StatefulWidget { /// [StatefulWidget] using the [State.setState] method, so that the parent /// gets rebuilt; for example: /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Slider( @@ -306,7 +315,8 @@ class Slider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -325,7 +335,10 @@ class Slider extends StatefulWidget { /// The value passed will be the last [value] that the slider had before the /// change began. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Slider( @@ -344,7 +357,8 @@ class Slider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -358,7 +372,10 @@ class Slider extends StatefulWidget { /// [onChanged] for that), but rather to know when the user has completed /// selecting a new [value] by ending a drag or a click. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// Slider( @@ -377,7 +394,8 @@ class Slider extends StatefulWidget { /// }, /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -521,7 +539,10 @@ class Slider extends StatefulWidget { /// This is used by accessibility frameworks like TalkBack on Android to /// inform users what the currently selected value is with more context. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// In the example below, a slider for currency values is configured to /// announce a value with a currency label. @@ -542,7 +563,8 @@ class Slider extends StatefulWidget { /// } /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Ignored if this slider is created with [Slider.adaptive] final SemanticFormatterCallback? semanticFormatterCallback; diff --git a/packages/material_ui/lib/src/slider_theme.dart b/packages/material_ui/lib/src/slider_theme.dart index 8275d4cad7ff..539312158b53 100644 --- a/packages/material_ui/lib/src/slider_theme.dart +++ b/packages/material_ui/lib/src/slider_theme.dart @@ -66,7 +66,10 @@ class SliderTheme extends InheritedTheme { /// Defaults to the ambient [ThemeData.sliderTheme] if there is no /// [SliderTheme] in the given build context. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// class Launch extends StatefulWidget { @@ -91,7 +94,8 @@ class SliderTheme extends InheritedTheme { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -250,7 +254,10 @@ class SliderThemeData with Diagnosticable { /// [copyWith] on the one you get from [SliderTheme.of], or create an /// entirely new one with [SliderThemeData.fromPrimaryColors]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// class Blissful extends StatefulWidget { @@ -275,7 +282,8 @@ class SliderThemeData with Diagnosticable { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. const SliderThemeData({ this.trackHeight, this.activeTrackColor, diff --git a/packages/material_ui/lib/src/snack_bar.dart b/packages/material_ui/lib/src/snack_bar.dart index 33bff55f9791..056114083885 100644 --- a/packages/material_ui/lib/src/snack_bar.dart +++ b/packages/material_ui/lib/src/snack_bar.dart @@ -234,27 +234,36 @@ class _SnackBarActionState extends State { /// the floating action button. It also works in the case of a back gesture /// transition. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// Here is an example of a [SnackBar] with an [action] button implemented using /// [SnackBarAction]. /// -/// ** See code in examples/api/lib/material/snack_bar/snack_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/snack_bar/snack_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// Here is an example of a customized [SnackBar]. It utilizes /// [behavior], [shape], [padding], [width], and [duration] to customize the /// location, appearance, and the duration for which the [SnackBar] is visible. /// -/// ** See code in examples/api/lib/material/snack_bar/snack_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/snack_bar/snack_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example demonstrates the various [SnackBar] widget components, /// including an optional icon, in either floating or fixed format. /// -/// ** See code in examples/api/lib/material/snack_bar/snack_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/snack_bar/snack_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/stepper.dart b/packages/material_ui/lib/src/stepper.dart index 73d04ea10469..ab94ee196d3e 100644 --- a/packages/material_ui/lib/src/stepper.dart +++ b/packages/material_ui/lib/src/stepper.dart @@ -190,12 +190,15 @@ class Step { /// to this widget based on some logic triggered by the three callbacks that it /// provides. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// An example the shows how to use the [Stepper], and the [Stepper] UI /// appearance. /// -/// ** See code in examples/api/lib/material/stepper/stepper.0.dart ** -/// {@end-tool} +/// {@example /example/lib/stepper/stepper.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -299,7 +302,9 @@ class Stepper extends StatefulWidget { /// [ControlsDetails.currentStep] value within the callback can change the text /// of the continue or cancel button depending on which step users are at. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// Creates a stepper control with custom buttons. /// /// ```dart @@ -339,8 +344,9 @@ class Stepper extends StatefulWidget { /// ); /// } /// ``` - /// ** See code in examples/api/lib/material/stepper/stepper.controls_builder.0.dart ** - /// {@end-tool} + /// {@example /example/lib/stepper/stepper.controls_builder.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final ControlsWidgetBuilder? controlsBuilder; /// The elevation of this stepper's [Material] when [type] is [StepperType.horizontal]. @@ -1041,11 +1047,14 @@ class _TrianglePainter extends CustomPainter { /// ) /// ``` /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// An example that uses [StepStyle] to customize the appearance of each [Step] in a [Stepper]. /// -/// ** See code in examples/api/lib/material/stepper/step_style.0.dart ** -/// {@end-tool} +/// {@example /example/lib/stepper/step_style.0.dart} +/// +// TODO(framework): End of the @dartpad directive. @immutable class StepStyle with Diagnosticable { diff --git a/packages/material_ui/lib/src/switch.dart b/packages/material_ui/lib/src/switch.dart index d80a58b45f56..60c37e766624 100644 --- a/packages/material_ui/lib/src/switch.dart +++ b/packages/material_ui/lib/src/switch.dart @@ -53,33 +53,45 @@ enum _SwitchType { material, adaptive } /// If [ThemeData.useMaterial3] is set to true, users can use [Switch.thumbIcon] /// to add optional Icons based on the different [WidgetState]s of the [Switch]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows a toggleable [Switch]. When the thumb slides to the other /// side of the track, the switch is toggled between on/off. /// -/// ** See code in examples/api/lib/material/switch/switch.0.dart ** -/// {@end-tool} +/// {@example /example/lib/switch/switch.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to customize [Switch] using [WidgetStateProperty] /// switch properties. /// -/// ** See code in examples/api/lib/material/switch/switch.1.dart ** -/// {@end-tool} +/// {@example /example/lib/switch/switch.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to add icons on the thumb of the [Switch] using the /// [Switch.thumbIcon] property. /// -/// ** See code in examples/api/lib/material/switch/switch.2.dart ** -/// {@end-tool} +/// {@example /example/lib/switch/switch.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to use the ambient [CupertinoThemeData] to style all /// widgets which would otherwise use iOS defaults. /// -/// ** See code in examples/api/lib/material/switch/switch.3.dart ** -/// {@end-tool} +/// {@example /example/lib/switch/switch.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -154,12 +166,15 @@ class Switch extends StatelessWidget { /// where you don't want the overall [ThemeData.switchTheme] to apply when /// this adaptive constructor is used. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to create and use subclasses of [Adaptation] that /// define adaptive [SwitchThemeData]s. /// - /// ** See code in examples/api/lib/material/switch/switch.4.dart ** - /// {@end-tool} + /// {@example /example/lib/switch/switch.4.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// The target platform is based on the current [Theme]: [ThemeData.platform]. const Switch.adaptive({ @@ -312,7 +327,11 @@ class Switch extends StatelessWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [thumbColor] based on the current /// [WidgetState] of the [Switch], providing a different [Color] when it is /// [WidgetState.disabled]. @@ -329,7 +348,8 @@ class Switch extends StatelessWidget { /// }), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// If null, then the value of [activeThumbColor] is used in the selected @@ -353,7 +373,11 @@ class Switch extends StatelessWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [trackColor] based on the current /// [WidgetState] of the [Switch], providing a different [Color] when it is /// [WidgetState.disabled]. @@ -370,7 +394,8 @@ class Switch extends StatelessWidget { /// }), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// If null, then the value of [activeTrackColor] is used in the selected @@ -394,7 +419,11 @@ class Switch extends StatelessWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [trackOutlineColor] based on the current /// [WidgetState] of the [Switch], providing a different [Color] when it is /// [WidgetState.disabled]. @@ -411,7 +440,8 @@ class Switch extends StatelessWidget { /// }), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// In Material 3, the outline color defaults to transparent in the selected @@ -428,7 +458,11 @@ class Switch extends StatelessWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [trackOutlineWidth] based on the current /// [WidgetState] of the [Switch], providing a different outline width when it is /// [WidgetState.disabled]. @@ -445,7 +479,8 @@ class Switch extends StatelessWidget { /// }), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// Defaults to 2.0. @@ -460,7 +495,11 @@ class Switch extends StatelessWidget { /// * [WidgetState.focused]. /// * [WidgetState.disabled]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example resolves the [thumbIcon] based on the current /// [WidgetState] of the [Switch], providing a different [Icon] when it is /// [WidgetState.disabled]. @@ -477,7 +516,8 @@ class Switch extends StatelessWidget { /// }), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// {@endtemplate} /// /// If null, then the value of [SwitchThemeData.thumbIcon] is used. If this is also null, diff --git a/packages/material_ui/lib/src/switch_list_tile.dart b/packages/material_ui/lib/src/switch_list_tile.dart index b497f9ab4f90..a061c1f4ca67 100644 --- a/packages/material_ui/lib/src/switch_list_tile.dart +++ b/packages/material_ui/lib/src/switch_list_tile.dart @@ -66,7 +66,11 @@ enum _SwitchListTileType { material, adaptive } /// [SwitchListTile] itself but by the [Material] widget ancestor. In this /// case, one can wrap a [Material] widget around the [SwitchListTile], e.g.: /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// /// ```dart /// ColoredBox( /// color: Colors.green, @@ -80,7 +84,8 @@ enum _SwitchListTileType { material, adaptive } /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// ## Performance considerations when wrapping [SwitchListTile] with [Material] /// @@ -91,21 +96,27 @@ enum _SwitchListTileType { material, adaptive } /// To show the [SwitchListTile] as disabled, pass null as the [onChanged] /// callback. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![SwitchListTile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile.png) /// /// This widget shows a switch that, when toggled, changes the state of a [bool] /// member field called `_lights`. /// -/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.0.dart ** -/// {@end-tool} +/// {@example /example/lib/switch_list_tile/switch_list_tile.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample demonstrates how [SwitchListTile] positions the switch widget /// relative to the text in different configurations. /// -/// ** See code in examples/api/lib/material/switch_list_tile/switch_list_tile.1.dart ** -/// {@end-tool} +/// {@example /example/lib/switch_list_tile/switch_list_tile.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Semantics in SwitchListTile /// @@ -124,15 +135,18 @@ enum _SwitchListTileType { material, adaptive } /// into one. Therefore, it may be necessary to create a custom radio tile /// widget to accommodate similar use cases. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Switch list tile semantics sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_semantics.png) /// /// Here is an example of a custom labeled radio widget, called /// LinkedLabelRadio, that includes an interactive [RichText] widget that /// handles tap gestures. /// -/// ** See code in examples/api/lib/material/switch_list_tile/custom_labeled_switch.0.dart ** -/// {@end-tool} +/// {@example /example/lib/switch_list_tile/custom_labeled_switch.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## SwitchListTile isn't exactly what I want /// @@ -141,14 +155,17 @@ enum _SwitchListTileType { material, adaptive } /// combining [Switch] with other widgets, such as [Text], [Padding] and /// [InkWell]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// ![Custom switch list tile sample](https://flutter.github.io/assets-for-api-docs/assets/material/switch_list_tile_custom.png) /// /// Here is an example of a custom LabeledSwitch widget, but you can easily /// make your own configurable widget. /// -/// ** See code in examples/api/lib/material/switch_list_tile/custom_labeled_switch.1.dart ** -/// {@end-tool} +/// {@example /example/lib/switch_list_tile/custom_labeled_switch.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -307,7 +324,11 @@ class SwitchListTile extends StatelessWidget { /// [StatefulWidget] using the [State.setState] method, so that the parent /// gets rebuilt; for example: /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// ```dart /// SwitchListTile( /// value: _isSelected, @@ -319,7 +340,8 @@ class SwitchListTile extends StatelessWidget { /// title: const Text('Selection'), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final ValueChanged? onChanged; /// {@macro flutter.material.switch.activeColor} diff --git a/packages/material_ui/lib/src/tab_controller.dart b/packages/material_ui/lib/src/tab_controller.dart index 7af5a8c13938..d9d39d2cdb6b 100644 --- a/packages/material_ui/lib/src/tab_controller.dart +++ b/packages/material_ui/lib/src/tab_controller.dart @@ -32,7 +32,10 @@ import 'constants.dart'; /// /// {@animation 700 540 https://flutter.github.io/assets-for-api-docs/assets/material/tabs.mp4} /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// This widget introduces a [Scaffold] with an [AppBar] and a [TabBar]. /// @@ -88,14 +91,18 @@ import 'constants.dart'; /// } /// } /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to listen to page updates in [TabBar] and [TabBarView] /// when using [DefaultTabController]. /// -/// ** See code in examples/api/lib/material/tab_controller/tab_controller.1.dart ** -/// {@end-tool} +/// {@example /example/lib/tab_controller/tab_controller.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// class TabController extends ChangeNotifier { /// Creates an object that manages the state required by [TabBar] and a @@ -393,12 +400,17 @@ class DefaultTabController extends StatefulWidget { /// The closest instance of [DefaultTabController] that encloses the given /// context, or null if none is found. /// - /// {@tool snippet} Typical usage is as follows: + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// Typical usage is as follows: /// /// ```dart /// TabController? controller = DefaultTabController.maybeOf(context); /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// Calling this method will create a dependency on the closest /// [DefaultTabController] in the [context], if there is one. @@ -420,12 +432,17 @@ class DefaultTabController extends StatefulWidget { /// Calling this method will create a dependency on the closest /// [DefaultTabController] in the [context]. /// - /// {@tool snippet} Typical usage is as follows: + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// Typical usage is as follows: /// /// ```dart /// TabController controller = DefaultTabController.of(context); /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/tabs.dart b/packages/material_ui/lib/src/tabs.dart index 222db2bdcb63..de3acbc6dc34 100644 --- a/packages/material_ui/lib/src/tabs.dart +++ b/packages/material_ui/lib/src/tabs.dart @@ -159,7 +159,10 @@ class Tab extends StatelessWidget implements PreferredSizeWidget { /// null along with `child` or `text`, the default height is 72.0 pixels. Without an `icon`, the /// height is 46.0 pixels. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// The provided tab height cannot be lower than the default height. Use /// [PreferredSize] widget to adjust the overall [TabBar] height and match @@ -182,7 +185,8 @@ class Tab extends StatelessWidget implements PreferredSizeWidget { /// ), /// ), /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. final double? height; Widget _buildLabelText() { @@ -946,38 +950,50 @@ typedef TabValueChanged = void Function(T value, int index); /// /// Uses values from [TabBarThemeData] if it is set in the current context. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows the implementation of [TabBar] and [TabBarView] using a [DefaultTabController]. /// Each [Tab] corresponds to a child of the [TabBarView] in the order they are written. /// -/// ** See code in examples/api/lib/material/tabs/tab_bar.0.dart ** -/// {@end-tool} +/// {@example /example/lib/tabs/tab_bar.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// [TabBar] can also be implemented by using a [TabController] which provides more options /// to control the behavior of the [TabBar] and [TabBarView]. This can be used instead of /// a [DefaultTabController], demonstrated below. /// -/// ** See code in examples/api/lib/material/tabs/tab_bar.1.dart ** -/// {@end-tool} +/// {@example /example/lib/tabs/tab_bar.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample showcases nested Material 3 [TabBar]s. It consists of a primary /// [TabBar] with nested a secondary [TabBar]. The primary [TabBar] uses a /// [DefaultTabController] while the secondary [TabBar] uses a [TabController]. /// -/// ** See code in examples/api/lib/material/tabs/tab_bar.2.dart ** -/// {@end-tool} +/// {@example /example/lib/tabs/tab_bar.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample showcases how to apply custom behavior based on the scroll in [TabBar]. /// It utilizes scroll notifications ([ScrollMetricsNotification] /// and [ScrollNotification]) within [NotificationListener] callback /// to monitor the scroll offset, allowing for interface customization /// based on the obtained offset. /// -/// ** See code in examples/api/lib/material/tabs/tab_bar.3.dart ** -/// {@end-tool} +/// {@example /example/lib/tabs/tab_bar.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1046,13 +1062,16 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// Secondary tabs are used within a content area to further separate related /// content and establish hierarchy. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample showcases nested Material 3 [TabBar]s. It consists of a primary /// [TabBar] with nested a secondary [TabBar]. The primary [TabBar] uses a /// [DefaultTabController] while the secondary [TabBar] uses a [TabController]. /// - /// ** See code in examples/api/lib/material/tabs/tab_bar.2.dart ** - /// {@end-tool} + /// {@example /example/lib/tabs/tab_bar.2.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -1373,12 +1392,15 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// twice. First to represent hover exiting the initial tab, and then second /// for the pointer entering hover over the next tab. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to customize a [Tab] in response to hovering over a /// [TabBar]. /// - /// ** See code in examples/api/lib/material/tabs/tab_bar.onHover.dart ** - /// {@end-tool} + /// {@example /example/lib/tabs/tab_bar.onHover.dart} + /// + // TODO(framework): End of the @dartpad directive. final TabValueChanged? onHover; /// An optional callback that's called when a [Tab]'s focus state in the @@ -1393,12 +1415,15 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// twice. First to represent focus being lost by the initially focused tab, /// and then second for the next tab gaining focus. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to customize a [Tab] based on focus traversal in /// enclosing [TabBar]. /// - /// ** See code in examples/api/lib/material/tabs/tab_bar.onFocusChange.dart ** - /// {@end-tool} + /// {@example /example/lib/tabs/tab_bar.onFocusChange.dart} + /// + // TODO(framework): End of the @dartpad directive. final TabValueChanged? onFocusChange; /// How the [TabBar]'s scroll view should respond to user input. @@ -1486,12 +1511,15 @@ class TabBar extends StatefulWidget implements PreferredSizeWidget { /// [indicatorSize] is [TabBarIndicatorSize.tab], otherwise it will animate /// with an elastic effect if the [indicatorSize] is [TabBarIndicatorSize.label]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to customize the animation behavior of the tab indicator /// by using the [indicatorAnimation] property. /// - /// ** See code in examples/api/lib/material/tabs/tab_bar.indicator_animation.0.dart ** - /// {@end-tool} + /// {@example /example/lib/tabs/tab_bar.indicator_animation.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/text_button.dart b/packages/material_ui/lib/src/text_button.dart index f2868f3398c2..13438a07b590 100644 --- a/packages/material_ui/lib/src/text_button.dart +++ b/packages/material_ui/lib/src/text_button.dart @@ -55,20 +55,26 @@ import 'theme_data.dart'; /// If the [onPressed] and [onLongPress] callbacks are null, then this /// button will be disabled, it will not react to touch. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows various ways to configure TextButtons, from the /// simplest default appearance to versions that don't resemble /// Material Design at all. /// -/// ** See code in examples/api/lib/material/text_button/text_button.0.dart ** -/// {@end-tool} +/// {@example /example/lib/text_button/text_button.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This sample demonstrates using the [statesController] parameter to create a button /// that adds support for [WidgetState.selected]. /// -/// ** See code in examples/api/lib/material/text_button/text_button.1.dart ** -/// {@end-tool} +/// {@example /example/lib/text_button/text_button.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/text_field.dart b/packages/material_ui/lib/src/text_field.dart index 2a6ad746d801..f2af4fc6c2c8 100644 --- a/packages/material_ui/lib/src/text_field.dart +++ b/packages/material_ui/lib/src/text_field.dart @@ -117,13 +117,16 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete /// /// ## Obscured Input /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to create a [TextField] that will obscure input. The /// [InputDecoration] surrounds the field in a border using [OutlineInputBorder] /// and adds a label. /// -/// ** See code in examples/api/lib/material/text_field/text_field.0.dart ** -/// {@end-tool} +/// {@example /example/lib/text_field/text_field.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Reading values /// @@ -131,12 +134,15 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete /// callback. This callback is applied to the text field's current value when /// the user finishes editing. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to get a value from a TextField via the [onSubmitted] /// callback. /// -/// ** See code in examples/api/lib/material/text_field/text_field.1.dart ** -/// {@end-tool} +/// {@example /example/lib/text_field/text_field.1.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// {@macro flutter.widgets.EditableText.lifeCycle} /// @@ -164,12 +170,15 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete /// /// {@macro flutter.widgets.editableText.accessibility} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to style a text field to match a filled or outlined /// Material Design 3 text field. /// -/// ** See code in examples/api/lib/material/text_field/text_field.2.dart ** -/// {@end-tool} +/// {@example /example/lib/text_field/text_field.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Scrolling Considerations /// @@ -179,13 +188,16 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete /// [TextField] to ensure proper scroll coordination for [TextField] and its /// components like [TextSelectionOverlay]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample demonstrates how to use the [Shortcuts] and [Actions] widgets /// to create a custom `Shift+Enter` keyboard shortcut for inserting a new line /// in a [TextField]. /// -/// ** See code in examples/api/lib/material/text_field/text_field.3.dart ** -/// {@end-tool} +/// {@example /example/lib/text_field/text_field.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -364,11 +376,14 @@ class TextField extends StatefulWidget { /// /// {@macro flutter.widgets.magnifier.intro} /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample demonstrates how to customize the magnifier that this text field uses. /// - /// ** See code in examples/api/lib/widgets/text_magnifier/text_magnifier.0.dart ** - /// {@end-tool} + /// {@example /example/lib/text_field/text_field_magnifier.0.dart} + /// + // TODO(framework): End of the @dartpad directive. final TextMagnifierConfiguration? magnifierConfiguration; /// {@macro flutter.widgets.editableText.groupId} @@ -742,7 +757,9 @@ class TextField extends StatefulWidget { /// {@macro flutter.widgets.editableText.onTapOutside} /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This example shows how to use a `TextFieldTapRegion` to wrap a set of /// "spinner" buttons that increment and decrement a value in the [TextField] /// without causing the text field to lose keyboard focus. @@ -750,8 +767,9 @@ class TextField extends StatefulWidget { /// This example includes a generic `SpinnerField` class that you can copy /// into your own project and customize. /// - /// ** See code in examples/api/lib/widgets/tap_region/text_field_tap_region.0.dart ** - /// {@end-tool} + /// {@example /example/lib/text_field/text_field_tap_region.0.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// @@ -790,7 +808,11 @@ class TextField extends StatefulWidget { /// accessibility, but it also needs to be accessible itself. For example, /// if returning a Text widget, set the [Text.semanticsLabel] property. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// ```dart /// Widget counter( /// BuildContext context, @@ -806,7 +828,8 @@ class TextField extends StatefulWidget { /// ); /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// If buildCounter returns null, then no counter and no Semantics widget will /// be created at all. diff --git a/packages/material_ui/lib/src/text_form_field.dart b/packages/material_ui/lib/src/text_form_field.dart index 260296b36faf..d835c830e64c 100644 --- a/packages/material_ui/lib/src/text_form_field.dart +++ b/packages/material_ui/lib/src/text_form_field.dart @@ -47,7 +47,10 @@ export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType; /// /// For a documentation about the various parameters, see [TextField]. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Creates a [TextFormField] with an [InputDecoration] and validator function. /// @@ -71,21 +74,28 @@ export 'package:flutter/services.dart' show SmartDashesType, SmartQuotesType; /// }, /// ) /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example shows how to move the focus to the next field when the user /// presses the SPACE key. /// -/// ** See code in examples/api/lib/material/text_form_field/text_form_field.1.dart ** -/// {@end-tool} +/// {@example /example/lib/text_form_field/text_form_field.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how to force an error text to the field after making /// an asynchronous call. /// -/// ** See code in examples/api/lib/material/text_form_field/text_form_field.2.dart ** -/// {@end-tool} +/// {@example /example/lib/text_form_field/text_form_field.2.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/text_selection_theme.dart b/packages/material_ui/lib/src/text_selection_theme.dart index 0bb21f1e7bc4..c9801d98024a 100644 --- a/packages/material_ui/lib/src/text_selection_theme.dart +++ b/packages/material_ui/lib/src/text_selection_theme.dart @@ -124,7 +124,10 @@ class TextSelectionThemeData with Diagnosticable { /// Values specified here are used for [TextField] and [SelectableText] /// properties that are not given an explicit non-null value. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Here is an example of a text selection theme that applies a blue cursor /// color with light blue selection handles to the child text field. @@ -138,7 +141,8 @@ class TextSelectionThemeData with Diagnosticable { /// child: TextField(), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// This widget also creates a [DefaultSelectionStyle] for its subtree with /// [data]. diff --git a/packages/material_ui/lib/src/text_theme.dart b/packages/material_ui/lib/src/text_theme.dart index 7dbbc3fdfae8..64bab53769a1 100644 --- a/packages/material_ui/lib/src/text_theme.dart +++ b/packages/material_ui/lib/src/text_theme.dart @@ -237,7 +237,10 @@ class TextTheme with Diagnosticable { /// the typography styles in the Material Design specification, as a starting /// point. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// /// A Widget that sets the ambient theme's title text color for its @@ -264,7 +267,8 @@ class TextTheme with Diagnosticable { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// @@ -325,7 +329,10 @@ class TextTheme with Diagnosticable { /// [TextTheme] has only some fields defined, and you want to define the rest /// by merging it with a default theme. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// /// A Widget that sets the ambient theme's title text color for its @@ -350,7 +357,8 @@ class TextTheme with Diagnosticable { /// } /// } /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/theme_data.dart b/packages/material_ui/lib/src/theme_data.dart index b4c7e1e0b145..b2326966eeca 100644 --- a/packages/material_ui/lib/src/theme_data.dart +++ b/packages/material_ui/lib/src/theme_data.dart @@ -102,14 +102,17 @@ class Adaptation { /// uses an empty [SwitchThemeData] if a matching adaptation is not found, for /// the sake of backwards compatibility. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to create and use subclasses of [Adaptation] that /// define adaptive [SwitchThemeData]s. The [adapt] method in this example is /// overridden to only customize cupertino-style switches, but it can also be /// used to customize any other platforms. /// - /// ** See code in examples/api/lib/material/switch/switch.4.dart ** - /// {@end-tool} + /// {@example /example/lib/switch/switch.4.dart} + /// + // TODO(framework): End of the @dartpad directive. T adapt(ThemeData theme, T defaultValue) => defaultValue; } @@ -122,12 +125,15 @@ class Adaptation { /// [lerp] methods. The latter will ensure smooth transitions of properties when /// switching themes. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to create and use a subclass of [ThemeExtension] that /// defines two colors. /// -/// ** See code in examples/api/lib/material/theme/theme_extension.1.dart ** -/// {@end-tool} +/// {@example /example/lib/theme/theme_extension.1.dart} +/// +// TODO(framework): End of the @dartpad directive. abstract class ThemeExtension> { /// Enable const constructor for subclasses. const ThemeExtension(); @@ -202,7 +208,9 @@ enum MaterialTapTargetSize { /// for the subtree that appears below the new [Theme], or insert a widget /// that creates a new BuildContext, like [Builder]. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example demonstrates how a typical [MaterialApp] specifies /// and uses a custom [Theme]. The theme's [ColorScheme] is based on a /// single "seed" color and configures itself to match the platform's @@ -210,8 +218,9 @@ enum MaterialTapTargetSize { /// default configuration of [FloatingActionButton] to show how to /// customize the appearance a class of components. /// -/// ** See code in examples/api/lib/material/theme_data/theme_data.0.dart ** -/// {@end-tool} +/// {@example /example/lib/theme_data/theme_data.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See for /// more discussion on how to pick the right colors. @@ -823,7 +832,11 @@ class ThemeData with Diagnosticable { /// forward we will be converting all the widget implementations to only use /// colors or colors derived from those in [ColorScheme]. /// - /// {@tool snippet} + // TODO(framework): Replace the following block with a blue example container + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 + // TODO(framework): Add unit tests to this code snippet. + // https://github.com/flutter/flutter/issues/188530 + /// /// This example will set up an application to use the baseline Material /// Design light and dark themes. /// @@ -833,7 +846,8 @@ class ThemeData with Diagnosticable { /// darkTheme: ThemeData.from(colorScheme: const ColorScheme.dark()), /// ) /// ``` - /// {@end-tool} + /// + // TODO(framework): End of the blue example container. /// /// See for /// more discussion on how to pick the right colors. @@ -973,12 +987,15 @@ class ThemeData with Diagnosticable { /// /// To obtain an extension, use [extension]. /// - /// {@tool dartpad} + // TODO(framework): Replace the following block with a @dartpad directive + // when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 + /// /// This sample shows how to create and use a subclass of [ThemeExtension] that /// defines two colors. /// - /// ** See code in examples/api/lib/material/theme/theme_extension.1.dart ** - /// {@end-tool} + /// {@example /example/lib/theme/theme_extension.1.dart} + /// + // TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/time.dart b/packages/material_ui/lib/src/time.dart index b44f5ac6ef19..2f99a7f4d77f 100644 --- a/packages/material_ui/lib/src/time.dart +++ b/packages/material_ui/lib/src/time.dart @@ -30,14 +30,18 @@ enum DayPeriod { /// minute or using [DateTime] object. /// Hours are specified between 0 and 23, as in a 24-hour clock. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// ```dart /// TimeOfDay now = TimeOfDay.now(); /// const TimeOfDay releaseTime = TimeOfDay(hour: 15, minute: 0); // 3:00pm /// TimeOfDay roomBooked = TimeOfDay.fromDateTime(DateTime.parse('2018-10-20 16:30:04Z')); // 4:30pm /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: /// diff --git a/packages/material_ui/lib/src/time_picker.dart b/packages/material_ui/lib/src/time_picker.dart index f87c34b9c543..783e012a2bc9 100644 --- a/packages/material_ui/lib/src/time_picker.dart +++ b/packages/material_ui/lib/src/time_picker.dart @@ -3142,7 +3142,11 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { /// The returned Future resolves to the time selected by the user when the user /// closes the dialog. If the user cancels the dialog, null is returned. /// -/// {@tool snippet} Show a dialog with [initialTime] equal to the current time. +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// Show a dialog with [initialTime] equal to the current time. /// /// ```dart /// Future selectedTime = showTimePicker( @@ -3150,7 +3154,8 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { /// context: context, /// ); /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// The [context], [barrierDismissible], [barrierColor], [barrierLabel], /// [useRootNavigator] and [routeSettings] arguments are passed to [showDialog], @@ -3196,7 +3201,11 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { /// [ColorScheme]. The time picker can be further customized by providing a /// [TimePickerThemeData] to the overall theme. /// -/// {@tool snippet} Show a dialog with the text direction overridden to be +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// Show a dialog with the text direction overridden to be /// [TextDirection.rtl]. /// /// ```dart @@ -3211,9 +3220,14 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { /// }, /// ); /// ``` -/// {@end-tool} /// -/// {@tool snippet} Show a dialog with time unconditionally displayed in 24 hour +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 +/// Show a dialog with time unconditionally displayed in 24 hour /// format. /// /// ```dart @@ -3228,14 +3242,18 @@ class _TimePickerState extends State<_TimePicker> with RestorationMixin { /// }, /// ); /// ``` -/// {@end-tool} /// -/// {@tool dartpad} +// TODO(framework): End of the blue example container. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example illustrates how to open a time picker, and allows exploring /// some of the variations in the types of time pickers that may be shown. /// -/// ** See code in examples/api/lib/material/time_picker/show_time_picker.0.dart ** -/// {@end-tool} +/// {@example /example/lib/time_picker/show_time_picker.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/toggle_buttons.dart b/packages/material_ui/lib/src/toggle_buttons.dart index 07d99d7aeebc..c020ec7f7610 100644 --- a/packages/material_ui/lib/src/toggle_buttons.dart +++ b/packages/material_ui/lib/src/toggle_buttons.dart @@ -57,18 +57,24 @@ import 'toggle_buttons_theme.dart'; /// The [SegmentedButton.style] is a [ButtonStyle] style field, which can be /// used to customize the entire segmented button and the individual segments. /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This sample shows how to migrate [ToggleButtons] that allows multiple /// or no selection to [SegmentedButton] that allows multiple or no selection. /// -/// ** See code in examples/api/lib/material/toggle_buttons/toggle_buttons.1.dart ** -/// {@end-tool} +/// {@example /example/lib/toggle_buttons/toggle_buttons.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example showcase [ToggleButtons] in various configurations. /// -/// ** See code in examples/api/lib/material/toggle_buttons/toggle_buttons.0.dart ** -/// {@end-tool} +/// {@example /example/lib/toggle_buttons/toggle_buttons.0.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// ## Customizing toggle buttons /// Each toggle's behavior can be configured by the [onPressed] callback, which diff --git a/packages/material_ui/lib/src/tooltip.dart b/packages/material_ui/lib/src/tooltip.dart index 43b48fc23b1f..afbb80d7cb44 100644 --- a/packages/material_ui/lib/src/tooltip.dart +++ b/packages/material_ui/lib/src/tooltip.dart @@ -37,7 +37,9 @@ import 'tooltip_visibility.dart'; /// /// {@youtube 560 315 https://www.youtube.com/watch?v=EeEfD5fI-5Q} /// -/// {@tool dartpad} +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 +/// /// This example show a basic [Tooltip] which has a [Text] as child. /// [message] contains your label to be shown by the tooltip when /// the child that Tooltip wraps is hovered over on web or desktop. On mobile, @@ -54,10 +56,13 @@ import 'tooltip_visibility.dart'; /// /// or it can be set directly on each tooltip with [Tooltip.preferBelow]. /// -/// ** See code in examples/api/lib/material/tooltip/tooltip.0.dart ** -/// {@end-tool} +/// {@example /example/lib/tooltip/tooltip.0.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example covers most of the attributes available in Tooltip. /// `decoration` has been used to give a gradient and borderRadius to Tooltip. /// `constraints` has been used to set the minimum width of the Tooltip. @@ -70,24 +75,31 @@ import 'tooltip_visibility.dart'; /// `waitDuration` accepts a Duration for which a mouse pointer has to hover over the child /// widget before the tooltip is shown. /// -/// ** See code in examples/api/lib/material/tooltip/tooltip.1.dart ** -/// {@end-tool} +/// {@example /example/lib/tooltip/tooltip.1.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows a rich [Tooltip] that specifies the [richMessage] /// parameter instead of the [message] parameter (only one of these may be /// non-null. Any [InlineSpan] can be specified for the [richMessage] attribute, /// including [WidgetSpan]. /// -/// ** See code in examples/api/lib/material/tooltip/tooltip.2.dart ** -/// {@end-tool} +/// {@example /example/lib/tooltip/tooltip.2.dart} +/// +// TODO(framework): End of the @dartpad directive. +/// +// TODO(framework): Replace the following block with a @dartpad directive +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4123 /// -/// {@tool dartpad} /// This example shows how [Tooltip] can be shown manually with [TooltipTriggerMode.manual] /// by calling the [TooltipState.ensureTooltipVisible] function. /// -/// ** See code in examples/api/lib/material/tooltip/tooltip.3.dart ** -/// {@end-tool} +/// {@example /example/lib/tooltip/tooltip.3.dart} +/// +// TODO(framework): End of the @dartpad directive. /// /// See also: /// diff --git a/packages/material_ui/lib/src/tooltip_theme.dart b/packages/material_ui/lib/src/tooltip_theme.dart index aaf3e1053058..f2bba12ffda5 100644 --- a/packages/material_ui/lib/src/tooltip_theme.dart +++ b/packages/material_ui/lib/src/tooltip_theme.dart @@ -297,7 +297,10 @@ class TooltipThemeData with Diagnosticable { /// Descendant widgets obtain the ambient tooltip theme, a [TooltipThemeData], /// using [TooltipTheme.of]. /// -/// {@tool snippet} +// TODO(framework): Replace the following block with a blue example container +// when it's supported. https://github.com/dart-lang/dartdoc/issues/4243 +// TODO(framework): Add unit tests to this code snippet. +// https://github.com/flutter/flutter/issues/188530 /// /// Here is an example of a tooltip theme that applies a blue foreground /// with non-rounded corners. @@ -320,7 +323,8 @@ class TooltipThemeData with Diagnosticable { /// ), /// ) /// ``` -/// {@end-tool} +/// +// TODO(framework): End of the blue example container. /// /// See also: ///