From 691d05da98512dbc236a1d3827922c5df8012a9d Mon Sep 17 00:00:00 2001 From: Shi-Hao Hong Date: Thu, 24 Dec 2020 09:34:05 +0800 Subject: [PATCH] [NNBD] Migrate sample code pt 3 (#72837) --- .../lib/src/material/bottom_navigation_bar.dart | 2 +- .../flutter/lib/src/material/bottom_sheet.dart | 2 +- .../flutter/lib/src/material/expansion_panel.dart | 14 +++++++------- .../lib/src/material/flexible_space_bar.dart | 4 ++-- .../material/floating_action_button_location.dart | 2 +- packages/flutter/lib/src/material/icon_button.dart | 4 ++-- .../flutter/lib/src/material/outline_button.dart | 2 +- .../lib/src/material/progress_indicator.dart | 8 ++++---- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/flutter/lib/src/material/bottom_navigation_bar.dart b/packages/flutter/lib/src/material/bottom_navigation_bar.dart index 3e6718e501..13f867f402 100644 --- a/packages/flutter/lib/src/material/bottom_navigation_bar.dart +++ b/packages/flutter/lib/src/material/bottom_navigation_bar.dart @@ -66,7 +66,7 @@ enum BottomNavigationBarType { /// case it's assumed that each item will have a different background color /// and that background color will contrast well with white. /// -/// {@tool dartpad --template=stateful_widget_material_no_null_safety} +/// {@tool dartpad --template=stateful_widget_material} /// This example shows a [BottomNavigationBar] as it is used within a [Scaffold] /// widget. The [BottomNavigationBar] has three [BottomNavigationBarItem] /// widgets and the [currentIndex] is set to index 0. The selected item is diff --git a/packages/flutter/lib/src/material/bottom_sheet.dart b/packages/flutter/lib/src/material/bottom_sheet.dart index 31663da442..2137909436 100644 --- a/packages/flutter/lib/src/material/bottom_sheet.dart +++ b/packages/flutter/lib/src/material/bottom_sheet.dart @@ -596,7 +596,7 @@ class _BottomSheetSuspendedCurve extends ParametricCurve { /// Returns a `Future` that resolves to the value (if any) that was passed to /// [Navigator.pop] when the modal bottom sheet was closed. /// -/// {@tool dartpad --template=stateless_widget_scaffold_no_null_safety} +/// {@tool dartpad --template=stateless_widget_scaffold} /// /// This example demonstrates how to use `showModalBottomSheet` to display a /// bottom sheet that obscures the content behind it when a user taps a button. diff --git a/packages/flutter/lib/src/material/expansion_panel.dart b/packages/flutter/lib/src/material/expansion_panel.dart index 881e9e7270..ae286f48a2 100644 --- a/packages/flutter/lib/src/material/expansion_panel.dart +++ b/packages/flutter/lib/src/material/expansion_panel.dart @@ -148,7 +148,7 @@ class ExpansionPanelRadio extends ExpansionPanel { /// Note that [expansionCallback] behaves differently for [ExpansionPanelList] /// and [ExpansionPanelList.radio]. /// -/// {@tool dartpad --template=stateful_widget_scaffold_no_null_safety} +/// {@tool dartpad --template=stateful_widget_scaffold} /// /// Here is a simple example of how to implement ExpansionPanelList. /// @@ -156,8 +156,8 @@ class ExpansionPanelRadio extends ExpansionPanel { /// // stores ExpansionPanel state information /// class Item { /// Item({ -/// this.expandedValue, -/// this.headerValue, +/// required this.expandedValue, +/// required this.headerValue, /// this.isExpanded = false, /// }); /// @@ -252,7 +252,7 @@ class ExpansionPanelList extends StatefulWidget { /// arguments must not be null. The [children] objects must be instances /// of [ExpansionPanelRadio]. /// - /// {@tool dartpad --template=stateful_widget_scaffold_no_null_safety} + /// {@tool dartpad --template=stateful_widget_scaffold} /// /// Here is a simple example of how to implement ExpansionPanelList.radio. /// @@ -260,9 +260,9 @@ class ExpansionPanelList extends StatefulWidget { /// // stores ExpansionPanel state information /// class Item { /// Item({ - /// this.id, - /// this.expandedValue, - /// this.headerValue, + /// required this.id, + /// required this.expandedValue, + /// required this.headerValue, /// }); /// /// int id; diff --git a/packages/flutter/lib/src/material/flexible_space_bar.dart b/packages/flutter/lib/src/material/flexible_space_bar.dart index 1921dbb503..1bea155400 100644 --- a/packages/flutter/lib/src/material/flexible_space_bar.dart +++ b/packages/flutter/lib/src/material/flexible_space_bar.dart @@ -53,7 +53,7 @@ enum StretchMode { /// [FlexibleSpaceBar.createSettings], to convey sizing information down to the /// [FlexibleSpaceBar]. /// -/// {@tool dartpad --template=freeform_no_null_safety} +/// {@tool dartpad --template=freeform} /// 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 @@ -78,7 +78,7 @@ enum StretchMode { /// stretch: true, /// onStretchTrigger: () { /// // Function callback for stretch -/// return; +/// return Future.value(); /// }, /// expandedHeight: 300.0, /// flexibleSpace: FlexibleSpaceBar( diff --git a/packages/flutter/lib/src/material/floating_action_button_location.dart b/packages/flutter/lib/src/material/floating_action_button_location.dart index f8e1d78e9a..d209773e43 100644 --- a/packages/flutter/lib/src/material/floating_action_button_location.dart +++ b/packages/flutter/lib/src/material/floating_action_button_location.dart @@ -431,7 +431,7 @@ abstract class FloatingActionButtonLocation { /// You can create your own subclass of [StandardFabLocation] /// to implement a custom [FloatingActionButtonLocation]. /// -/// {@tool dartpad --template=stateless_widget_material_no_null_safety} +/// {@tool dartpad --template=stateless_widget_material} /// /// This is an example of a user-defined [FloatingActionButtonLocation]. /// diff --git a/packages/flutter/lib/src/material/icon_button.dart b/packages/flutter/lib/src/material/icon_button.dart index 1be02a81e4..b813aa38ac 100644 --- a/packages/flutter/lib/src/material/icon_button.dart +++ b/packages/flutter/lib/src/material/icon_button.dart @@ -40,7 +40,7 @@ const double _kMinButtonSize = kMinInteractiveDimension; /// requirements in the Material Design specification. The [alignment] controls /// how the icon itself is positioned within the hit region. /// -/// {@tool dartpad --template=stateful_widget_scaffold_center_no_null_safety} +/// {@tool dartpad --template=stateful_widget_scaffold_center} /// /// This sample shows an `IconButton` that uses the Material icon "volume_up" to /// increase the volume. @@ -84,7 +84,7 @@ const double _kMinButtonSize = kMinInteractiveDimension; /// the underlying [Material] along with the splash and highlight /// [InkResponse] contributed by descendant widgets. /// -/// {@tool dartpad --template=stateless_widget_scaffold_no_null_safety} +/// {@tool dartpad --template=stateless_widget_scaffold} /// /// 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 diff --git a/packages/flutter/lib/src/material/outline_button.dart b/packages/flutter/lib/src/material/outline_button.dart index 35eb35b9ad..8c920b9b89 100644 --- a/packages/flutter/lib/src/material/outline_button.dart +++ b/packages/flutter/lib/src/material/outline_button.dart @@ -57,7 +57,7 @@ const Duration _kElevationDuration = Duration(milliseconds: 75); /// Outline buttons have a minimum size of 88.0 by 36.0 which can be overridden /// with [ButtonTheme]. /// -/// {@tool dartpad --template=stateless_widget_scaffold_center_no_null_safety} +/// {@tool dartpad --template=stateless_widget_scaffold_center} /// /// Here is an example of a basic [OutlineButton]. /// diff --git a/packages/flutter/lib/src/material/progress_indicator.dart b/packages/flutter/lib/src/material/progress_indicator.dart index e901d36d81..a7a6496123 100644 --- a/packages/flutter/lib/src/material/progress_indicator.dart +++ b/packages/flutter/lib/src/material/progress_indicator.dart @@ -243,12 +243,12 @@ 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 --template=stateful_widget_material_ticker_no_null_safety} +/// {@tool dartpad --template=stateful_widget_material_ticker} /// /// This example shows a [LinearProgressIndicator] with a changing value. /// /// ```dart -/// AnimationController controller; +/// late AnimationController controller; /// /// @override /// void initState() { @@ -481,12 +481,12 @@ class _CircularProgressIndicatorPainter extends CustomPainter { /// The indicator arc is displayed with [valueColor], an animated value. To /// specify a constant color use: `AlwaysStoppedAnimation(color)`. /// -/// {@tool dartpad --template=stateful_widget_material_ticker_no_null_safety} +/// {@tool dartpad --template=stateful_widget_material_ticker} /// /// This example shows a [CircularProgressIndicator] with a changing value. /// /// ```dart -/// AnimationController controller; +/// late AnimationController controller; /// /// @override /// void initState() {