Make Flex,Row,Column const for real (#119673)
* Make Flex,Row,Column const for real
* dart fix --apply
* fix snippets
* fix integration test
* add comment
diff --git a/dev/automated_tests/flutter_test/print_correct_local_widget_test.dart b/dev/automated_tests/flutter_test/print_correct_local_widget_test.dart
index 9999c70..c24a255 100644
--- a/dev/automated_tests/flutter_test/print_correct_local_widget_test.dart
+++ b/dev/automated_tests/flutter_test/print_correct_local_widget_test.dart
@@ -14,15 +14,15 @@
appBar: AppBar(
title: const Text('RenderFlex OverFlow'),
),
- body: SizedBox(
+ body: const SizedBox(
width: 400.0,
child: Row(
children: <Widget>[
- const Icon(Icons.message),
+ Icon(Icons.message),
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
- children: const <Widget>[
+ children: <Widget>[
Text('Title'),
Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed '
diff --git a/dev/benchmarks/complex_layout/lib/src/app.dart b/dev/benchmarks/complex_layout/lib/src/app.dart
index df6bccf..7337d78 100644
--- a/dev/benchmarks/complex_layout/lib/src/app.dart
+++ b/dev/benchmarks/complex_layout/lib/src/app.dart
@@ -279,11 +279,11 @@
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.only(left: 16.0, right: 16.0),
+ return const Padding(
+ padding: EdgeInsets.only(left: 16.0, right: 16.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: const <Widget>[
+ children: <Widget>[
IconWithText(Icons.thumb_up, 'Like'),
IconWithText(Icons.comment, 'Comment'),
IconWithText(Icons.share, 'Share'),
@@ -578,9 +578,9 @@
),
),
),
- child: Row(
+ child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: const <Widget>[
+ children: <Widget>[
BottomBarButton(Icons.new_releases, 'News'),
BottomBarButton(Icons.people, 'Requests'),
BottomBarButton(Icons.chat, 'Messenger'),
diff --git a/dev/benchmarks/macrobenchmarks/lib/src/cubic_bezier.dart b/dev/benchmarks/macrobenchmarks/lib/src/cubic_bezier.dart
index 2f33c86..bf903f2 100644
--- a/dev/benchmarks/macrobenchmarks/lib/src/cubic_bezier.dart
+++ b/dev/benchmarks/macrobenchmarks/lib/src/cubic_bezier.dart
@@ -12,10 +12,10 @@
@override
Widget build(BuildContext context) {
- return Center(
+ return const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Bezier(Colors.amber, 1.0),
],
),
diff --git a/dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart b/dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart
index 7a24cff..fcbbe5c 100644
--- a/dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart
+++ b/dev/benchmarks/macrobenchmarks/lib/src/stack_size.dart
@@ -88,9 +88,9 @@
@override
Widget build(BuildContext context) {
- return Material(
+ return const Material(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
width: 200,
height: 100,
diff --git a/dev/benchmarks/macrobenchmarks/lib/src/text.dart b/dev/benchmarks/macrobenchmarks/lib/src/text.dart
index eefde7f..ecbd04a 100644
--- a/dev/benchmarks/macrobenchmarks/lib/src/text.dart
+++ b/dev/benchmarks/macrobenchmarks/lib/src/text.dart
@@ -9,10 +9,10 @@
@override
Widget build(BuildContext context) {
- return Material(
+ return const Material(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
width: 200,
height: 100,
diff --git a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart
index 6ea32b1..1df4ae0 100644
--- a/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart
+++ b/dev/benchmarks/macrobenchmarks/lib/src/web/bench_simple_lazy_text_scroll.dart
@@ -20,10 +20,10 @@
@override
Widget createWidget() {
- return Directionality(
+ return const Directionality(
textDirection: TextDirection.ltr,
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Flexible(
child: _TestScrollingWidget(
initialScrollOffset: 0,
diff --git a/dev/benchmarks/microbenchmarks/lib/foundation/all_elements_bench.dart b/dev/benchmarks/microbenchmarks/lib/foundation/all_elements_bench.dart
index fc9988e..22f3869 100644
--- a/dev/benchmarks/microbenchmarks/lib/foundation/all_elements_bench.dart
+++ b/dev/benchmarks/microbenchmarks/lib/foundation/all_elements_bench.dart
@@ -28,8 +28,8 @@
Icon(Icons.ac_unit),
],
),
- body: Column(
- children: const <Widget>[
+ body: const Column(
+ children: <Widget>[
Text('Item 1'),
Text('Item 2'),
Text('Item 3'),
diff --git a/dev/benchmarks/test_apps/stocks/lib/stock_home.dart b/dev/benchmarks/test_apps/stocks/lib/stock_home.dart
index b426635..0b9f785 100644
--- a/dev/benchmarks/test_apps/stocks/lib/stock_home.dart
+++ b/dev/benchmarks/test_apps/stocks/lib/stock_home.dart
@@ -345,8 +345,8 @@
@override
Widget build(BuildContext context) {
- return Column(
- children: const <Widget>[
+ return const Column(
+ children: <Widget>[
TextField(
autofocus: true,
decoration: InputDecoration(
diff --git a/dev/integration_tests/abstract_method_smoke_test/lib/main.dart b/dev/integration_tests/abstract_method_smoke_test/lib/main.dart
index 0b67152..ef26951 100644
--- a/dev/integration_tests/abstract_method_smoke_test/lib/main.dart
+++ b/dev/integration_tests/abstract_method_smoke_test/lib/main.dart
@@ -59,9 +59,9 @@
@override
Widget build(BuildContext context) {
- return Scaffold(
+ return const Scaffold(
body: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(
child: AndroidView(viewType: 'simple')
),
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
index 642678a..a83019e 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/cupertino/cupertino_switch_demo.dart
@@ -57,8 +57,8 @@
),
Semantics(
container: true,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
CupertinoSwitch(
value: true,
onChanged: null,
@@ -71,8 +71,8 @@
),
Semantics(
container: true,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
CupertinoSwitch(
value: false,
onChanged: null,
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
index bc36265..bdc8675 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/material/bottom_app_bar_demo.dart
@@ -402,9 +402,9 @@
@override
Widget build(BuildContext context) {
- return Drawer(
+ return const Drawer(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
ListTile(
leading: Icon(Icons.search),
title: Text('Search'),
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/search_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/search_demo.dart
index bb50d42..648e7ea 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/material/search_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/material/search_demo.dart
@@ -70,13 +70,13 @@
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- MergeSemantics(
+ const MergeSemantics(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Text('Press the '),
Tooltip(
message: 'search',
@@ -88,7 +88,7 @@
Text(' icon in the AppBar'),
],
),
- const Text('and search for an integer between 0 and 100,000.'),
+ Text('and search for an integer between 0 and 100,000.'),
],
),
),
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/selection_controls_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/selection_controls_demo.dart
index 10f3de9..0451ce5 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/material/selection_controls_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/material/selection_controls_demo.dart
@@ -126,9 +126,9 @@
),
],
),
- Row(
+ const Row(
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
// Disabled checkboxes
Checkbox(value: true, onChanged: null),
Checkbox(value: false, onChanged: null),
@@ -167,9 +167,9 @@
],
),
// Disabled radio buttons
- Row(
+ const Row(
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
Radio<int>(
value: 0,
groupValue: 0,
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart
index 0321572..2afd51f 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/material/slider_demo.dart
@@ -296,9 +296,9 @@
const Text('Continuous with Editable Numerical Value'),
],
),
- Column(
+ const Column(
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
Slider.adaptive(value: 0.25, onChanged: null),
Text('Disabled'),
],
diff --git a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart
index c311b39..f6680c2 100644
--- a/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart
+++ b/dev/integration_tests/flutter_gallery/lib/demo/transformations/transformations_demo.dart
@@ -93,10 +93,10 @@
Widget get instructionDialog {
return AlertDialog(
title: const Text('2D Transformations'),
- content: Column(
+ content: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
Text('Tap to edit hex tiles, and use gestures to move around the scene:\n'),
Text('- Drag to pan.'),
Text('- Pinch to zoom.'),
diff --git a/dev/integration_tests/ui/lib/overflow.dart b/dev/integration_tests/ui/lib/overflow.dart
index 882f952..4d084d9 100644
--- a/dev/integration_tests/ui/lib/overflow.dart
+++ b/dev/integration_tests/ui/lib/overflow.dart
@@ -29,7 +29,7 @@
if (!_triggered) {
return const SizedBox.shrink();
}
- return Row(children: const <Widget>[
+ return const Row(children: <Widget>[
SizedBox(width: 10000.0),
SizedBox(width: 10000.0),
SizedBox(width: 10000.0),
diff --git a/dev/integration_tests/web/lib/service_worker_test_cached_resources.dart b/dev/integration_tests/web/lib/service_worker_test_cached_resources.dart
index 9c8fb68..f466447 100644
--- a/dev/integration_tests/web/lib/service_worker_test_cached_resources.dart
+++ b/dev/integration_tests/web/lib/service_worker_test_cached_resources.dart
@@ -5,10 +5,10 @@
import 'package:flutter/material.dart';
Future<void> main() async {
- runApp(Scaffold(
+ runApp(const Scaffold(
body: Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Icon(Icons.ac_unit),
Text('Hello, World', textDirection: TextDirection.ltr),
],
diff --git a/dev/manual_tests/lib/actions.dart b/dev/manual_tests/lib/actions.dart
index ddf5911..ced4624 100644
--- a/dev/manual_tests/lib/actions.dart
+++ b/dev/manual_tests/lib/actions.dart
@@ -432,25 +432,25 @@
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'One'),
DemoButton(name: 'Two'),
DemoButton(name: 'Three'),
],
),
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Four'),
DemoButton(name: 'Five'),
DemoButton(name: 'Six'),
],
),
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Seven'),
DemoButton(name: 'Eight'),
DemoButton(name: 'Nine'),
diff --git a/dev/manual_tests/lib/drag_and_drop.dart b/dev/manual_tests/lib/drag_and_drop.dart
index f897cdf..db0080a 100644
--- a/dev/manual_tests/lib/drag_and_drop.dart
+++ b/dev/manual_tests/lib/drag_and_drop.dart
@@ -270,9 +270,9 @@
],
),
),
- Expanded(
+ const Expanded(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()),
diff --git a/dev/manual_tests/lib/focus.dart b/dev/manual_tests/lib/focus.dart
index 3b7d23e..4c93af3 100644
--- a/dev/manual_tests/lib/focus.dart
+++ b/dev/manual_tests/lib/focus.dart
@@ -152,18 +152,18 @@
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(
name: 'One',
autofocus: true,
),
],
),
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Two'),
DemoButton(
name: 'Three',
@@ -171,9 +171,9 @@
),
],
),
- Row(
+ const Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Four'),
DemoButton(name: 'Five'),
DemoButton(name: 'Six'),
diff --git a/dev/tracing_tests/test/inflate_widget_tracing_test.dart b/dev/tracing_tests/test/inflate_widget_tracing_test.dart
index 61273b4..700be3d 100644
--- a/dev/tracing_tests/test/inflate_widget_tracing_test.dart
+++ b/dev/tracing_tests/test/inflate_widget_tracing_test.dart
@@ -65,8 +65,8 @@
@override
Widget build(BuildContext context) {
return _showRow
- ? Row(
- children: const <Widget>[
+ ? const Row(
+ children: <Widget>[
TestChildWidget(),
TestChildWidget(),
],
diff --git a/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart b/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
index 11fa045..5014879 100644
--- a/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
+++ b/examples/api/lib/cupertino/activity_indicator/cupertino_activity_indicator.0.dart
@@ -25,8 +25,8 @@
@override
Widget build(BuildContext context) {
- return CupertinoPageScaffold(
- navigationBar: const CupertinoNavigationBar(
+ return const CupertinoPageScaffold(
+ navigationBar: CupertinoNavigationBar(
middle: Text('CupertinoActivityIndicator Sample'),
),
child: Center(
@@ -35,7 +35,7 @@
children: <Widget>[
Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Cupertino activity indicator with default properties.
CupertinoActivityIndicator(),
SizedBox(height: 10),
@@ -44,7 +44,7 @@
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Cupertino activity indicator with custom radius and color.
CupertinoActivityIndicator(radius: 20.0, color: CupertinoColors.activeBlue),
SizedBox(height: 10),
@@ -56,7 +56,7 @@
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Cupertino activity indicator with custom radius and disabled
// animation.
CupertinoActivityIndicator(radius: 20.0, animating: false),
diff --git a/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart b/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
index 79798f8..bbc4197 100644
--- a/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
+++ b/examples/api/lib/cupertino/form_row/cupertino_form_row.0.dart
@@ -56,33 +56,33 @@
},
),
),
- CupertinoFormRow(
- prefix: const PrefixWidget(
+ const CupertinoFormRow(
+ prefix: PrefixWidget(
icon: CupertinoIcons.wifi,
title: 'Wi-Fi',
color: CupertinoColors.systemBlue,
),
- error: const Text('Home network unavailable'),
+ error: Text('Home network unavailable'),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
- children: const <Widget>[
+ children: <Widget>[
Text('Not connected'),
SizedBox(width: 5),
Icon(CupertinoIcons.forward)
],
),
),
- CupertinoFormRow(
- prefix: const PrefixWidget(
+ const CupertinoFormRow(
+ prefix: PrefixWidget(
icon: CupertinoIcons.bluetooth,
title: 'Bluetooth',
color: CupertinoColors.activeBlue,
),
helper: Padding(
- padding: const EdgeInsets.symmetric(vertical: 4.0),
+ padding: EdgeInsets.symmetric(vertical: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: const <Widget>[
+ children: <Widget>[
Text('Headphone'),
Text('Connected'),
],
@@ -90,7 +90,7 @@
),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
- children: const <Widget>[
+ children: <Widget>[
Text('On'),
SizedBox(width: 5),
Icon(CupertinoIcons.forward)
diff --git a/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart b/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
index 8f37cc7..2813683 100644
--- a/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
+++ b/examples/api/lib/cupertino/nav_bar/cupertino_sliver_nav_bar.0.dart
@@ -86,10 +86,10 @@
// when the CupertinoSliverNavigationBar is fully expanded.
largeTitle: const Text('Family'),
),
- SliverFillRemaining(
+ const SliverFillRemaining(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: const <Widget>[
+ children: <Widget>[
Text('Drag me up', textAlign: TextAlign.center),
// When the "leading" parameter is omitted on a route that has a previous page,
// the back button is automatically added to the leading position.
diff --git a/examples/api/lib/material/button_style/button_style.0.dart b/examples/api/lib/material/button_style/button_style.0.dart
index 4cf9111..0cec279 100644
--- a/examples/api/lib/material/button_style/button_style.0.dart
+++ b/examples/api/lib/material/button_style/button_style.0.dart
@@ -30,10 +30,10 @@
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(4.0),
+ return const Padding(
+ padding: EdgeInsets.all(4.0),
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Spacer(),
ButtonTypesGroup(enabled: true),
ButtonTypesGroup(enabled: false),
diff --git a/examples/api/lib/material/card/card.2.dart b/examples/api/lib/material/card/card.2.dart
index b123bc4..215398c 100644
--- a/examples/api/lib/material/card/card.2.dart
+++ b/examples/api/lib/material/card/card.2.dart
@@ -17,8 +17,8 @@
theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('Card Examples')),
- body: Column(
- children: const <Widget>[
+ body: const Column(
+ children: <Widget>[
Spacer(),
ElevatedCardExample(),
FilledCardExample(),
diff --git a/examples/api/lib/material/divider/divider.1.dart b/examples/api/lib/material/divider/divider.1.dart
index 97c7499..bf4da00 100644
--- a/examples/api/lib/material/divider/divider.1.dart
+++ b/examples/api/lib/material/divider/divider.1.dart
@@ -28,11 +28,11 @@
@override
Widget build(BuildContext context) {
- return Center(
+ return const Center(
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(
child: Card(
child: SizedBox.expand(),
diff --git a/examples/api/lib/material/divider/vertical_divider.1.dart b/examples/api/lib/material/divider/vertical_divider.1.dart
index 558f30b..563649c 100644
--- a/examples/api/lib/material/divider/vertical_divider.1.dart
+++ b/examples/api/lib/material/divider/vertical_divider.1.dart
@@ -28,11 +28,11 @@
@override
Widget build(BuildContext context) {
- return Center(
+ return const Center(
child: Padding(
- padding: const EdgeInsets.all(16.0),
+ padding: EdgeInsets.all(16.0),
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Expanded(
child: Card(
child: SizedBox.expand(),
diff --git a/examples/api/lib/material/icon_button/icon_button.2.dart b/examples/api/lib/material/icon_button/icon_button.2.dart
index e3a516d..84cbd1b 100644
--- a/examples/api/lib/material/icon_button/icon_button.2.dart
+++ b/examples/api/lib/material/icon_button/icon_button.2.dart
@@ -30,10 +30,10 @@
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(4.0),
+ return const Padding(
+ padding: EdgeInsets.all(4.0),
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Spacer(),
ButtonTypesGroup(enabled: true),
ButtonTypesGroup(enabled: false),
diff --git a/examples/api/lib/material/icon_button/icon_button.3.dart b/examples/api/lib/material/icon_button/icon_button.3.dart
index 5b250f0..bbfe47e 100644
--- a/examples/api/lib/material/icon_button/icon_button.3.dart
+++ b/examples/api/lib/material/icon_button/icon_button.3.dart
@@ -38,15 +38,15 @@
class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> {
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.all(8.0),
+ return const Padding(
+ padding: EdgeInsets.all(8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
// Standard IconButton
- children: const <Widget>[
+ children: <Widget>[
DemoIconToggleButton(isEnabled: true),
SizedBox(width: 10),
DemoIconToggleButton(isEnabled: false),
@@ -54,7 +54,7 @@
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Filled IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledButtonStyle,),
SizedBox(width: 10),
@@ -63,7 +63,7 @@
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Filled Tonal IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledTonalButtonStyle,),
SizedBox(width: 10),
@@ -72,7 +72,7 @@
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
// Outlined IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledOutlinedButtonStyle,),
SizedBox(width: 10),
diff --git a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
index a89612e..99ee08b 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.prefix_icon_constraints.0.dart
@@ -30,11 +30,11 @@
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ return const Padding(
+ padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
TextField(
decoration: InputDecoration(
hintText: 'Normal Icon Constraints',
diff --git a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
index 885c694..1103c6d 100644
--- a/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
+++ b/examples/api/lib/material/input_decorator/input_decoration.suffix_icon_constraints.0.dart
@@ -30,11 +30,11 @@
@override
Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.symmetric(horizontal: 8.0),
+ return const Padding(
+ padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
TextField(
decoration: InputDecoration(
hintText: 'Normal Icon Constraints',
diff --git a/examples/api/lib/material/segmented_button/segmented_button.0.dart b/examples/api/lib/material/segmented_button/segmented_button.0.dart
index ff0b26a..97770dd 100644
--- a/examples/api/lib/material/segmented_button/segmented_button.0.dart
+++ b/examples/api/lib/material/segmented_button/segmented_button.0.dart
@@ -17,11 +17,11 @@
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(useMaterial3: true),
- home: Scaffold(
+ home: const Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Spacer(),
Text('Single choice'),
SingleChoice(),
diff --git a/examples/api/lib/material/selectable_region/selectable_region.0.dart b/examples/api/lib/material/selectable_region/selectable_region.0.dart
index 553a411..c427def 100644
--- a/examples/api/lib/material/selectable_region/selectable_region.0.dart
+++ b/examples/api/lib/material/selectable_region/selectable_region.0.dart
@@ -21,10 +21,10 @@
home: SelectionArea(
child: Scaffold(
appBar: AppBar(title: const Text(_title)),
- body: Center(
+ body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Text('Select this icon', style: TextStyle(fontSize: 30)),
SizedBox(height: 10),
MySelectableAdapter(child: Icon(Icons.key, size: 30)),
diff --git a/examples/api/lib/material/selection_area/selection_area.0.dart b/examples/api/lib/material/selection_area/selection_area.0.dart
index b460a3d..3f538d7 100644
--- a/examples/api/lib/material/selection_area/selection_area.0.dart
+++ b/examples/api/lib/material/selection_area/selection_area.0.dart
@@ -20,10 +20,10 @@
home: SelectionArea(
child: Scaffold(
appBar: AppBar(title: const Text(_title)),
- body: Center(
+ body: const Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Text('Row 1'),
Text('Row 2'),
Text('Row 3'),
diff --git a/examples/api/lib/material/selection_container/selection_container.0.dart b/examples/api/lib/material/selection_container/selection_container.0.dart
index fa0716a..cd8a503 100644
--- a/examples/api/lib/material/selection_container/selection_container.0.dart
+++ b/examples/api/lib/material/selection_container/selection_container.0.dart
@@ -21,11 +21,11 @@
home: SelectionArea(
child: Scaffold(
appBar: AppBar(title: const Text(_title)),
- body: Center(
+ body: const Center(
child: SelectionAllOrNoneContainer(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Text('Row 1'),
Text('Row 2'),
Text('Row 3'),
diff --git a/examples/api/lib/material/selection_container/selection_container_disabled.0.dart b/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
index 2296b92..8dd160d 100644
--- a/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
+++ b/examples/api/lib/material/selection_container/selection_container_disabled.0.dart
@@ -19,11 +19,11 @@
title: _title,
home: Scaffold(
appBar: AppBar(title: const Text(_title)),
- body: Center(
+ body: const Center(
child: SelectionArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Text('Selectable text'),
SelectionContainer.disabled(child: Text('Non-selectable text')),
Text('Selectable text'),
diff --git a/examples/api/lib/material/text_field/text_field.2.dart b/examples/api/lib/material/text_field/text_field.2.dart
index aa83523..f94f8a7 100644
--- a/examples/api/lib/material/text_field/text_field.2.dart
+++ b/examples/api/lib/material/text_field/text_field.2.dart
@@ -17,8 +17,8 @@
theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true),
home: Scaffold(
appBar: AppBar(title: const Text('TextField Examples')),
- body: Column(
- children: const <Widget>[
+ body: const Column(
+ children: <Widget>[
Spacer(),
FilledTextFieldExample(),
OutlinedTextFieldExample(),
diff --git a/examples/api/lib/widgets/actions/action.action_overridable.0.dart b/examples/api/lib/widgets/actions/action.action_overridable.0.dart
index f54952a..ec7a0b4 100644
--- a/examples/api/lib/widgets/actions/action.action_overridable.0.dart
+++ b/examples/api/lib/widgets/actions/action.action_overridable.0.dart
@@ -64,14 +64,14 @@
Widget build(BuildContext context) {
return Actions(
actions: <Type, Action<Intent>> { CopyTextIntent: CallbackAction<CopyTextIntent>(onInvoke: _copy) },
- child: Column(
+ child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
- const Text('Press Ctrl-C to Copy'),
- const SizedBox(height: 10),
+ Text('Press Ctrl-C to Copy'),
+ SizedBox(height: 10),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
CopyableText(text: '111'),
SizedBox(width: 5,),
CopyableText(text: '222'),
diff --git a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
index 780592b..b9e0c02 100644
--- a/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
+++ b/examples/api/lib/widgets/focus_traversal/ordered_traversal_policy.0.dart
@@ -64,25 +64,25 @@
Widget build(BuildContext context) {
return FocusTraversalGroup(
policy: OrderedTraversalPolicy(),
- child: Column(
+ child: const Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Six', order: 6),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Five', order: 5),
DemoButton(name: 'Four', order: 4),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
DemoButton(name: 'Three', order: 3),
DemoButton(name: 'Two', order: 2),
DemoButton(name: 'One', order: 1, autofocus: true),
diff --git a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
index 76ba709..08736bb 100644
--- a/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
+++ b/examples/api/lib/widgets/inherited_notifier/inherited_notifier.0.dart
@@ -90,9 +90,9 @@
Widget build(BuildContext context) {
return SpinModel(
notifier: _controller,
- child: Row(
+ child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: const <Widget>[
+ children: <Widget>[
Spinner(),
Spinner(),
Spinner(),
diff --git a/examples/api/lib/widgets/overlay/overlay.0.dart b/examples/api/lib/widgets/overlay/overlay.0.dart
index 78c20b9..fa2bab7 100644
--- a/examples/api/lib/widgets/overlay/overlay.0.dart
+++ b/examples/api/lib/widgets/overlay/overlay.0.dart
@@ -61,8 +61,8 @@
Builder(builder: (BuildContext context) {
switch (currentPageIndex) {
case 0:
- return Column(
- children: const <Widget>[
+ return const Column(
+ children: <Widget>[
Text(
'Explore page',
style: TextStyle(
@@ -76,8 +76,8 @@
],
);
case 1:
- return Column(
- children: const <Widget>[
+ return const Column(
+ children: <Widget>[
Text(
'Commute page',
style: TextStyle(
@@ -91,8 +91,8 @@
],
);
case 2:
- return Column(
- children: const <Widget>[
+ return const Column(
+ children: <Widget>[
Text(
'Saved page',
style: TextStyle(
diff --git a/examples/api/lib/widgets/shortcuts/character_activator.0.dart b/examples/api/lib/widgets/shortcuts/character_activator.0.dart
index d7982c6..56ed8a4 100644
--- a/examples/api/lib/widgets/shortcuts/character_activator.0.dart
+++ b/examples/api/lib/widgets/shortcuts/character_activator.0.dart
@@ -56,10 +56,10 @@
},
),
},
- child: Focus(
+ child: const Focus(
autofocus: true,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('Press question mark for help'),
],
),
diff --git a/examples/api/lib/widgets/transitions/listenable_builder.0.dart b/examples/api/lib/widgets/transitions/listenable_builder.0.dart
index 22ec43c..26e9eed 100644
--- a/examples/api/lib/widgets/transitions/listenable_builder.0.dart
+++ b/examples/api/lib/widgets/transitions/listenable_builder.0.dart
@@ -152,9 +152,9 @@
// The container background will change color to this when
// the subtree has focus.
focusedColor: Colors.blue.shade50,
- child: Column(
+ child: const Column(
crossAxisAlignment: CrossAxisAlignment.start,
- children: const <Widget>[
+ children: <Widget>[
Text('Owner:'),
MyField(label: 'First Name'),
MyField(label: 'Last Name'),
diff --git a/examples/splash/lib/main.dart b/examples/splash/lib/main.dart
index 57ec1de..6062b6c 100644
--- a/examples/splash/lib/main.dart
+++ b/examples/splash/lib/main.dart
@@ -6,13 +6,13 @@
void main() {
runApp(
- DecoratedBox(
- decoration: const BoxDecoration(color: Colors.white),
+ const DecoratedBox(
+ decoration: BoxDecoration(color: Colors.white),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
textDirection: TextDirection.ltr,
- children: const <Widget>[
+ children: <Widget>[
FlutterLogo(size: 48),
Padding(
padding: EdgeInsets.all(32),
diff --git a/packages/flutter/lib/src/cupertino/icons.dart b/packages/flutter/lib/src/cupertino/icons.dart
index 0294646..3eff9a4 100644
--- a/packages/flutter/lib/src/cupertino/icons.dart
+++ b/packages/flutter/lib/src/cupertino/icons.dart
@@ -30,9 +30,9 @@
/// ![The following code snippet would generate a row of icons consisting of a pink heart, a green bell, and a blue umbrella, each progressively bigger than the last.](https://flutter.github.io/assets-for-api-docs/assets/cupertino/cupertino_icon.png)
///
/// ```dart
-/// Row(
+/// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
-/// children: const <Widget>[
+/// children: <Widget>[
/// Icon(
/// CupertinoIcons.heart_fill,
/// color: Colors.pink,
diff --git a/packages/flutter/lib/src/material/button_bar.dart b/packages/flutter/lib/src/material/button_bar.dart
index 8652cb1..7cdd64a 100644
--- a/packages/flutter/lib/src/material/button_bar.dart
+++ b/packages/flutter/lib/src/material/button_bar.dart
@@ -233,7 +233,7 @@
class _ButtonBarRow extends Flex {
/// Creates a button bar that attempts to display in a row, but displays in
/// a column if there is insufficient horizontal space.
- _ButtonBarRow({
+ const _ButtonBarRow({
required super.children,
super.mainAxisSize,
super.mainAxisAlignment,
diff --git a/packages/flutter/lib/src/material/icons.dart b/packages/flutter/lib/src/material/icons.dart
index 2d09b0a..e7aa77a 100644
--- a/packages/flutter/lib/src/material/icons.dart
+++ b/packages/flutter/lib/src/material/icons.dart
@@ -119,9 +119,9 @@
/// ![The following code snippet would generate a row of icons consisting of a pink heart, a green musical note, and a blue umbrella, each progressively bigger than the last.](https://flutter.github.io/assets-for-api-docs/assets/widgets/icon.png)
///
/// ```dart
-/// Row(
+/// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
-/// children: const <Widget>[
+/// children: <Widget>[
/// Icon(
/// Icons.favorite,
/// color: Colors.pink,
diff --git a/packages/flutter/lib/src/material/list_tile.dart b/packages/flutter/lib/src/material/list_tile.dart
index ce3bf51..1f50648 100644
--- a/packages/flutter/lib/src/material/list_tile.dart
+++ b/packages/flutter/lib/src/material/list_tile.dart
@@ -160,8 +160,8 @@
/// whereas a [Row] does not constrain its children.
///
/// ```dart
-/// Row(
-/// children: const <Widget>[
+/// const Row(
+/// children: <Widget>[
/// Expanded(
/// child: ListTile(
/// leading: FlutterLogo(),
diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart
index 8d98ffe..d32d884 100644
--- a/packages/flutter/lib/src/material/tabs.dart
+++ b/packages/flutter/lib/src/material/tabs.dart
@@ -275,7 +275,7 @@
// upon layout. The tab widths are only used at paint time (see _IndicatorPainter)
// or in response to input.
class _TabLabelBar extends Flex {
- _TabLabelBar({
+ const _TabLabelBar({
super.children,
required this.onPerformLayout,
}) : super(
diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart
index a295c95..120487b 100644
--- a/packages/flutter/lib/src/widgets/basic.dart
+++ b/packages/flutter/lib/src/widgets/basic.dart
@@ -4445,9 +4445,7 @@
/// to be necessary to decide which direction to lay the children in or to
/// disambiguate `start` or `end` values for the main or cross axis
/// directions, the [textDirection] must not be null.
- // TODO(goderbauer): Figure out whether this can be const.
- // ignore: prefer_const_constructors_in_immutables
- Flex({
+ const Flex({
super.key,
required this.direction,
this.mainAxisAlignment = MainAxisAlignment.start,
@@ -4458,7 +4456,8 @@
this.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be
this.clipBehavior = Clip.none,
super.children,
- }) : assert(crossAxisAlignment != CrossAxisAlignment.baseline || textBaseline != null, 'textBaseline is required if you specify the crossAxisAlignment with CrossAxisAlignment.baseline');
+ }) : assert(!identical(crossAxisAlignment, CrossAxisAlignment.baseline) || textBaseline != null, 'textBaseline is required if you specify the crossAxisAlignment with CrossAxisAlignment.baseline');
+ // Cannot use == in the assert above instead of identical because of https://github.com/dart-lang/language/issues/1811.
/// The direction to use as the main axis.
///
@@ -4649,8 +4648,8 @@
/// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/row.png)
///
/// ```dart
-/// Row(
-/// children: const <Widget>[
+/// const Row(
+/// children: <Widget>[
/// Expanded(
/// child: Text('Deliver features faster', textAlign: TextAlign.center),
/// ),
@@ -4684,8 +4683,8 @@
/// Suppose, for instance, that you had this code:
///
/// ```dart
-/// Row(
-/// children: const <Widget>[
+/// const Row(
+/// children: <Widget>[
/// FlutterLogo(),
/// Text("Flutter's hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android."),
/// Icon(Icons.sentiment_very_satisfied),
@@ -4711,8 +4710,8 @@
/// row that the child should be given the remaining room:
///
/// ```dart
-/// Row(
-/// children: const <Widget>[
+/// const Row(
+/// children: <Widget>[
/// FlutterLogo(),
/// Expanded(
/// child: Text("Flutter's hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android."),
@@ -4740,9 +4739,9 @@
/// [TextDirection.rtl]. This is shown in the example below
///
/// ```dart
-/// Row(
+/// const Row(
/// textDirection: TextDirection.rtl,
-/// children: const <Widget>[
+/// children: <Widget>[
/// FlutterLogo(),
/// Expanded(
/// child: Text("Flutter's hot reload helps you quickly and easily experiment, build UIs, add features, and fix bug faster. Experience sub-second reload times, without losing state, on emulators, simulators, and hardware for iOS and Android."),
@@ -4814,7 +4813,7 @@
/// unless the row has no children or only one child) or to disambiguate
/// `start` or `end` values for the [mainAxisAlignment], the [textDirection]
/// must not be null.
- Row({
+ const Row({
super.key,
super.mainAxisAlignment,
super.mainAxisSize,
@@ -4851,8 +4850,8 @@
/// ![Using the Column in this way creates two short lines of text with a large Flutter underneath.](https://flutter.github.io/assets-for-api-docs/assets/widgets/column.png)
///
/// ```dart
-/// Column(
-/// children: const <Widget>[
+/// const Column(
+/// children: <Widget>[
/// Text('Deliver features faster'),
/// Text('Craft beautiful UIs'),
/// Expanded(
@@ -5007,7 +5006,7 @@
/// any. If there is no ambient directionality, and a text direction is going
/// to be necessary to disambiguate `start` or `end` values for the
/// [crossAxisAlignment], the [textDirection] must not be null.
- Column({
+ const Column({
super.key,
super.mainAxisAlignment,
super.mainAxisSize,
diff --git a/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart b/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
index 51f9569..7ccbe9f 100644
--- a/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
+++ b/packages/flutter/lib/src/widgets/default_text_editing_shortcuts.dart
@@ -37,15 +37,15 @@
/// // If using WidgetsApp or its descendents MaterialApp or CupertinoApp,
/// // then DefaultTextEditingShortcuts is already being inserted into the
/// // widget tree.
-/// return DefaultTextEditingShortcuts(
+/// return const DefaultTextEditingShortcuts(
/// child: Center(
/// child: Shortcuts(
-/// shortcuts: const <ShortcutActivator, Intent>{
+/// shortcuts: <ShortcutActivator, Intent>{
/// SingleActivator(LogicalKeyboardKey.arrowDown, alt: true): NextFocusIntent(),
/// SingleActivator(LogicalKeyboardKey.arrowUp, alt: true): PreviousFocusIntent(),
/// },
/// child: Column(
-/// children: const <Widget>[
+/// children: <Widget>[
/// TextField(
/// decoration: InputDecoration(
/// hintText: 'alt + down moves to the next field.',
diff --git a/packages/flutter/lib/src/widgets/icon.dart b/packages/flutter/lib/src/widgets/icon.dart
index 3868c6e..9dd561e 100644
--- a/packages/flutter/lib/src/widgets/icon.dart
+++ b/packages/flutter/lib/src/widgets/icon.dart
@@ -36,9 +36,9 @@
/// ![The following code snippet would generate a row of icons consisting of a pink heart, a green musical note, and a blue umbrella, each progressively bigger than the last.](https://flutter.github.io/assets-for-api-docs/assets/widgets/icon.png)
///
/// ```dart
-/// Row(
+/// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround,
-/// children: const <Widget>[
+/// children: <Widget>[
/// Icon(
/// Icons.favorite,
/// color: Colors.pink,
diff --git a/packages/flutter/lib/src/widgets/spacer.dart b/packages/flutter/lib/src/widgets/spacer.dart
index 92ca7c6..b84aac8 100644
--- a/packages/flutter/lib/src/widgets/spacer.dart
+++ b/packages/flutter/lib/src/widgets/spacer.dart
@@ -18,8 +18,8 @@
/// {@tool snippet}
///
/// ```dart
-/// Row(
-/// children: const <Widget>[
+/// const Row(
+/// children: <Widget>[
/// Text('Begin'),
/// Spacer(), // Defaults to a flex of one.
/// Text('Middle'),
diff --git a/packages/flutter/test/cupertino/text_field_test.dart b/packages/flutter/test/cupertino/text_field_test.dart
index 879fc69..7b0d520 100644
--- a/packages/flutter/test/cupertino/text_field_test.dart
+++ b/packages/flutter/test/cupertino/text_field_test.dart
@@ -1702,9 +1702,9 @@
testWidgets('copy paste', (WidgetTester tester) async {
await tester.pumpWidget(
- CupertinoApp(
+ const CupertinoApp(
home: Column(
- children: const <Widget>[
+ children: <Widget>[
CupertinoTextField(
placeholder: 'field 1',
),
diff --git a/packages/flutter/test/material/app_bar_test.dart b/packages/flutter/test/material/app_bar_test.dart
index a48f06b..c4f60a6 100644
--- a/packages/flutter/test/material/app_bar_test.dart
+++ b/packages/flutter/test/material/app_bar_test.dart
@@ -701,7 +701,7 @@
appBar: AppBar(
title: const Text('X'),
),
- drawer: Column(), // Doesn't really matter. Triggers a hamburger regardless.
+ drawer: const Column(), // Doesn't really matter. Triggers a hamburger regardless.
),
),
);
diff --git a/packages/flutter/test/material/bottom_app_bar_theme_test.dart b/packages/flutter/test/material/bottom_app_bar_theme_test.dart
index 2926a8b..437d76f 100644
--- a/packages/flutter/test/material/bottom_app_bar_theme_test.dart
+++ b/packages/flutter/test/material/bottom_app_bar_theme_test.dart
@@ -253,9 +253,9 @@
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: RepaintBoundary(
key: _painterKey,
- child: BottomAppBar(
+ child: const BottomAppBar(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Icon(Icons.add),
Expanded(child: SizedBox()),
Icon(Icons.add),
diff --git a/packages/flutter/test/material/card_test.dart b/packages/flutter/test/material/card_test.dart
index aec9a5a..ae549b3 100644
--- a/packages/flutter/test/material/card_test.dart
+++ b/packages/flutter/test/material/card_test.dart
@@ -82,13 +82,13 @@
debugResetSemanticsIdCounter();
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Material(
child: Center(
child: Card(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('First child'),
Text('Second child'),
],
diff --git a/packages/flutter/test/material/chip_test.dart b/packages/flutter/test/material/chip_test.dart
index 13e27b6..ad3b8d9 100644
--- a/packages/flutter/test/material/chip_test.dart
+++ b/packages/flutter/test/material/chip_test.dart
@@ -579,8 +579,8 @@
const TextStyle style = TextStyle(fontFamily: 'Ahem', fontSize: 10.0);
await tester.pumpWidget(
wrapForChip(
- child: Row(
- children: const <Widget>[
+ child: const Row(
+ children: <Widget>[
Chip(label: Text('Test'), labelStyle: style),
],
),
@@ -590,8 +590,8 @@
expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0));
await tester.pumpWidget(
wrapForChip(
- child: Row(
- children: const <Widget>[
+ child: const Row(
+ children: <Widget>[
Flexible(child: Chip(label: Text('Test'), labelStyle: style)),
],
),
@@ -601,8 +601,8 @@
expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0));
await tester.pumpWidget(
wrapForChip(
- child: Row(
- children: const <Widget>[
+ child: const Row(
+ children: <Widget>[
Expanded(child: Chip(label: Text('Test'), labelStyle: style)),
],
),
@@ -615,8 +615,8 @@
testWidgets('Chip responds to materialTapTargetSize', (WidgetTester tester) async {
await tester.pumpWidget(
wrapForChip(
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Chip(
label: Text('X'),
materialTapTargetSize: MaterialTapTargetSize.padded,
@@ -731,8 +731,8 @@
testWidgets('Chip responds to textScaleFactor', (WidgetTester tester) async {
await tester.pumpWidget(
wrapForChip(
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Chip(
avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A'),
@@ -762,8 +762,8 @@
await tester.pumpWidget(
wrapForChip(
textScaleFactor: 3.0,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Chip(
avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A'),
@@ -789,8 +789,8 @@
// Check that individual text scales are taken into account.
await tester.pumpWidget(
wrapForChip(
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Chip(
avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A', textScaleFactor: 3.0),
diff --git a/packages/flutter/test/material/divider_test.dart b/packages/flutter/test/material/divider_test.dart
index f6dfd5b..1068147 100644
--- a/packages/flutter/test/material/divider_test.dart
+++ b/packages/flutter/test/material/divider_test.dart
@@ -128,12 +128,12 @@
testWidgets('Vertical Divider Test 2', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Material(
child: SizedBox(
height: 24.0,
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Text('Hey.'),
VerticalDivider(),
],
diff --git a/packages/flutter/test/material/expansion_tile_test.dart b/packages/flutter/test/material/expansion_tile_test.dart
index f99b00f..7c4d548 100644
--- a/packages/flutter/test/material/expansion_tile_test.dart
+++ b/packages/flutter/test/material/expansion_tile_test.dart
@@ -238,10 +238,10 @@
platform: TargetPlatform.iOS,
dividerColor: dividerColor,
),
- home: Material(
+ home: const Material(
child: SingleChildScrollView(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
ExpansionTile(
title: Text('Tile 1'),
maintainState: true,
diff --git a/packages/flutter/test/material/floating_action_button_location_test.dart b/packages/flutter/test/material/floating_action_button_location_test.dart
index 8e29970..161cadd 100644
--- a/packages/flutter/test/material/floating_action_button_location_test.dart
+++ b/packages/flutter/test/material/floating_action_button_location_test.dart
@@ -317,8 +317,8 @@
appBar: AppBar(),
floatingActionButton: FloatingActionButton(onPressed: () { }, mini: true),
floatingActionButtonLocation: FloatingActionButtonLocation.miniStartTop,
- body: Column(
- children: const <Widget>[
+ body: const Column(
+ children: <Widget>[
ListTile(
leading: CircleAvatar(),
),
diff --git a/packages/flutter/test/material/input_decorator_test.dart b/packages/flutter/test/material/input_decorator_test.dart
index a96089b..1484fe4 100644
--- a/packages/flutter/test/material/input_decorator_test.dart
+++ b/packages/flutter/test/material/input_decorator_test.dart
@@ -5935,12 +5935,12 @@
testWidgets('min intrinsic height for TextField with no content padding', (WidgetTester tester) async {
// Regression test for: https://github.com/flutter/flutter/issues/75509
- await tester.pumpWidget(MaterialApp(
+ await tester.pumpWidget(const MaterialApp(
home: Material(
child: Center(
child: IntrinsicHeight(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
TextField(
decoration: InputDecoration(
labelText: 'Label Text',
diff --git a/packages/flutter/test/material/raw_material_button_test.dart b/packages/flutter/test/material/raw_material_button_test.dart
index 9dd881a..9cf12c8 100644
--- a/packages/flutter/test/material/raw_material_button_test.dart
+++ b/packages/flutter/test/material/raw_material_button_test.dart
@@ -240,12 +240,12 @@
RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () { },
- child: SizedBox(
+ child: const SizedBox(
width: 400.0,
height: 400.0,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
height: 50.0,
width: 400.0,
diff --git a/packages/flutter/test/material/tabs_test.dart b/packages/flutter/test/material/tabs_test.dart
index a8b683a..28373d7 100644
--- a/packages/flutter/test/material/tabs_test.dart
+++ b/packages/flutter/test/material/tabs_test.dart
@@ -4515,10 +4515,10 @@
testWidgets('Tab preferredSize gives correct value', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Material(
child: Row(
- children: const <Tab>[
+ children: <Tab>[
Tab(icon: Icon(Icons.message)),
Tab(text: 'Two'),
Tab(text: 'Three', icon: Icon(Icons.chat)),
diff --git a/packages/flutter/test/material/toggle_buttons_test.dart b/packages/flutter/test/material/toggle_buttons_test.dart
index 4223502..9293096 100644
--- a/packages/flutter/test/material/toggle_buttons_test.dart
+++ b/packages/flutter/test/material/toggle_buttons_test.dart
@@ -389,8 +389,8 @@
child: ToggleButtons(
isSelected: const <bool>[false],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -416,8 +416,8 @@
child: ToggleButtons(
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -442,8 +442,8 @@
child: boilerplate(
child: ToggleButtons(
isSelected: const <bool>[true],
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -497,8 +497,8 @@
color: enabledColor,
isSelected: const <bool>[false],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -519,8 +519,8 @@
selectedColor: selectedColor,
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -540,8 +540,8 @@
child: ToggleButtons(
disabledColor: disabledColor,
isSelected: const <bool>[true],
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -565,8 +565,8 @@
child: ToggleButtons(
isSelected: const <bool>[false],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
]),
],
@@ -594,8 +594,8 @@
child: ToggleButtons(
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
]),
],
@@ -622,8 +622,8 @@
child: boilerplate(
child: ToggleButtons(
isSelected: const <bool>[true],
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
]),
],
@@ -652,8 +652,8 @@
fillColor: customFillColor,
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
]),
],
diff --git a/packages/flutter/test/material/toggle_buttons_theme_test.dart b/packages/flutter/test/material/toggle_buttons_theme_test.dart
index 725f3cc..f0416b9 100644
--- a/packages/flutter/test/material/toggle_buttons_theme_test.dart
+++ b/packages/flutter/test/material/toggle_buttons_theme_test.dart
@@ -261,10 +261,10 @@
color: enabledColor,
isSelected: const <bool>[false],
onPressed: (int index) {},
- children: <Widget>[
+ children: const <Widget>[
// This Row is used like this to test for both TextStyle
// and IconTheme for Text and Icon widgets respectively.
- Row(children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -290,8 +290,8 @@
color: enabledColor,
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -317,8 +317,8 @@
child: ToggleButtons(
color: enabledColor,
isSelected: const <bool>[false],
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
Icon(Icons.check),
]),
@@ -346,8 +346,8 @@
child: ToggleButtons(
isSelected: const <bool>[true],
onPressed: (int index) {},
- children: <Widget>[
- Row(children: const <Widget>[
+ children: const <Widget>[
+ Row(children: <Widget>[
Text('First child'),
]),
],
diff --git a/packages/flutter/test/material/tooltip_test.dart b/packages/flutter/test/material/tooltip_test.dart
index 0cef50d..0af5899 100644
--- a/packages/flutter/test/material/tooltip_test.dart
+++ b/packages/flutter/test/material/tooltip_test.dart
@@ -1280,10 +1280,10 @@
await gesture.moveTo(Offset.zero);
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Tooltip(
message: 'message1',
waitDuration: waitDuration,
diff --git a/packages/flutter/test/rendering/flex_overflow_test.dart b/packages/flutter/test/rendering/flex_overflow_test.dart
index 2c07402..7774400 100644
--- a/packages/flutter/test/rendering/flex_overflow_test.dart
+++ b/packages/flutter/test/rendering/flex_overflow_test.dart
@@ -10,9 +10,9 @@
void main() {
testWidgets('Flex overflow indicator', (WidgetTester tester) async {
await tester.pumpWidget(
- Center(
+ const Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 200.0, height: 200.0),
],
),
@@ -22,11 +22,11 @@
expect(find.byType(Column), isNot(paints..rect()));
await tester.pumpWidget(
- Center(
+ const Center(
child: SizedBox(
height: 100.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 200.0, height: 200.0),
],
),
@@ -39,11 +39,11 @@
expect(find.byType(Column), paints..rect());
await tester.pumpWidget(
- Center(
+ const Center(
child: SizedBox(
height: 0.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 200.0, height: 200.0),
],
),
diff --git a/packages/flutter/test/rendering/view_chrome_style_test.dart b/packages/flutter/test/rendering/view_chrome_style_test.dart
index bb54ebc..14fd248 100644
--- a/packages/flutter/test/rendering/view_chrome_style_test.dart
+++ b/packages/flutter/test/rendering/view_chrome_style_test.dart
@@ -232,7 +232,7 @@
testWidgets('Top AnnotatedRegion provides status bar overlay style and bottom AnnotatedRegion provides navigation bar overlay style', (WidgetTester tester) async {
setupTestDevice();
await tester.pumpWidget(
- Column(children: const <Widget>[
+ const Column(children: <Widget>[
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue,
@@ -258,7 +258,7 @@
testWidgets('Top only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async {
setupTestDevice();
await tester.pumpWidget(
- Column(children: const <Widget>[
+ const Column(children: <Widget>[
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue,
@@ -278,7 +278,7 @@
testWidgets('Bottom only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async {
setupTestDevice();
await tester.pumpWidget(
- Column(children: const <Widget>[
+ const Column(children: <Widget>[
Expanded(child: SizedBox.expand()),
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
diff --git a/packages/flutter/test/semantics/semantics_elevation_test.dart b/packages/flutter/test/semantics/semantics_elevation_test.dart
index 6c530e7..24c6918 100644
--- a/packages/flutter/test/semantics/semantics_elevation_test.dart
+++ b/packages/flutter/test/semantics/semantics_elevation_test.dart
@@ -26,25 +26,25 @@
// |
// --------------------------------------- 'ground'
final SemanticsTester semantics = SemanticsTester(tester);
- await tester.pumpWidget(MaterialApp(
+ await tester.pumpWidget(const MaterialApp(
home: Column(
children: <Widget>[
- const Text('ground'),
+ Text('ground'),
Card(
elevation: 10.0,
child: Column(
children: <Widget>[
- const Text('absolute elevation: 10'),
+ Text('absolute elevation: 10'),
PhysicalModel(
elevation: 5.0,
color: Colors.black,
child: Column(
children: <Widget>[
- const Text('absolute elevation: 15'),
+ Text('absolute elevation: 15'),
Card(
elevation: 7.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('absolute elevation: 22'),
Card(
elevation: 8.0,
@@ -56,7 +56,7 @@
],
),
),
- const Card(
+ Card(
elevation: 15.0,
child: Text('absolute elevation: 25'),
),
@@ -102,15 +102,15 @@
// is reversed
final SemanticsTester semantics = SemanticsTester(tester);
- await tester.pumpWidget(MaterialApp(
+ await tester.pumpWidget(const MaterialApp(
home: Column(
children: <Widget>[
- const Text('ground'),
+ Text('ground'),
Card(
elevation: 10.0,
child: Column(
children: <Widget>[
- const Card(
+ Card(
elevation: 15.0,
child: Text('absolute elevation: 25'),
),
@@ -119,11 +119,11 @@
color: Colors.black,
child: Column(
children: <Widget>[
- const Text('absolute elevation: 15'),
+ Text('absolute elevation: 15'),
Card(
elevation: 7.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('absolute elevation: 22'),
Card(
elevation: 8.0,
@@ -135,7 +135,7 @@
],
),
),
- const Text('absolute elevation: 10'),
+ Text('absolute elevation: 10'),
],
),
),
@@ -205,8 +205,8 @@
MergeSemantics(
child: Semantics(
explicitChildNodes: true, // just to be sure that it's going to be an explicit merge
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Card(
elevation: 15.0,
child: Text('abs. elevation 25.0'),
@@ -259,8 +259,8 @@
MergeSemantics(
child: Semantics(
explicitChildNodes: true, // just to be sure that it's going to be an explicit merge
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Card(
elevation: 5.0,
child: Text('abs. elevation 15.0'),
diff --git a/packages/flutter/test/widgets/align_test.dart b/packages/flutter/test/widgets/align_test.dart
index d89ec77..aa44e27 100644
--- a/packages/flutter/test/widgets/align_test.dart
+++ b/packages/flutter/test/widgets/align_test.dart
@@ -107,12 +107,12 @@
testWidgets('Align widthFactor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
Align(
widthFactor: 0.5,
child: SizedBox(
@@ -130,12 +130,12 @@
testWidgets('Align heightFactor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
- children: const <Widget>[
+ children: <Widget>[
Align(
heightFactor: 0.5,
child: SizedBox(
diff --git a/packages/flutter/test/widgets/animated_align_test.dart b/packages/flutter/test/widgets/animated_align_test.dart
index bf2101b..032f267 100644
--- a/packages/flutter/test/widgets/animated_align_test.dart
+++ b/packages/flutter/test/widgets/animated_align_test.dart
@@ -59,11 +59,11 @@
testWidgets('AnimatedAlign widthFactor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Row(
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
AnimatedAlign(
alignment: Alignment.center,
curve: Curves.ease,
@@ -84,10 +84,10 @@
testWidgets('AnimatedAlign heightFactor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
AnimatedAlign(
alignment: Alignment.center,
curve: Curves.ease,
@@ -108,11 +108,11 @@
testWidgets('AnimatedAlign null height factor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
AnimatedAlign(
alignment: Alignment.center,
curve: Curves.ease,
@@ -132,13 +132,13 @@
testWidgets('AnimatedAlign null widthFactor', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: SizedBox.shrink(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
AnimatedAlign(
alignment: Alignment.center,
curve: Curves.ease,
diff --git a/packages/flutter/test/widgets/autofill_group_test.dart b/packages/flutter/test/widgets/autofill_group_test.dart
index 8c42981..9721fca 100644
--- a/packages/flutter/test/widgets/autofill_group_test.dart
+++ b/packages/flutter/test/widgets/autofill_group_test.dart
@@ -17,7 +17,7 @@
const TextField client2 = TextField(autofillHints: <String>['2']);
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Scaffold(
body: AutofillGroup(
key: outerKey,
@@ -25,7 +25,7 @@
client1,
AutofillGroup(
key: innerKey,
- child: Column(children: const <Widget>[client2, TextField(autofillHints: null)]),
+ child: Column(children: <Widget>[client2, TextField(autofillHints: null)]),
),
]),
),
@@ -135,9 +135,9 @@
child: Column(children: <Widget>[
client1,
TextField(key: keyClient3, autofillHints: const <String>['3']),
- AutofillGroup(
+ const AutofillGroup(
key: innerKey,
- child: Column(children: const <Widget>[client2]),
+ child: Column(children: <Widget>[client2]),
),
]),
),
diff --git a/packages/flutter/test/widgets/basic_test.dart b/packages/flutter/test/widgets/basic_test.dart
index c7db528..8c885eb 100644
--- a/packages/flutter/test/widgets/basic_test.dart
+++ b/packages/flutter/test/widgets/basic_test.dart
@@ -658,10 +658,10 @@
});
testWidgets('ColoredBox - no size, no child', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
direction: Axis.horizontal,
textDirection: TextDirection.ltr,
- children: const <Widget>[
+ children: <Widget>[
SizedBox.shrink(
child: ColoredBox(color: colorToPaint),
),
@@ -681,10 +681,10 @@
testWidgets('ColoredBox - no size, child', (WidgetTester tester) async {
const ValueKey<int> key = ValueKey<int>(0);
const Widget child = SizedBox.expand(key: key);
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
direction: Axis.horizontal,
textDirection: TextDirection.ltr,
- children: const <Widget>[
+ children: <Widget>[
SizedBox.shrink(
child: ColoredBox(color: colorToPaint, child: child),
),
diff --git a/packages/flutter/test/widgets/column_test.dart b/packages/flutter/test/widgets/column_test.dart
index 2a4828e..7f86f28 100644
--- a/packages/flutter/test/widgets/column_test.dart
+++ b/packages/flutter/test/widgets/column_test.dart
@@ -18,10 +18,10 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// Default is MainAxisAlignment.start so children so the children's
// top edges should be at 0, 100, 500, child2's height should be 400.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
Expanded(child: SizedBox(key: child1Key, width: 100.0, height: 100.0)),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -64,10 +64,10 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// Default is MainAxisAlignment.start so children so the children's
// top edges should be at 0, 100, 200
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -108,11 +108,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's top edges should be at 200, 300
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
],
@@ -147,11 +147,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's top edges should be at 300, 400, 500.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.end,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -193,11 +193,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's top edges should be at 0, 250, 500
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -240,11 +240,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's top edges should be at 25, 175, 325, 475
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -293,11 +293,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x20 children's top edges should be at 135, 290, 445
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 20.0),
SizedBox(key: child1Key, width: 100.0, height: 20.0),
SizedBox(key: child2Key, width: 100.0, height: 20.0),
@@ -335,10 +335,10 @@
const Key flexKey = Key('flexKey');
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: flexKey,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0),
],
@@ -349,11 +349,11 @@
expect(renderBox.size.height, equals(600.0));
// Column with MainAxisSize.min without flexible children shrink wraps.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: flexKey,
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0),
],
@@ -367,11 +367,11 @@
testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async {
const Key childKey = Key('childKey');
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: SizedBox.shrink(
child: Column(
mainAxisSize: MainAxisSize.min,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: childKey,
width: 100.0,
@@ -399,11 +399,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// Default is MainAxisAlignment.start so children so the children's
// bottom edges should be at 0, 100, 500 from bottom, child2's height should be 400.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
Expanded(child: SizedBox(key: child1Key, width: 100.0, height: 100.0)),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -446,11 +446,11 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// Default is MainAxisAlignment.start so children so the children's
// bottom edges should be at 0, 100, 200 from bottom
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -491,12 +491,12 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's bottom edges should be at 200, 300 from bottom
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.center,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
],
@@ -531,12 +531,12 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's bottom edges should be at 300, 400, 500 from bottom.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.end,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -578,12 +578,12 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's bottom edges should be at 0, 250, 500 from bottom
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -626,12 +626,12 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x100 children's bottom edges should be at 25, 175, 325, 475 from bottom
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceAround,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0),
@@ -680,12 +680,12 @@
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
// The 100x20 children's bottom edges should be at 135, 290, 445 from bottom
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 20.0),
SizedBox(key: child1Key, width: 100.0, height: 20.0),
SizedBox(key: child2Key, width: 100.0, height: 20.0),
@@ -723,11 +723,11 @@
const Key flexKey = Key('flexKey');
// Default is MainAxisSize.max so the Column should be as high as the test: 600.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: flexKey,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0),
],
@@ -738,12 +738,12 @@
expect(renderBox.size.height, equals(600.0));
// Column with MainAxisSize.min without flexible children shrink wraps.
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: Column(
key: flexKey,
mainAxisSize: MainAxisSize.min,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0),
],
@@ -757,12 +757,12 @@
testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async {
const Key childKey = Key('childKey');
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: SizedBox.shrink(
child: Column(
mainAxisSize: MainAxisSize.min,
verticalDirection: VerticalDirection.up,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: childKey,
width: 100.0,
diff --git a/packages/flutter/test/widgets/dismissible_test.dart b/packages/flutter/test/widgets/dismissible_test.dart
index 7760ae9..f9766ff 100644
--- a/packages/flutter/test/widgets/dismissible_test.dart
+++ b/packages/flutter/test/widgets/dismissible_test.dart
@@ -640,14 +640,14 @@
// Dismissible contract. This is not an example of good practice.
testWidgets('dismissing bottom then top (smoketest)', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: SizedBox(
width: 100.0,
height: 1000.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Test1215DismissibleWidget('1'),
Test1215DismissibleWidget('2'),
],
diff --git a/packages/flutter/test/widgets/draggable_test.dart b/packages/flutter/test/widgets/draggable_test.dart
index 8548daf..3336a6f 100644
--- a/packages/flutter/test/widgets/draggable_test.dart
+++ b/packages/flutter/test/widgets/draggable_test.dart
@@ -1752,9 +1752,9 @@
await gesture.moveTo(secondLocation);
await tester.pump();
- await tester.pumpWidget(MaterialApp(
+ await tester.pumpWidget(const MaterialApp(
home: Column(
- children: const <Widget>[
+ children: <Widget>[
Draggable<int>(
data: 1,
feedback: Text('Dragging'),
@@ -2284,9 +2284,9 @@
await gesture.moveTo(secondLocation);
await tester.pump();
- await tester.pumpWidget(MaterialApp(
+ await tester.pumpWidget(const MaterialApp(
home: Column(
- children: const <Widget>[
+ children: <Widget>[
Draggable<int>(
data: 1,
feedback: Text('Dragging'),
@@ -3061,9 +3061,9 @@
const HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild;
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Column(
- children: const <Widget>[
+ children: <Widget>[
Draggable<int>(
feedback: SizedBox(height: 50.0, child: Text('Draggable')),
child: SizedBox(height: 50.0, child: Text('Target')),
@@ -3079,9 +3079,9 @@
// Regression test for https://github.com/flutter/flutter/issues/92083
testWidgets('feedback respect the MouseRegion cursor configure', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Column(
- children: const <Widget>[
+ children: <Widget>[
Draggable<int>(
ignoringFeedbackPointer: false,
feedback: MouseRegion(
diff --git a/packages/flutter/test/widgets/flex_test.dart b/packages/flutter/test/widgets/flex_test.dart
index 0e112b7..1a29b99 100644
--- a/packages/flutter/test/widgets/flex_test.dart
+++ b/packages/flutter/test/widgets/flex_test.dart
@@ -49,9 +49,9 @@
testWidgets('Flexible defaults to loose', (WidgetTester tester) async {
await tester.pumpWidget(
- Row(
+ const Row(
textDirection: TextDirection.ltr,
- children: const <Widget>[
+ children: <Widget>[
Flexible(child: SizedBox(width: 100.0, height: 200.0)),
],
),
@@ -64,11 +64,11 @@
testWidgets("Doesn't overflow because of floating point accumulated error", (WidgetTester tester) async {
// both of these cases have failed in the past due to floating point issues
await tester.pumpWidget(
- Center(
+ const Center(
child: SizedBox(
height: 400.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: SizedBox()),
Expanded(child: SizedBox()),
Expanded(child: SizedBox()),
@@ -81,11 +81,11 @@
),
);
await tester.pumpWidget(
- Center(
+ const Center(
child: SizedBox(
height: 199.0,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: SizedBox()),
Expanded(child: SizedBox()),
Expanded(child: SizedBox()),
@@ -104,7 +104,7 @@
// we only get a single exception. Otherwise we'd get two, the one we want and
// an extra one when we discover we never computed a size.
await tester.pumpWidget(
- Column(
+ const Column(
children: <Widget>[
Column(),
],
@@ -134,11 +134,17 @@
});
testWidgets('Can set and update clipBehavior', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(direction: Axis.vertical));
+ await tester.pumpWidget(const Flex(direction: Axis.vertical));
final RenderFlex renderObject = tester.allRenderObjects.whereType<RenderFlex>().first;
expect(renderObject.clipBehavior, equals(Clip.none));
- await tester.pumpWidget(Flex(direction: Axis.vertical, clipBehavior: Clip.antiAlias));
+ await tester.pumpWidget(const Flex(direction: Axis.vertical, clipBehavior: Clip.antiAlias));
expect(renderObject.clipBehavior, equals(Clip.antiAlias));
});
+
+ test('Flex/Column/Row can be const-constructed', () {
+ const Flex(direction: Axis.vertical);
+ const Column();
+ const Row();
+ });
}
diff --git a/packages/flutter/test/widgets/implicit_semantics_test.dart b/packages/flutter/test/widgets/implicit_semantics_test.dart
index 18455be..42ef792 100644
--- a/packages/flutter/test/widgets/implicit_semantics_test.dart
+++ b/packages/flutter/test/widgets/implicit_semantics_test.dart
@@ -17,8 +17,8 @@
textDirection: TextDirection.ltr,
child: Semantics(
container: true,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('Michael Goderbauer'),
Text('goderbauer@google.com'),
],
@@ -51,8 +51,8 @@
child: Semantics(
container: true,
explicitChildNodes: true,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('Michael Goderbauer'),
Text('goderbauer@google.com'),
],
@@ -98,8 +98,8 @@
explicitChildNodes: true,
child: Semantics(
label: 'Signed in as',
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('Michael Goderbauer'),
Text('goderbauer@google.com'),
],
@@ -140,8 +140,8 @@
container: true,
child: Semantics(
label: 'Signed in as',
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('Michael Goderbauer'),
Text('goderbauer@google.com'),
],
diff --git a/packages/flutter/test/widgets/list_body_test.dart b/packages/flutter/test/widgets/list_body_test.dart
index 986af0c..6fcc17e 100644
--- a/packages/flutter/test/widgets/list_body_test.dart
+++ b/packages/flutter/test/widgets/list_body_test.dart
@@ -29,9 +29,9 @@
void main() {
testWidgets('ListBody down', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
direction: Axis.vertical,
- children: const <Widget>[ ListBody(children: children) ],
+ children: <Widget>[ ListBody(children: children) ],
));
expectRects(
@@ -46,9 +46,9 @@
});
testWidgets('ListBody up', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
direction: Axis.vertical,
- children: const <Widget>[ ListBody(reverse: true, children: children) ],
+ children: <Widget>[ ListBody(reverse: true, children: children) ],
));
expectRects(
@@ -63,10 +63,10 @@
});
testWidgets('ListBody right', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
textDirection: TextDirection.ltr,
direction: Axis.horizontal,
- children: const <Widget>[
+ children: <Widget>[
Directionality(
textDirection: TextDirection.ltr,
child: ListBody(mainAxis: Axis.horizontal, children: children),
@@ -86,10 +86,10 @@
});
testWidgets('ListBody left', (WidgetTester tester) async {
- await tester.pumpWidget(Flex(
+ await tester.pumpWidget(const Flex(
textDirection: TextDirection.ltr,
direction: Axis.horizontal,
- children: const <Widget>[
+ children: <Widget>[
Directionality(
textDirection: TextDirection.rtl,
child: ListBody(mainAxis: Axis.horizontal, children: children),
@@ -147,7 +147,7 @@
FlutterError.onError = (FlutterErrorDetails error) => errors.add(error);
try {
await tester.pumpWidget(
- Flex(
+ const Flex(
textDirection: TextDirection.ltr,
direction: Axis.horizontal,
children: <Widget>[
@@ -159,7 +159,7 @@
Flex(
textDirection: TextDirection.ltr,
direction: Axis.vertical,
- children: const <Widget>[
+ children: <Widget>[
Directionality(
textDirection: TextDirection.ltr,
child: ListBody(
diff --git a/packages/flutter/test/widgets/multichildobject_with_keys_test.dart b/packages/flutter/test/widgets/multichildobject_with_keys_test.dart
index 7fa2045..d00260a 100644
--- a/packages/flutter/test/widgets/multichildobject_with_keys_test.dart
+++ b/packages/flutter/test/widgets/multichildobject_with_keys_test.dart
@@ -11,10 +11,10 @@
// Regression test for https://github.com/flutter/flutter/issues/48855.
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('0', key: ValueKey<int>(0)),
Text('1', key: ValueKey<int>(1)),
Text('2', key: ValueKey<int>(2)),
@@ -35,10 +35,10 @@
);
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('0', key: ValueKey<int>(0)),
Text('6', key: ValueKey<int>(6)),
Text('7', key: ValueKey<int>(7)),
@@ -62,8 +62,8 @@
testWidgets('Building a new MultiChildRenderObjectElement with children having duplicated keys throws', (WidgetTester tester) async {
const ValueKey<int> duplicatedKey = ValueKey<int>(1);
- await tester.pumpWidget(Column(
- children: const <Widget>[
+ await tester.pumpWidget(const Column(
+ children: <Widget>[
Text('Text 1', textDirection: TextDirection.ltr, key: duplicatedKey),
Text('Text 2', textDirection: TextDirection.ltr, key: duplicatedKey),
],
diff --git a/packages/flutter/test/widgets/parent_data_test.dart b/packages/flutter/test/widgets/parent_data_test.dart
index 837fd35..d546947 100644
--- a/packages/flutter/test/widgets/parent_data_test.dart
+++ b/packages/flutter/test/widgets/parent_data_test.dart
@@ -292,11 +292,11 @@
checkTree(tester, <TestParentData>[]);
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: DummyWidget(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Positioned(
top: 6.0,
left: 7.0,
diff --git a/packages/flutter/test/widgets/physical_model_test.dart b/packages/flutter/test/widgets/physical_model_test.dart
index c884ecc..c5ac33c 100644
--- a/packages/flutter/test/widgets/physical_model_test.dart
+++ b/packages/flutter/test/widgets/physical_model_test.dart
@@ -47,15 +47,15 @@
testWidgets('PhysicalModel - clips when overflows and elevation is 0', (WidgetTester tester) async {
const Key key = Key('test');
await tester.pumpWidget(
- MediaQuery(
+ const MediaQuery(
key: key,
- data: const MediaQueryData(),
+ data: MediaQueryData(),
child: Directionality(
textDirection: TextDirection.ltr,
child: Padding(
- padding: const EdgeInsets.all(50),
+ padding: EdgeInsets.all(50),
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Material(child: Text('A long long long long long long long string')),
Material(child: Text('A long long long long long long long string')),
Material(child: Text('A long long long long long long long string')),
diff --git a/packages/flutter/test/widgets/rich_text_test.dart b/packages/flutter/test/widgets/rich_text_test.dart
index 79dc0c5..e8c83ee 100644
--- a/packages/flutter/test/widgets/rich_text_test.dart
+++ b/packages/flutter/test/widgets/rich_text_test.dart
@@ -147,17 +147,17 @@
color: Colors.green,
child: IntrinsicHeight(
child: RichText(
- text: TextSpan(
+ text: const TextSpan(
children: <InlineSpan>[
- const TextSpan(text: 'Start\n', style: TextStyle(height: 1.0, fontSize: 16)),
+ TextSpan(text: 'Start\n', style: TextStyle(height: 1.0, fontSize: 16)),
WidgetSpan(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(height: 16, width: 16),
],
),
),
- const TextSpan(text: 'End', style: TextStyle(height: 1.0, fontSize: 16)),
+ TextSpan(text: 'End', style: TextStyle(height: 1.0, fontSize: 16)),
],
),
),
diff --git a/packages/flutter/test/widgets/row_test.dart b/packages/flutter/test/widgets/row_test.dart
index b189ed4..884dfbf 100644
--- a/packages/flutter/test/widgets/row_test.dart
+++ b/packages/flutter/test/widgets/row_test.dart
@@ -284,12 +284,12 @@
OrderPainter.log.clear();
const Key childKey = Key('childKey');
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: SizedBox.shrink(
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: childKey,
width: 100.0,
@@ -704,13 +704,13 @@
OrderPainter.log.clear();
const Key childKey = Key('childKey');
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: SizedBox.shrink(
child: Row(
textDirection: TextDirection.ltr,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: childKey,
width: 100.0,
@@ -1125,13 +1125,13 @@
OrderPainter.log.clear();
const Key childKey = Key('childKey');
- await tester.pumpWidget(Center(
+ await tester.pumpWidget(const Center(
child: SizedBox.shrink(
child: Row(
textDirection: TextDirection.rtl,
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: childKey,
width: 100.0,
diff --git a/packages/flutter/test/widgets/safe_area_test.dart b/packages/flutter/test/widgets/safe_area_test.dart
index 92c5fb6..2960351 100644
--- a/packages/flutter/test/widgets/safe_area_test.dart
+++ b/packages/flutter/test/widgets/safe_area_test.dart
@@ -113,10 +113,10 @@
}
testWidgets('SafeArea alone.', (WidgetTester tester) async {
- final Widget child = boilerplate(SafeArea(
+ final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: Placeholder()),
],
),
@@ -148,10 +148,10 @@
});
testWidgets('SafeArea alone - partial ViewInsets consume Padding', (WidgetTester tester) async {
- final Widget child = boilerplate(SafeArea(
+ final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: Placeholder()),
],
),
@@ -181,12 +181,12 @@
});
testWidgets('SafeArea with nested Scaffold', (WidgetTester tester) async {
- final Widget child = boilerplate(SafeArea(
+ final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true,
child: Scaffold(
resizeToAvoidBottomInset: false,
body: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: Placeholder()),
],
),
@@ -219,12 +219,12 @@
});
testWidgets('SafeArea with nested Scaffold - partial ViewInsets consume Padding', (WidgetTester tester) async {
- final Widget child = boilerplate(SafeArea(
+ final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true,
child: Scaffold(
resizeToAvoidBottomInset: false,
body: Column(
- children: const <Widget>[
+ children: <Widget>[
Expanded(child: Placeholder()),
],
),
diff --git a/packages/flutter/test/widgets/selectable_region_test.dart b/packages/flutter/test/widgets/selectable_region_test.dart
index 4af40c4..76f3f77 100644
--- a/packages/flutter/test/widgets/selectable_region_test.dart
+++ b/packages/flutter/test/widgets/selectable_region_test.dart
@@ -409,8 +409,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -449,8 +449,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
SelectionContainer.disabled(child: Text('Good, and you?')),
Text('Fine, thank you.'),
@@ -490,8 +490,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -529,8 +529,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -665,8 +665,8 @@
home: SelectableRegion(
focusNode: focusNode,
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -813,8 +813,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('جيد وانت؟', textDirection: TextDirection.rtl),
Text('Fine, thank you.'),
@@ -854,8 +854,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -954,8 +954,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -995,8 +995,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1031,8 +1031,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1067,8 +1067,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1102,8 +1102,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1141,8 +1141,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1201,8 +1201,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1311,8 +1311,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1402,8 +1402,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
@@ -1480,8 +1480,8 @@
home: SelectableRegion(
focusNode: FocusNode(),
selectionControls: materialTextSelectionControls,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('How are you?'),
Text('Good, and you?'),
Text('Fine, thank you.'),
diff --git a/packages/flutter/test/widgets/selectable_text_test.dart b/packages/flutter/test/widgets/selectable_text_test.dart
index a1fdd05..65beeda 100644
--- a/packages/flutter/test/widgets/selectable_text_test.dart
+++ b/packages/flutter/test/widgets/selectable_text_test.dart
@@ -5079,11 +5079,11 @@
testWidgets('text selection style 1', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Material(
child: Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SelectableText.rich(
TextSpan(
children: <TextSpan>[
@@ -5131,11 +5131,11 @@
testWidgets('text selection style 2', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Material(
child: Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SelectableText.rich(
TextSpan(
children: <TextSpan>[
diff --git a/packages/flutter/test/widgets/selection_container_test.dart b/packages/flutter/test/widgets/selection_container_test.dart
index c4992bf..22db563 100644
--- a/packages/flutter/test/widgets/selection_container_test.dart
+++ b/packages/flutter/test/widgets/selection_container_test.dart
@@ -25,8 +25,8 @@
SelectionContainer(
registrar: registrar,
delegate: delegate,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr),
@@ -46,9 +46,9 @@
SelectionContainer(
registrar: registrar,
delegate: delegate,
- child: SelectionContainer.disabled(
+ child: const SelectionContainer.disabled(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr),
@@ -69,7 +69,7 @@
SelectionContainer(
registrar: registrar,
delegate: delegate,
- child: Column(
+ child: const Column(
),
),
);
@@ -80,8 +80,8 @@
SelectionContainer(
registrar: registrar,
delegate: delegate,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr),
],
),
@@ -94,7 +94,7 @@
SelectionContainer(
registrar: registrar,
delegate: delegate,
- child: Column(
+ child: const Column(
),
),
);
@@ -111,8 +111,8 @@
registrar: registrar,
child: SelectionContainer(
delegate: delegate,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr),
],
),
diff --git a/packages/flutter/test/widgets/semantics_clipping_test.dart b/packages/flutter/test/widgets/semantics_clipping_test.dart
index 0ad7f74..7355442 100644
--- a/packages/flutter/test/widgets/semantics_clipping_test.dart
+++ b/packages/flutter/test/widgets/semantics_clipping_test.dart
@@ -12,7 +12,7 @@
testWidgets('SemanticNode.rect is clipped', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);
- await tester.pumpWidget(Directionality(
+ await tester.pumpWidget(const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: SizedBox(
@@ -20,7 +20,7 @@
child: Flex(
clipBehavior: Clip.hardEdge,
direction: Axis.horizontal,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
width: 75.0,
child: Text('1'),
@@ -70,7 +70,7 @@
testWidgets('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester);
- await tester.pumpWidget(Directionality(
+ await tester.pumpWidget(const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: SizedBox(
@@ -79,14 +79,14 @@
clipBehavior: Clip.hardEdge,
direction: Axis.horizontal,
children: <Widget>[
- const SizedBox(
+ SizedBox(
width: 75.0,
child: Text('1'),
),
MergeSemantics(
child: Flex(
direction: Axis.horizontal,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
width: 75.0,
child: Text('2'),
diff --git a/packages/flutter/test/widgets/semantics_test.dart b/packages/flutter/test/widgets/semantics_test.dart
index fa84dce..20b08ae 100644
--- a/packages/flutter/test/widgets/semantics_test.dart
+++ b/packages/flutter/test/widgets/semantics_test.dart
@@ -1001,14 +1001,14 @@
},
);
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Column(
children: <Widget>[
- const Text('Label 1'),
- const Text('Label 2'),
+ Text('Label 1'),
+ Text('Label 2'),
Row(
- children: const <Widget>[
+ children: <Widget>[
Text('Label 3'),
Text('Label 4'),
Text('Label 5'),
@@ -1070,8 +1070,8 @@
const Text('Label 2'),
Transform.rotate(
angle: pi / 2.0,
- child: Row(
- children: const <Widget>[
+ child: const Row(
+ children: <Widget>[
Text('Label 3'),
Text('Label 4'),
Text('Label 5'),
@@ -1638,7 +1638,7 @@
// Construct a widget tree that will end up with a fitted box that applies
// a zero transform because it does not actually draw its children.
// Assert that this subtree gets dropped (the root node has no children).
- await tester.pumpWidget(Column(
+ await tester.pumpWidget(const Column(
children: <Widget>[
SizedBox(
height: 0,
diff --git a/packages/flutter/test/widgets/spacer_test.dart b/packages/flutter/test/widgets/spacer_test.dart
index 93810d5..06fbda2 100644
--- a/packages/flutter/test/widgets/spacer_test.dart
+++ b/packages/flutter/test/widgets/spacer_test.dart
@@ -7,8 +7,8 @@
void main() {
testWidgets('Spacer takes up space.', (WidgetTester tester) async {
- await tester.pumpWidget(Column(
- children: const <Widget>[
+ await tester.pumpWidget(const Column(
+ children: <Widget>[
SizedBox(width: 10.0, height: 10.0),
Spacer(),
SizedBox(width: 10.0, height: 10.0),
@@ -24,9 +24,9 @@
const Spacer spacer2 = Spacer();
const Spacer spacer3 = Spacer(flex: 2);
const Spacer spacer4 = Spacer(flex: 4);
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.rtl,
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 10.0, height: 10.0),
spacer1,
SizedBox(width: 10.0, height: 10.0),
@@ -54,10 +54,10 @@
});
testWidgets('Spacer takes up space.', (WidgetTester tester) async {
- await tester.pumpWidget(UnconstrainedBox(
+ await tester.pumpWidget(const UnconstrainedBox(
constrainedAxis: Axis.vertical,
child: Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(width: 20.0, height: 10.0),
Spacer(),
SizedBox(width: 10.0, height: 10.0),
diff --git a/packages/flutter/test/widgets/syncing_test.dart b/packages/flutter/test/widgets/syncing_test.dart
index 5c7f0fc..84745ca 100644
--- a/packages/flutter/test/widgets/syncing_test.dart
+++ b/packages/flutter/test/widgets/syncing_test.dart
@@ -130,7 +130,7 @@
testWidgets('swap instances around', (WidgetTester tester) async {
const Widget a = TestWidget(persistentState: 0x61, syncedState: 0x41, child: Text('apple', textDirection: TextDirection.ltr));
const Widget b = TestWidget(persistentState: 0x62, syncedState: 0x42, child: Text('banana', textDirection: TextDirection.ltr));
- await tester.pumpWidget(Column());
+ await tester.pumpWidget(const Column());
final GlobalKey keyA = GlobalKey();
final GlobalKey keyB = GlobalKey();
diff --git a/packages/flutter/test/widgets/text_golden_test.dart b/packages/flutter/test/widgets/text_golden_test.dart
index 497beb6..fe8661d 100644
--- a/packages/flutter/test/widgets/text_golden_test.dart
+++ b/packages/flutter/test/widgets/text_golden_test.dart
@@ -1331,8 +1331,8 @@
decoration: const BoxDecoration(
color: Color(0xff00ff00),
),
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text('Hello\nLine 2\nLine 3',
textDirection: TextDirection.ltr,
style: TextStyle(height: 5),
diff --git a/packages/flutter/test/widgets/text_test.dart b/packages/flutter/test/widgets/text_test.dart
index 81aca6a..39ca2ac 100644
--- a/packages/flutter/test/widgets/text_test.dart
+++ b/packages/flutter/test/widgets/text_test.dart
@@ -1012,13 +1012,13 @@
testWidgets('textWidthBasis with textAlign still obeys parent alignment', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
- children: const <Widget>[
+ children: <Widget>[
Text(
'LEFT ALIGNED, PARENT',
textAlign: TextAlign.left,
diff --git a/packages/flutter/test/widgets/ticker_mode_test.dart b/packages/flutter/test/widgets/ticker_mode_test.dart
index ab36ed5..aa09b8c 100644
--- a/packages/flutter/test/widgets/ticker_mode_test.dart
+++ b/packages/flutter/test/widgets/ticker_mode_test.dart
@@ -190,8 +190,8 @@
routes: <String, WidgetBuilder>{
'/foo' : (BuildContext context) => const Text('New route'),
},
- home: Row(
- children: const <Widget>[
+ home: const Row(
+ children: <Widget>[
_TickingWidget(),
_MultiTickingWidget(),
Text('Old route'),
diff --git a/packages/flutter/test/widgets/transform_test.dart b/packages/flutter/test/widgets/transform_test.dart
index 5d90169..2165e0a 100644
--- a/packages/flutter/test/widgets/transform_test.dart
+++ b/packages/flutter/test/widgets/transform_test.dart
@@ -808,7 +808,7 @@
),
const ColoredBox(color: Color(0xff00ff00), child: square),
]),
- Row(mainAxisSize: MainAxisSize.min, children: const <Widget>[
+ const Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
ColoredBox(color: Color(0xff0000ff), child: square),
ColoredBox(color: Color(0xffeeff00), child: square),
]),
diff --git a/packages/flutter/test/widgets/widget_inspector_test.dart b/packages/flutter/test/widgets/widget_inspector_test.dart
index 136abf2..6afc88c 100644
--- a/packages/flutter/test/widgets/widget_inspector_test.dart
+++ b/packages/flutter/test/widgets/widget_inspector_test.dart
@@ -4303,11 +4303,11 @@
});
Future<void> pumpWidgetForLayoutExplorer(WidgetTester tester) async {
- final Widget widget = Directionality(
+ const Widget widget = Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
Flexible(
child: ColoredBox(
color: Colors.green,
@@ -4959,9 +4959,9 @@
appBar: AppBar(
title: const Text('Hello World!'),
),
- body: Center(
+ body: const Center(
child: Column(
- children: const <Widget>[
+ children: <Widget>[
Text('Hello World!'),
],
),
diff --git a/packages/flutter/test/widgets/wrap_test.dart b/packages/flutter/test/widgets/wrap_test.dart
index c034ac2..c6e56a5 100644
--- a/packages/flutter/test/widgets/wrap_test.dart
+++ b/packages/flutter/test/widgets/wrap_test.dart
@@ -841,8 +841,8 @@
testWidgets('Object exactly matches container width', (WidgetTester tester) async {
await tester.pumpWidget(
- Column(
- children: const <Widget>[
+ const Column(
+ children: <Widget>[
Wrap(
textDirection: TextDirection.ltr,
spacing: 10.0,
@@ -859,8 +859,8 @@
verify(tester, <Offset>[Offset.zero]);
await tester.pumpWidget(
- Column(
- children: const <Widget>[
+ const Column(
+ children: <Widget>[
Wrap(
textDirection: TextDirection.ltr,
spacing: 10.0,
@@ -893,7 +893,7 @@
testWidgets('Horizontal wrap - IntrinsicsHeight', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/48679.
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: IntrinsicHeight(
@@ -901,13 +901,13 @@
color: Colors.green,
child: Wrap(
children: <Widget>[
- const Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
+ Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
Row(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(height: 40, width: 60),
],
),
- const Text('End', style: TextStyle(height: 1.0, fontSize: 16)),
+ Text('End', style: TextStyle(height: 1.0, fontSize: 16)),
],
),
),
@@ -925,7 +925,7 @@
testWidgets('Vertical wrap - IntrinsicsWidth', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/48679.
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Center(
child: IntrinsicWidth(
@@ -934,13 +934,13 @@
child: Wrap(
direction: Axis.vertical,
children: <Widget>[
- const Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
+ Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
Column(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(height: 40, width: 60),
],
),
- const Text('End', style: TextStyle(height: 1.0, fontSize: 16)),
+ Text('End', style: TextStyle(height: 1.0, fontSize: 16)),
],
),
),
diff --git a/packages/flutter_driver/test/src/real_tests/extension_test.dart b/packages/flutter_driver/test/src/real_tests/extension_test.dart
index 3ad1966..1756738 100644
--- a/packages/flutter_driver/test/src/real_tests/extension_test.dart
+++ b/packages/flutter_driver/test/src/real_tests/extension_test.dart
@@ -649,10 +649,10 @@
}
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Column(
- key: const ValueKey<String>('column'),
- children: const <Widget>[
+ key: ValueKey<String>('column'),
+ children: <Widget>[
Text('Hello1', key: ValueKey<String>('text1')),
Text('Hello2', key: ValueKey<String>('text2')),
Text('Hello3', key: ValueKey<String>('text3')),
@@ -694,10 +694,10 @@
}
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Column(
- key: const ValueKey<String>('column'),
- children: const <Widget>[
+ key: ValueKey<String>('column'),
+ children: <Widget>[
Text('Hello1', key: ValueKey<String>('text1')),
Text('Hello2', key: ValueKey<String>('text2')),
Text('Hello3', key: ValueKey<String>('text3')),
@@ -729,15 +729,15 @@
}
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Center(
child: SizedBox(
- key: const ValueKey<String>('parent'),
+ key: ValueKey<String>('parent'),
height: 100,
width: 100,
child: Center(
child: Row(
- children: const <Widget>[
+ children: <Widget>[
SizedBox(
key: ValueKey<String>('leftchild'),
width: 25,
@@ -1147,9 +1147,9 @@
return result;
}
- final Widget testWidget = MaterialApp(
+ const Widget testWidget = MaterialApp(
home: Material(
- child: Column(children: const<Widget> [
+ child: Column(children: <Widget> [
Text('Hello ', key: Key('widgetOne')),
SizedBox.shrink(
child: Text('World!', key: Key('widgetTwo')),
diff --git a/packages/flutter_test/test/accessibility_test.dart b/packages/flutter_test/test/accessibility_test.dart
index 22fc3f3..29e4051 100644
--- a/packages/flutter_test/test/accessibility_test.dart
+++ b/packages/flutter_test/test/accessibility_test.dart
@@ -27,8 +27,8 @@
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(
_boilerplate(
- Column(
- children: const <Widget>[
+ const Column(
+ children: <Widget>[
Text(
'this is a test',
style: TextStyle(fontSize: 14.0, color: Colors.black),
@@ -52,8 +52,8 @@
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(
_boilerplate(
- Column(
- children: const <Widget>[
+ const Column(
+ children: <Widget>[
Text(
'this is a test',
style: TextStyle(fontSize: 14.0, color: Colors.black),
@@ -107,8 +107,8 @@
width: 200.0,
height: 300.0,
color: Colors.white,
- child: Column(
- children: const <Widget>[
+ child: const Column(
+ children: <Widget>[
Text(
'this is a white text',
style: TextStyle(fontSize: 14.0, color: Colors.white),
diff --git a/packages/flutter_test/test/controller_test.dart b/packages/flutter_test/test/controller_test.dart
index d4b532b..35d4761 100644
--- a/packages/flutter_test/test/controller_test.dart
+++ b/packages/flutter_test/test/controller_test.dart
@@ -727,10 +727,10 @@
testWidgets('throws when there are multiple results from the finder', (WidgetTester tester) async {
await tester.pumpWidget(
- MaterialApp(
+ const MaterialApp(
home: Scaffold(
body: Row(
- children: const <Widget>[
+ children: <Widget>[
Text('hello'),
Text('hello'),
],
diff --git a/packages/flutter_test/test/finders_test.dart b/packages/flutter_test/test/finders_test.dart
index 7ffaf62..82b1141 100644
--- a/packages/flutter_test/test/finders_test.dart
+++ b/packages/flutter_test/test/finders_test.dart
@@ -275,7 +275,7 @@
await tester.pumpWidget(_boilerplate(
Semantics(
container: true,
- child: Row(children: const <Widget>[
+ child: const Row(children: <Widget>[
Text('Hello'),
Text('World'),
]),
@@ -359,14 +359,14 @@
testWidgets('finds multiple subtypes', (WidgetTester tester) async {
await tester.pumpWidget(_boilerplate(
Row(children: <Widget>[
- Column(children: const <Widget>[
+ const Column(children: <Widget>[
Text('Hello'),
Text('World'),
]),
Column(children: <Widget>[
Image(image: FileImage(File('test'))),
]),
- Column(children: const <Widget>[
+ const Column(children: <Widget>[
SimpleGenericWidget<int>(child: Text('one')),
SimpleGenericWidget<double>(child: Text('pi')),
SimpleGenericWidget<String>(child: Text('two')),
diff --git a/packages/flutter_test/test/matchers_test.dart b/packages/flutter_test/test/matchers_test.dart
index 6d79967..7086a8a 100644
--- a/packages/flutter_test/test/matchers_test.dart
+++ b/packages/flutter_test/test/matchers_test.dart
@@ -485,8 +485,8 @@
});
testWidgets('if finder finds multiple widgets', (WidgetTester tester) async {
- await tester.pumpWidget(boilerplate(Column(
- children: const <Widget>[Text('hello'), Text('world')],
+ await tester.pumpWidget(boilerplate(const Column(
+ children: <Widget>[Text('hello'), Text('world')],
)));
final Finder finder = find.byType(Text);
await expectLater(
@@ -1296,8 +1296,8 @@
testWidgets('succeeds when finds more then the specified count',
(WidgetTester tester) async {
- await tester.pumpWidget(boilerplate(Column(
- children: const <Widget>[Text('1'), Text('2'), Text('3')],
+ await tester.pumpWidget(boilerplate(const Column(
+ children: <Widget>[Text('1'), Text('2'), Text('3')],
)));
expect(find.byType(Text), findsAtLeastNWidgets(2));
@@ -1305,8 +1305,8 @@
testWidgets('succeeds when finds the exact specified count',
(WidgetTester tester) async {
- await tester.pumpWidget(boilerplate(Column(
- children: const <Widget>[Text('1'), Text('2')],
+ await tester.pumpWidget(boilerplate(const Column(
+ children: <Widget>[Text('1'), Text('2')],
)));
expect(find.byType(Text), findsAtLeastNWidgets(2));
@@ -1314,8 +1314,8 @@
testWidgets('fails when finds less then specified count',
(WidgetTester tester) async {
- await tester.pumpWidget(boilerplate(Column(
- children: const <Widget>[Text('1'), Text('2')],
+ await tester.pumpWidget(boilerplate(const Column(
+ children: <Widget>[Text('1'), Text('2')],
)));
expect(find.byType(Text), isNot(findsAtLeastNWidgets(3)));
diff --git a/packages/flutter_test/test/widget_tester_test.dart b/packages/flutter_test/test/widget_tester_test.dart
index 713406e..a572da7 100644
--- a/packages/flutter_test/test/widget_tester_test.dart
+++ b/packages/flutter_test/test/widget_tester_test.dart
@@ -216,7 +216,7 @@
group('find.descendant', () {
testWidgets('finds one descendant', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Column(children: fooBarTexts),
@@ -230,7 +230,7 @@
});
testWidgets('finds two descendants with different ancestors', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Column(children: fooBarTexts),
@@ -245,11 +245,11 @@
});
testWidgets('fails with a descriptive message', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
- Column(children: const <Text>[Text('foo', textDirection: TextDirection.ltr)]),
- const Text('bar', textDirection: TextDirection.ltr),
+ Column(children: <Text>[Text('foo', textDirection: TextDirection.ltr)]),
+ Text('bar', textDirection: TextDirection.ltr),
],
));
@@ -275,7 +275,7 @@
group('find.ancestor', () {
testWidgets('finds one ancestor', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Column(children: fooBarTexts),
@@ -290,7 +290,7 @@
testWidgets('finds two matching ancestors, one descendant', (WidgetTester tester) async {
await tester.pumpWidget(
- Directionality(
+ const Directionality(
textDirection: TextDirection.ltr,
child: Row(
children: <Widget>[
@@ -307,11 +307,11 @@
});
testWidgets('fails with a descriptive message', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
- Column(children: const <Text>[Text('foo', textDirection: TextDirection.ltr)]),
- const Text('bar', textDirection: TextDirection.ltr),
+ Column(children: <Text>[Text('foo', textDirection: TextDirection.ltr)]),
+ Text('bar', textDirection: TextDirection.ltr),
],
));
@@ -335,7 +335,7 @@
});
testWidgets('Root not matched by default', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Column(children: fooBarTexts),
@@ -349,7 +349,7 @@
});
testWidgets('Match the root', (WidgetTester tester) async {
- await tester.pumpWidget(Row(
+ await tester.pumpWidget(const Row(
textDirection: TextDirection.ltr,
children: <Widget>[
Column(children: fooBarTexts),
@@ -373,7 +373,7 @@
children: <Widget>[
_deepWidgetTree(
depth: 1000,
- child: Column(children: fooBarTexts),
+ child: const Column(children: fooBarTexts),
),
],
),
diff --git a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart
index 6a4d8ed..ce8433d 100644
--- a/packages/flutter_tools/test/integration.shard/overall_experience_test.dart
+++ b/packages/flutter_tools/test/integration.shard/overall_experience_test.dart
@@ -519,7 +519,7 @@
'A RenderFlex overflowed by 69200 pixels on the right.',
'',
'The relevant error-causing widget was:',
- matches(RegExp(r'^ Row .+flutter/dev/integration_tests/ui/lib/overflow\.dart:32:12$')),
+ matches(RegExp(r'^ Row .+flutter/dev/integration_tests/ui/lib/overflow\.dart:32:18$')),
'',
'To inspect this widget in Flutter DevTools, visit:',
startsWith('http'),