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
This commit is contained in:
Michael Goderbauer 2023-02-02 11:33:57 -08:00 committed by GitHub
parent 3f986e4238
commit b0f1714b7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
107 changed files with 520 additions and 515 deletions

View File

@ -14,15 +14,15 @@ void main() {
appBar: AppBar( appBar: AppBar(
title: const Text('RenderFlex OverFlow'), title: const Text('RenderFlex OverFlow'),
), ),
body: SizedBox( body: const SizedBox(
width: 400.0, width: 400.0,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
const Icon(Icons.message), Icon(Icons.message),
Column( Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[ children: <Widget>[
Text('Title'), Text('Title'),
Text( Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed ' 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed '

View File

@ -279,11 +279,11 @@ class IconBar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.only(left: 16.0, right: 16.0), padding: EdgeInsets.only(left: 16.0, right: 16.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[ children: <Widget>[
IconWithText(Icons.thumb_up, 'Like'), IconWithText(Icons.thumb_up, 'Like'),
IconWithText(Icons.comment, 'Comment'), IconWithText(Icons.comment, 'Comment'),
IconWithText(Icons.share, 'Share'), IconWithText(Icons.share, 'Share'),
@ -578,9 +578,9 @@ class BottomBar extends StatelessWidget {
), ),
), ),
), ),
child: Row( child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[ children: <Widget>[
BottomBarButton(Icons.new_releases, 'News'), BottomBarButton(Icons.new_releases, 'News'),
BottomBarButton(Icons.people, 'Requests'), BottomBarButton(Icons.people, 'Requests'),
BottomBarButton(Icons.chat, 'Messenger'), BottomBarButton(Icons.chat, 'Messenger'),

View File

@ -12,10 +12,10 @@ class CubicBezierPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return const Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Bezier(Colors.amber, 1.0), Bezier(Colors.amber, 1.0),
], ],
), ),

View File

@ -88,9 +88,9 @@ class StackSizePage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return const Material(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 200, width: 200,
height: 100, height: 100,

View File

@ -9,10 +9,10 @@ class TextPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return const Material(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 200, width: 200,
height: 100, height: 100,

View File

@ -20,10 +20,10 @@ class BenchSimpleLazyTextScroll extends WidgetRecorder {
@override @override
Widget createWidget() { Widget createWidget() {
return Directionality( return const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Flexible( Flexible(
child: _TestScrollingWidget( child: _TestScrollingWidget(
initialScrollOffset: 0, initialScrollOffset: 0,

View File

@ -28,8 +28,8 @@ Future<void> main() async {
Icon(Icons.ac_unit), Icon(Icons.ac_unit),
], ],
), ),
body: Column( body: const Column(
children: const <Widget>[ children: <Widget>[
Text('Item 1'), Text('Item 1'),
Text('Item 2'), Text('Item 2'),
Text('Item 3'), Text('Item 3'),

View File

@ -345,8 +345,8 @@ class _CreateCompanySheet extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return const Column(
children: const <Widget>[ children: <Widget>[
TextField( TextField(
autofocus: true, autofocus: true,
decoration: InputDecoration( decoration: InputDecoration(

View File

@ -59,9 +59,9 @@ class SecondPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return const Scaffold(
body: Column( body: Column(
children: const <Widget>[ children: <Widget>[
Expanded( Expanded(
child: AndroidView(viewType: 'simple') child: AndroidView(viewType: 'simple')
), ),

View File

@ -57,8 +57,8 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
), ),
Semantics( Semantics(
container: true, container: true,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
CupertinoSwitch( CupertinoSwitch(
value: true, value: true,
onChanged: null, onChanged: null,
@ -71,8 +71,8 @@ class _CupertinoSwitchDemoState extends State<CupertinoSwitchDemo> {
), ),
Semantics( Semantics(
container: true, container: true,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
CupertinoSwitch( CupertinoSwitch(
value: false, value: false,
onChanged: null, onChanged: null,

View File

@ -402,9 +402,9 @@ class _DemoDrawer extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Drawer( return const Drawer(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
ListTile( ListTile(
leading: Icon(Icons.search), leading: Icon(Icons.search),
title: Text('Search'), title: Text('Search'),

View File

@ -70,13 +70,13 @@ class _SearchDemoState extends State<SearchDemo> {
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
MergeSemantics( const MergeSemantics(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Text('Press the '), Text('Press the '),
Tooltip( Tooltip(
message: 'search', message: 'search',
@ -88,7 +88,7 @@ class _SearchDemoState extends State<SearchDemo> {
Text(' icon in the AppBar'), 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.'),
], ],
), ),
), ),

View File

@ -126,9 +126,9 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
), ),
], ],
), ),
Row( const Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
// Disabled checkboxes // Disabled checkboxes
Checkbox(value: true, onChanged: null), Checkbox(value: true, onChanged: null),
Checkbox(value: false, onChanged: null), Checkbox(value: false, onChanged: null),
@ -167,9 +167,9 @@ class _SelectionControlsDemoState extends State<SelectionControlsDemo> {
], ],
), ),
// Disabled radio buttons // Disabled radio buttons
Row( const Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
Radio<int>( Radio<int>(
value: 0, value: 0,
groupValue: 0, groupValue: 0,

View File

@ -296,9 +296,9 @@ class _SlidersState extends State<_Sliders> {
const Text('Continuous with Editable Numerical Value'), const Text('Continuous with Editable Numerical Value'),
], ],
), ),
Column( const Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
Slider.adaptive(value: 0.25, onChanged: null), Slider.adaptive(value: 0.25, onChanged: null),
Text('Disabled'), Text('Disabled'),
], ],

View File

@ -93,10 +93,10 @@ class _TransformationsDemoState extends State<TransformationsDemo> {
Widget get instructionDialog { Widget get instructionDialog {
return AlertDialog( return AlertDialog(
title: const Text('2D Transformations'), title: const Text('2D Transformations'),
content: Column( content: const Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
Text('Tap to edit hex tiles, and use gestures to move around the scene:\n'), Text('Tap to edit hex tiles, and use gestures to move around the scene:\n'),
Text('- Drag to pan.'), Text('- Drag to pan.'),
Text('- Pinch to zoom.'), Text('- Pinch to zoom.'),

View File

@ -29,7 +29,7 @@ class _TestState extends State<Test> {
if (!_triggered) { if (!_triggered) {
return const SizedBox.shrink(); 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), SizedBox(width: 10000.0),
SizedBox(width: 10000.0), SizedBox(width: 10000.0),

View File

@ -5,10 +5,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
Future<void> main() async { Future<void> main() async {
runApp(Scaffold( runApp(const Scaffold(
body: Center( body: Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Icon(Icons.ac_unit), Icon(Icons.ac_unit),
Text('Hello, World', textDirection: TextDirection.ltr), Text('Hello, World', textDirection: TextDirection.ltr),
], ],

View File

@ -432,25 +432,25 @@ class _FocusDemoState extends State<FocusDemo> {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'One'), DemoButton(name: 'One'),
DemoButton(name: 'Two'), DemoButton(name: 'Two'),
DemoButton(name: 'Three'), DemoButton(name: 'Three'),
], ],
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Four'), DemoButton(name: 'Four'),
DemoButton(name: 'Five'), DemoButton(name: 'Five'),
DemoButton(name: 'Six'), DemoButton(name: 'Six'),
], ],
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Seven'), DemoButton(name: 'Seven'),
DemoButton(name: 'Eight'), DemoButton(name: 'Eight'),
DemoButton(name: 'Nine'), DemoButton(name: 'Nine'),

View File

@ -270,9 +270,9 @@ class DragAndDropAppState extends State<DragAndDropApp> {
], ],
), ),
), ),
Expanded( const Expanded(
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Expanded(child: ExampleDragTarget()), Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()), Expanded(child: ExampleDragTarget()),
Expanded(child: ExampleDragTarget()), Expanded(child: ExampleDragTarget()),

View File

@ -152,18 +152,18 @@ class _FocusDemoState extends State<FocusDemo> {
return Column( return Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton( DemoButton(
name: 'One', name: 'One',
autofocus: true, autofocus: true,
), ),
], ],
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Two'), DemoButton(name: 'Two'),
DemoButton( DemoButton(
name: 'Three', name: 'Three',
@ -171,9 +171,9 @@ class _FocusDemoState extends State<FocusDemo> {
), ),
], ],
), ),
Row( const Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Four'), DemoButton(name: 'Four'),
DemoButton(name: 'Five'), DemoButton(name: 'Five'),
DemoButton(name: 'Six'), DemoButton(name: 'Six'),

View File

@ -65,8 +65,8 @@ class TestRootState extends State<TestRoot> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return _showRow return _showRow
? Row( ? const Row(
children: const <Widget>[ children: <Widget>[
TestChildWidget(), TestChildWidget(),
TestChildWidget(), TestChildWidget(),
], ],

View File

@ -25,8 +25,8 @@ class CupertinoIndicatorExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CupertinoPageScaffold( return const CupertinoPageScaffold(
navigationBar: const CupertinoNavigationBar( navigationBar: CupertinoNavigationBar(
middle: Text('CupertinoActivityIndicator Sample'), middle: Text('CupertinoActivityIndicator Sample'),
), ),
child: Center( child: Center(
@ -35,7 +35,7 @@ class CupertinoIndicatorExample extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Cupertino activity indicator with default properties. // Cupertino activity indicator with default properties.
CupertinoActivityIndicator(), CupertinoActivityIndicator(),
SizedBox(height: 10), SizedBox(height: 10),
@ -44,7 +44,7 @@ class CupertinoIndicatorExample extends StatelessWidget {
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Cupertino activity indicator with custom radius and color. // Cupertino activity indicator with custom radius and color.
CupertinoActivityIndicator(radius: 20.0, color: CupertinoColors.activeBlue), CupertinoActivityIndicator(radius: 20.0, color: CupertinoColors.activeBlue),
SizedBox(height: 10), SizedBox(height: 10),
@ -56,7 +56,7 @@ class CupertinoIndicatorExample extends StatelessWidget {
), ),
Column( Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Cupertino activity indicator with custom radius and disabled // Cupertino activity indicator with custom radius and disabled
// animation. // animation.
CupertinoActivityIndicator(radius: 20.0, animating: false), CupertinoActivityIndicator(radius: 20.0, animating: false),

View File

@ -56,33 +56,33 @@ class _CupertinoFormRowExampleState extends State<CupertinoFormRowExample> {
}, },
), ),
), ),
CupertinoFormRow( const CupertinoFormRow(
prefix: const PrefixWidget( prefix: PrefixWidget(
icon: CupertinoIcons.wifi, icon: CupertinoIcons.wifi,
title: 'Wi-Fi', title: 'Wi-Fi',
color: CupertinoColors.systemBlue, color: CupertinoColors.systemBlue,
), ),
error: const Text('Home network unavailable'), error: Text('Home network unavailable'),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: const <Widget>[ children: <Widget>[
Text('Not connected'), Text('Not connected'),
SizedBox(width: 5), SizedBox(width: 5),
Icon(CupertinoIcons.forward) Icon(CupertinoIcons.forward)
], ],
), ),
), ),
CupertinoFormRow( const CupertinoFormRow(
prefix: const PrefixWidget( prefix: PrefixWidget(
icon: CupertinoIcons.bluetooth, icon: CupertinoIcons.bluetooth,
title: 'Bluetooth', title: 'Bluetooth',
color: CupertinoColors.activeBlue, color: CupertinoColors.activeBlue,
), ),
helper: Padding( helper: Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0), padding: EdgeInsets.symmetric(vertical: 4.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[ children: <Widget>[
Text('Headphone'), Text('Headphone'),
Text('Connected'), Text('Connected'),
], ],
@ -90,7 +90,7 @@ class _CupertinoFormRowExampleState extends State<CupertinoFormRowExample> {
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: const <Widget>[ children: <Widget>[
Text('On'), Text('On'),
SizedBox(width: 5), SizedBox(width: 5),
Icon(CupertinoIcons.forward) Icon(CupertinoIcons.forward)

View File

@ -86,10 +86,10 @@ class NextPage extends StatelessWidget {
// when the CupertinoSliverNavigationBar is fully expanded. // when the CupertinoSliverNavigationBar is fully expanded.
largeTitle: const Text('Family'), largeTitle: const Text('Family'),
), ),
SliverFillRemaining( const SliverFillRemaining(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const <Widget>[ children: <Widget>[
Text('Drag me up', textAlign: TextAlign.center), Text('Drag me up', textAlign: TextAlign.center),
// When the "leading" parameter is omitted on a route that has a previous page, // When the "leading" parameter is omitted on a route that has a previous page,
// the back button is automatically added to the leading position. // the back button is automatically added to the leading position.

View File

@ -30,10 +30,10 @@ class ButtonTypesExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Spacer(), Spacer(),
ButtonTypesGroup(enabled: true), ButtonTypesGroup(enabled: true),
ButtonTypesGroup(enabled: false), ButtonTypesGroup(enabled: false),

View File

@ -17,8 +17,8 @@ class CardExamplesApp extends StatelessWidget {
theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true),
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text('Card Examples')), appBar: AppBar(title: const Text('Card Examples')),
body: Column( body: const Column(
children: const <Widget>[ children: <Widget>[
Spacer(), Spacer(),
ElevatedCardExample(), ElevatedCardExample(),
FilledCardExample(), FilledCardExample(),

View File

@ -28,11 +28,11 @@ class DividerExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return const Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: EdgeInsets.all(16.0),
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Card( child: Card(
child: SizedBox.expand(), child: SizedBox.expand(),

View File

@ -28,11 +28,11 @@ class DividerExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return const Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(16.0), padding: EdgeInsets.all(16.0),
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Card( child: Card(
child: SizedBox.expand(), child: SizedBox.expand(),

View File

@ -30,10 +30,10 @@ class ButtonTypesExample extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.all(4.0), padding: EdgeInsets.all(4.0),
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Spacer(), Spacer(),
ButtonTypesGroup(enabled: true), ButtonTypesGroup(enabled: true),
ButtonTypesGroup(enabled: false), ButtonTypesGroup(enabled: false),

View File

@ -38,15 +38,15 @@ class DemoIconToggleButtons extends StatefulWidget {
class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> { class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
// Standard IconButton // Standard IconButton
children: const <Widget>[ children: <Widget>[
DemoIconToggleButton(isEnabled: true), DemoIconToggleButton(isEnabled: true),
SizedBox(width: 10), SizedBox(width: 10),
DemoIconToggleButton(isEnabled: false), DemoIconToggleButton(isEnabled: false),
@ -54,7 +54,7 @@ class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Filled IconButton // Filled IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledButtonStyle,), DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledButtonStyle,),
SizedBox(width: 10), SizedBox(width: 10),
@ -63,7 +63,7 @@ class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Filled Tonal IconButton // Filled Tonal IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledTonalButtonStyle,), DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledFilledTonalButtonStyle,),
SizedBox(width: 10), SizedBox(width: 10),
@ -72,7 +72,7 @@ class _DemoIconToggleButtonsState extends State<DemoIconToggleButtons> {
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
// Outlined IconButton // Outlined IconButton
DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledOutlinedButtonStyle,), DemoIconToggleButton(isEnabled: true, getDefaultStyle: enabledOutlinedButtonStyle,),
SizedBox(width: 10), SizedBox(width: 10),

View File

@ -30,11 +30,11 @@ class MyStatelessWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
TextField( TextField(
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Normal Icon Constraints', hintText: 'Normal Icon Constraints',

View File

@ -30,11 +30,11 @@ class MyStatelessWidget extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return const Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0), padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
TextField( TextField(
decoration: InputDecoration( decoration: InputDecoration(
hintText: 'Normal Icon Constraints', hintText: 'Normal Icon Constraints',

View File

@ -17,11 +17,11 @@ class SegmentedButtonApp extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
theme: ThemeData(useMaterial3: true), theme: ThemeData(useMaterial3: true),
home: Scaffold( home: const Scaffold(
body: Center( body: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Spacer(), Spacer(),
Text('Single choice'), Text('Single choice'),
SingleChoice(), SingleChoice(),

View File

@ -21,10 +21,10 @@ class MyApp extends StatelessWidget {
home: SelectionArea( home: SelectionArea(
child: Scaffold( child: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text(_title)),
body: Center( body: const Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Text('Select this icon', style: TextStyle(fontSize: 30)), Text('Select this icon', style: TextStyle(fontSize: 30)),
SizedBox(height: 10), SizedBox(height: 10),
MySelectableAdapter(child: Icon(Icons.key, size: 30)), MySelectableAdapter(child: Icon(Icons.key, size: 30)),

View File

@ -20,10 +20,10 @@ class MyApp extends StatelessWidget {
home: SelectionArea( home: SelectionArea(
child: Scaffold( child: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text(_title)),
body: Center( body: const Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Text('Row 1'), Text('Row 1'),
Text('Row 2'), Text('Row 2'),
Text('Row 3'), Text('Row 3'),

View File

@ -21,11 +21,11 @@ class MyApp extends StatelessWidget {
home: SelectionArea( home: SelectionArea(
child: Scaffold( child: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text(_title)),
body: Center( body: const Center(
child: SelectionAllOrNoneContainer( child: SelectionAllOrNoneContainer(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Text('Row 1'), Text('Row 1'),
Text('Row 2'), Text('Row 2'),
Text('Row 3'), Text('Row 3'),

View File

@ -19,11 +19,11 @@ class MyApp extends StatelessWidget {
title: _title, title: _title,
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text(_title)), appBar: AppBar(title: const Text(_title)),
body: Center( body: const Center(
child: SelectionArea( child: SelectionArea(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Text('Selectable text'), Text('Selectable text'),
SelectionContainer.disabled(child: Text('Non-selectable text')), SelectionContainer.disabled(child: Text('Non-selectable text')),
Text('Selectable text'), Text('Selectable text'),

View File

@ -17,8 +17,8 @@ class TextFieldExamplesApp extends StatelessWidget {
theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true), theme: ThemeData(colorSchemeSeed: const Color(0xff6750a4), useMaterial3: true),
home: Scaffold( home: Scaffold(
appBar: AppBar(title: const Text('TextField Examples')), appBar: AppBar(title: const Text('TextField Examples')),
body: Column( body: const Column(
children: const <Widget>[ children: <Widget>[
Spacer(), Spacer(),
FilledTextFieldExample(), FilledTextFieldExample(),
OutlinedTextFieldExample(), OutlinedTextFieldExample(),

View File

@ -64,14 +64,14 @@ class VerificationCodeGenerator extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Actions( return Actions(
actions: <Type, Action<Intent>> { CopyTextIntent: CallbackAction<CopyTextIntent>(onInvoke: _copy) }, actions: <Type, Action<Intent>> { CopyTextIntent: CallbackAction<CopyTextIntent>(onInvoke: _copy) },
child: Column( child: const Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
const Text('Press Ctrl-C to Copy'), Text('Press Ctrl-C to Copy'),
const SizedBox(height: 10), SizedBox(height: 10),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
CopyableText(text: '111'), CopyableText(text: '111'),
SizedBox(width: 5,), SizedBox(width: 5,),
CopyableText(text: '222'), CopyableText(text: '222'),

View File

@ -64,25 +64,25 @@ class MyStatelessWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return FocusTraversalGroup( return FocusTraversalGroup(
policy: OrderedTraversalPolicy(), policy: OrderedTraversalPolicy(),
child: Column( child: const Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Six', order: 6), DemoButton(name: 'Six', order: 6),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Five', order: 5), DemoButton(name: 'Five', order: 5),
DemoButton(name: 'Four', order: 4), DemoButton(name: 'Four', order: 4),
], ],
), ),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
DemoButton(name: 'Three', order: 3), DemoButton(name: 'Three', order: 3),
DemoButton(name: 'Two', order: 2), DemoButton(name: 'Two', order: 2),
DemoButton(name: 'One', order: 1, autofocus: true), DemoButton(name: 'One', order: 1, autofocus: true),

View File

@ -90,9 +90,9 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SpinModel( return SpinModel(
notifier: _controller, notifier: _controller,
child: Row( child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: const <Widget>[ children: <Widget>[
Spinner(), Spinner(),
Spinner(), Spinner(),
Spinner(), Spinner(),

View File

@ -61,8 +61,8 @@ class _OverlayExampleState extends State<OverlayExample> {
Builder(builder: (BuildContext context) { Builder(builder: (BuildContext context) {
switch (currentPageIndex) { switch (currentPageIndex) {
case 0: case 0:
return Column( return const Column(
children: const <Widget>[ children: <Widget>[
Text( Text(
'Explore page', 'Explore page',
style: TextStyle( style: TextStyle(
@ -76,8 +76,8 @@ class _OverlayExampleState extends State<OverlayExample> {
], ],
); );
case 1: case 1:
return Column( return const Column(
children: const <Widget>[ children: <Widget>[
Text( Text(
'Commute page', 'Commute page',
style: TextStyle( style: TextStyle(
@ -91,8 +91,8 @@ class _OverlayExampleState extends State<OverlayExample> {
], ],
); );
case 2: case 2:
return Column( return const Column(
children: const <Widget>[ children: <Widget>[
Text( Text(
'Saved page', 'Saved page',
style: TextStyle( style: TextStyle(

View File

@ -56,10 +56,10 @@ class _MyStatefulWidgetState extends State<MyStatefulWidget> {
}, },
), ),
}, },
child: Focus( child: const Focus(
autofocus: true, autofocus: true,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('Press question mark for help'), Text('Press question mark for help'),
], ],
), ),

View File

@ -152,9 +152,9 @@ class ListenableBuilderExample extends StatelessWidget {
// The container background will change color to this when // The container background will change color to this when
// the subtree has focus. // the subtree has focus.
focusedColor: Colors.blue.shade50, focusedColor: Colors.blue.shade50,
child: Column( child: const Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[ children: <Widget>[
Text('Owner:'), Text('Owner:'),
MyField(label: 'First Name'), MyField(label: 'First Name'),
MyField(label: 'Last Name'), MyField(label: 'Last Name'),

View File

@ -6,13 +6,13 @@ import 'package:flutter/material.dart';
void main() { void main() {
runApp( runApp(
DecoratedBox( const DecoratedBox(
decoration: const BoxDecoration(color: Colors.white), decoration: BoxDecoration(color: Colors.white),
child: Center( child: Center(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: const <Widget>[ children: <Widget>[
FlutterLogo(size: 48), FlutterLogo(size: 48),
Padding( Padding(
padding: EdgeInsets.all(32), padding: EdgeInsets.all(32),

View File

@ -30,9 +30,9 @@ import 'package:flutter/widgets.dart';
/// ![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) /// ![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 /// ```dart
/// Row( /// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround, /// mainAxisAlignment: MainAxisAlignment.spaceAround,
/// children: const <Widget>[ /// children: <Widget>[
/// Icon( /// Icon(
/// CupertinoIcons.heart_fill, /// CupertinoIcons.heart_fill,
/// color: Colors.pink, /// color: Colors.pink,

View File

@ -233,7 +233,7 @@ class ButtonBar extends StatelessWidget {
class _ButtonBarRow extends Flex { class _ButtonBarRow extends Flex {
/// Creates a button bar that attempts to display in a row, but displays in /// Creates a button bar that attempts to display in a row, but displays in
/// a column if there is insufficient horizontal space. /// a column if there is insufficient horizontal space.
_ButtonBarRow({ const _ButtonBarRow({
required super.children, required super.children,
super.mainAxisSize, super.mainAxisSize,
super.mainAxisAlignment, super.mainAxisAlignment,

View File

@ -119,9 +119,9 @@ class PlatformAdaptiveIcons implements Icons {
/// ![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) /// ![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 /// ```dart
/// Row( /// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround, /// mainAxisAlignment: MainAxisAlignment.spaceAround,
/// children: const <Widget>[ /// children: <Widget>[
/// Icon( /// Icon(
/// Icons.favorite, /// Icons.favorite,
/// color: Colors.pink, /// color: Colors.pink,

View File

@ -160,8 +160,8 @@ enum ListTileControlAffinity {
/// whereas a [Row] does not constrain its children. /// whereas a [Row] does not constrain its children.
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// children: const <Widget>[ /// children: <Widget>[
/// Expanded( /// Expanded(
/// child: ListTile( /// child: ListTile(
/// leading: FlutterLogo(), /// leading: FlutterLogo(),

View File

@ -275,7 +275,7 @@ class _TabLabelBarRenderer extends RenderFlex {
// upon layout. The tab widths are only used at paint time (see _IndicatorPainter) // upon layout. The tab widths are only used at paint time (see _IndicatorPainter)
// or in response to input. // or in response to input.
class _TabLabelBar extends Flex { class _TabLabelBar extends Flex {
_TabLabelBar({ const _TabLabelBar({
super.children, super.children,
required this.onPerformLayout, required this.onPerformLayout,
}) : super( }) : super(

View File

@ -4445,9 +4445,7 @@ class Flex extends MultiChildRenderObjectWidget {
/// to be necessary to decide which direction to lay the children in or to /// 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 /// disambiguate `start` or `end` values for the main or cross axis
/// directions, the [textDirection] must not be null. /// directions, the [textDirection] must not be null.
// TODO(goderbauer): Figure out whether this can be const. const Flex({
// ignore: prefer_const_constructors_in_immutables
Flex({
super.key, super.key,
required this.direction, required this.direction,
this.mainAxisAlignment = MainAxisAlignment.start, this.mainAxisAlignment = MainAxisAlignment.start,
@ -4458,7 +4456,8 @@ class Flex extends MultiChildRenderObjectWidget {
this.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be this.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be
this.clipBehavior = Clip.none, this.clipBehavior = Clip.none,
super.children, 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. /// The direction to use as the main axis.
/// ///
@ -4649,8 +4648,8 @@ class Flex extends MultiChildRenderObjectWidget {
/// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/row.png) /// ![](https://flutter.github.io/assets-for-api-docs/assets/widgets/row.png)
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// children: const <Widget>[ /// children: <Widget>[
/// Expanded( /// Expanded(
/// child: Text('Deliver features faster', textAlign: TextAlign.center), /// child: Text('Deliver features faster', textAlign: TextAlign.center),
/// ), /// ),
@ -4684,8 +4683,8 @@ class Flex extends MultiChildRenderObjectWidget {
/// Suppose, for instance, that you had this code: /// Suppose, for instance, that you had this code:
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// children: const <Widget>[ /// children: <Widget>[
/// FlutterLogo(), /// 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."), /// 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), /// Icon(Icons.sentiment_very_satisfied),
@ -4711,8 +4710,8 @@ class Flex extends MultiChildRenderObjectWidget {
/// row that the child should be given the remaining room: /// row that the child should be given the remaining room:
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// children: const <Widget>[ /// children: <Widget>[
/// FlutterLogo(), /// FlutterLogo(),
/// Expanded( /// 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."), /// 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 @@ class Flex extends MultiChildRenderObjectWidget {
/// [TextDirection.rtl]. This is shown in the example below /// [TextDirection.rtl]. This is shown in the example below
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// textDirection: TextDirection.rtl, /// textDirection: TextDirection.rtl,
/// children: const <Widget>[ /// children: <Widget>[
/// FlutterLogo(), /// FlutterLogo(),
/// Expanded( /// 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."), /// 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 @@ class Row extends Flex {
/// unless the row has no children or only one child) or to disambiguate /// unless the row has no children or only one child) or to disambiguate
/// `start` or `end` values for the [mainAxisAlignment], the [textDirection] /// `start` or `end` values for the [mainAxisAlignment], the [textDirection]
/// must not be null. /// must not be null.
Row({ const Row({
super.key, super.key,
super.mainAxisAlignment, super.mainAxisAlignment,
super.mainAxisSize, super.mainAxisSize,
@ -4851,8 +4850,8 @@ class Row extends Flex {
/// ![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) /// ![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 /// ```dart
/// Column( /// const Column(
/// children: const <Widget>[ /// children: <Widget>[
/// Text('Deliver features faster'), /// Text('Deliver features faster'),
/// Text('Craft beautiful UIs'), /// Text('Craft beautiful UIs'),
/// Expanded( /// Expanded(
@ -5007,7 +5006,7 @@ class Column extends Flex {
/// any. If there is no ambient directionality, and a text direction is going /// any. If there is no ambient directionality, and a text direction is going
/// to be necessary to disambiguate `start` or `end` values for the /// to be necessary to disambiguate `start` or `end` values for the
/// [crossAxisAlignment], the [textDirection] must not be null. /// [crossAxisAlignment], the [textDirection] must not be null.
Column({ const Column({
super.key, super.key,
super.mainAxisAlignment, super.mainAxisAlignment,
super.mainAxisSize, super.mainAxisSize,

View File

@ -37,15 +37,15 @@ import 'text_editing_intents.dart';
/// // If using WidgetsApp or its descendents MaterialApp or CupertinoApp, /// // If using WidgetsApp or its descendents MaterialApp or CupertinoApp,
/// // then DefaultTextEditingShortcuts is already being inserted into the /// // then DefaultTextEditingShortcuts is already being inserted into the
/// // widget tree. /// // widget tree.
/// return DefaultTextEditingShortcuts( /// return const DefaultTextEditingShortcuts(
/// child: Center( /// child: Center(
/// child: Shortcuts( /// child: Shortcuts(
/// shortcuts: const <ShortcutActivator, Intent>{ /// shortcuts: <ShortcutActivator, Intent>{
/// SingleActivator(LogicalKeyboardKey.arrowDown, alt: true): NextFocusIntent(), /// SingleActivator(LogicalKeyboardKey.arrowDown, alt: true): NextFocusIntent(),
/// SingleActivator(LogicalKeyboardKey.arrowUp, alt: true): PreviousFocusIntent(), /// SingleActivator(LogicalKeyboardKey.arrowUp, alt: true): PreviousFocusIntent(),
/// }, /// },
/// child: Column( /// child: Column(
/// children: const <Widget>[ /// children: <Widget>[
/// TextField( /// TextField(
/// decoration: InputDecoration( /// decoration: InputDecoration(
/// hintText: 'alt + down moves to the next field.', /// hintText: 'alt + down moves to the next field.',

View File

@ -36,9 +36,9 @@ import 'icon_theme_data.dart';
/// ![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) /// ![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 /// ```dart
/// Row( /// const Row(
/// mainAxisAlignment: MainAxisAlignment.spaceAround, /// mainAxisAlignment: MainAxisAlignment.spaceAround,
/// children: const <Widget>[ /// children: <Widget>[
/// Icon( /// Icon(
/// Icons.favorite, /// Icons.favorite,
/// color: Colors.pink, /// color: Colors.pink,

View File

@ -18,8 +18,8 @@ import 'framework.dart';
/// {@tool snippet} /// {@tool snippet}
/// ///
/// ```dart /// ```dart
/// Row( /// const Row(
/// children: const <Widget>[ /// children: <Widget>[
/// Text('Begin'), /// Text('Begin'),
/// Spacer(), // Defaults to a flex of one. /// Spacer(), // Defaults to a flex of one.
/// Text('Middle'), /// Text('Middle'),

View File

@ -1702,9 +1702,9 @@ void main() {
testWidgets('copy paste', (WidgetTester tester) async { testWidgets('copy paste', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
CupertinoApp( const CupertinoApp(
home: Column( home: Column(
children: const <Widget>[ children: <Widget>[
CupertinoTextField( CupertinoTextField(
placeholder: 'field 1', placeholder: 'field 1',
), ),

View File

@ -701,7 +701,7 @@ void main() {
appBar: AppBar( appBar: AppBar(
title: const Text('X'), 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.
), ),
), ),
); );

View File

@ -253,9 +253,9 @@ Widget _withTheme(BottomAppBarTheme theme, [bool useMaterial3 = false]) {
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: RepaintBoundary( bottomNavigationBar: RepaintBoundary(
key: _painterKey, key: _painterKey,
child: BottomAppBar( child: const BottomAppBar(
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Icon(Icons.add), Icon(Icons.add),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Icon(Icons.add), Icon(Icons.add),

View File

@ -82,13 +82,13 @@ void main() {
debugResetSemanticsIdCounter(); debugResetSemanticsIdCounter();
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Material( child: Material(
child: Center( child: Center(
child: Card( child: Card(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('First child'), Text('First child'),
Text('Second child'), Text('Second child'),
], ],

View File

@ -579,8 +579,8 @@ void main() {
const TextStyle style = TextStyle(fontFamily: 'Ahem', fontSize: 10.0); const TextStyle style = TextStyle(fontFamily: 'Ahem', fontSize: 10.0);
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Row( child: const Row(
children: const <Widget>[ children: <Widget>[
Chip(label: Text('Test'), labelStyle: style), Chip(label: Text('Test'), labelStyle: style),
], ],
), ),
@ -590,8 +590,8 @@ void main() {
expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0)); expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0));
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Row( child: const Row(
children: const <Widget>[ children: <Widget>[
Flexible(child: Chip(label: Text('Test'), labelStyle: style)), Flexible(child: Chip(label: Text('Test'), labelStyle: style)),
], ],
), ),
@ -601,8 +601,8 @@ void main() {
expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0)); expect(tester.getSize(find.byType(Chip)), const Size(64.0, 48.0));
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Row( child: const Row(
children: const <Widget>[ children: <Widget>[
Expanded(child: Chip(label: Text('Test'), labelStyle: style)), Expanded(child: Chip(label: Text('Test'), labelStyle: style)),
], ],
), ),
@ -615,8 +615,8 @@ void main() {
testWidgets('Chip responds to materialTapTargetSize', (WidgetTester tester) async { testWidgets('Chip responds to materialTapTargetSize', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Chip( Chip(
label: Text('X'), label: Text('X'),
materialTapTargetSize: MaterialTapTargetSize.padded, materialTapTargetSize: MaterialTapTargetSize.padded,
@ -731,8 +731,8 @@ void main() {
testWidgets('Chip responds to textScaleFactor', (WidgetTester tester) async { testWidgets('Chip responds to textScaleFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Chip( Chip(
avatar: CircleAvatar(child: Text('A')), avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A'), label: Text('Chip A'),
@ -762,8 +762,8 @@ void main() {
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
textScaleFactor: 3.0, textScaleFactor: 3.0,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Chip( Chip(
avatar: CircleAvatar(child: Text('A')), avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A'), label: Text('Chip A'),
@ -789,8 +789,8 @@ void main() {
// Check that individual text scales are taken into account. // Check that individual text scales are taken into account.
await tester.pumpWidget( await tester.pumpWidget(
wrapForChip( wrapForChip(
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Chip( Chip(
avatar: CircleAvatar(child: Text('A')), avatar: CircleAvatar(child: Text('A')),
label: Text('Chip A', textScaleFactor: 3.0), label: Text('Chip A', textScaleFactor: 3.0),

View File

@ -128,12 +128,12 @@ void main() {
testWidgets('Vertical Divider Test 2', (WidgetTester tester) async { testWidgets('Vertical Divider Test 2', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Material( home: Material(
child: SizedBox( child: SizedBox(
height: 24.0, height: 24.0,
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Text('Hey.'), Text('Hey.'),
VerticalDivider(), VerticalDivider(),
], ],

View File

@ -238,10 +238,10 @@ void main() {
platform: TargetPlatform.iOS, platform: TargetPlatform.iOS,
dividerColor: dividerColor, dividerColor: dividerColor,
), ),
home: Material( home: const Material(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
ExpansionTile( ExpansionTile(
title: Text('Tile 1'), title: Text('Tile 1'),
maintainState: true, maintainState: true,

View File

@ -317,8 +317,8 @@ void main() {
appBar: AppBar(), appBar: AppBar(),
floatingActionButton: FloatingActionButton(onPressed: () { }, mini: true), floatingActionButton: FloatingActionButton(onPressed: () { }, mini: true),
floatingActionButtonLocation: FloatingActionButtonLocation.miniStartTop, floatingActionButtonLocation: FloatingActionButtonLocation.miniStartTop,
body: Column( body: const Column(
children: const <Widget>[ children: <Widget>[
ListTile( ListTile(
leading: CircleAvatar(), leading: CircleAvatar(),
), ),

View File

@ -5935,12 +5935,12 @@ void main() {
testWidgets('min intrinsic height for TextField with no content padding', (WidgetTester tester) async { testWidgets('min intrinsic height for TextField with no content padding', (WidgetTester tester) async {
// Regression test for: https://github.com/flutter/flutter/issues/75509 // Regression test for: https://github.com/flutter/flutter/issues/75509
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(const MaterialApp(
home: Material( home: Material(
child: Center( child: Center(
child: IntrinsicHeight( child: IntrinsicHeight(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
TextField( TextField(
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'Label Text', labelText: 'Label Text',

View File

@ -240,12 +240,12 @@ void main() {
RawMaterialButton( RawMaterialButton(
materialTapTargetSize: MaterialTapTargetSize.padded, materialTapTargetSize: MaterialTapTargetSize.padded,
onPressed: () { }, onPressed: () { },
child: SizedBox( child: const SizedBox(
width: 400.0, width: 400.0,
height: 400.0, height: 400.0,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 50.0, height: 50.0,
width: 400.0, width: 400.0,

View File

@ -4515,10 +4515,10 @@ void main() {
testWidgets('Tab preferredSize gives correct value', (WidgetTester tester) async { testWidgets('Tab preferredSize gives correct value', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Material( home: Material(
child: Row( child: Row(
children: const <Tab>[ children: <Tab>[
Tab(icon: Icon(Icons.message)), Tab(icon: Icon(Icons.message)),
Tab(text: 'Two'), Tab(text: 'Two'),
Tab(text: 'Three', icon: Icon(Icons.chat)), Tab(text: 'Three', icon: Icon(Icons.chat)),

View File

@ -389,8 +389,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[false], isSelected: const <bool>[false],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -416,8 +416,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -442,8 +442,8 @@ void main() {
child: boilerplate( child: boilerplate(
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[true], isSelected: const <bool>[true],
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -497,8 +497,8 @@ void main() {
color: enabledColor, color: enabledColor,
isSelected: const <bool>[false], isSelected: const <bool>[false],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -519,8 +519,8 @@ void main() {
selectedColor: selectedColor, selectedColor: selectedColor,
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -540,8 +540,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
disabledColor: disabledColor, disabledColor: disabledColor,
isSelected: const <bool>[true], isSelected: const <bool>[true],
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -565,8 +565,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[false], isSelected: const <bool>[false],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
]), ]),
], ],
@ -594,8 +594,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
]), ]),
], ],
@ -622,8 +622,8 @@ void main() {
child: boilerplate( child: boilerplate(
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[true], isSelected: const <bool>[true],
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
]), ]),
], ],
@ -652,8 +652,8 @@ void main() {
fillColor: customFillColor, fillColor: customFillColor,
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
]), ]),
], ],

View File

@ -261,10 +261,10 @@ void main() {
color: enabledColor, color: enabledColor,
isSelected: const <bool>[false], isSelected: const <bool>[false],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
// This Row is used like this to test for both TextStyle // This Row is used like this to test for both TextStyle
// and IconTheme for Text and Icon widgets respectively. // and IconTheme for Text and Icon widgets respectively.
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -290,8 +290,8 @@ void main() {
color: enabledColor, color: enabledColor,
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -317,8 +317,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
color: enabledColor, color: enabledColor,
isSelected: const <bool>[false], isSelected: const <bool>[false],
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
Icon(Icons.check), Icon(Icons.check),
]), ]),
@ -346,8 +346,8 @@ void main() {
child: ToggleButtons( child: ToggleButtons(
isSelected: const <bool>[true], isSelected: const <bool>[true],
onPressed: (int index) {}, onPressed: (int index) {},
children: <Widget>[ children: const <Widget>[
Row(children: const <Widget>[ Row(children: <Widget>[
Text('First child'), Text('First child'),
]), ]),
], ],

View File

@ -1280,10 +1280,10 @@ void main() {
await gesture.moveTo(Offset.zero); await gesture.moveTo(Offset.zero);
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Center( home: Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Tooltip( Tooltip(
message: 'message1', message: 'message1',
waitDuration: waitDuration, waitDuration: waitDuration,

View File

@ -10,9 +10,9 @@ import 'mock_canvas.dart';
void main() { void main() {
testWidgets('Flex overflow indicator', (WidgetTester tester) async { testWidgets('Flex overflow indicator', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Center( const Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SizedBox(width: 200.0, height: 200.0), SizedBox(width: 200.0, height: 200.0),
], ],
), ),
@ -22,11 +22,11 @@ void main() {
expect(find.byType(Column), isNot(paints..rect())); expect(find.byType(Column), isNot(paints..rect()));
await tester.pumpWidget( await tester.pumpWidget(
Center( const Center(
child: SizedBox( child: SizedBox(
height: 100.0, height: 100.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SizedBox(width: 200.0, height: 200.0), SizedBox(width: 200.0, height: 200.0),
], ],
), ),
@ -39,11 +39,11 @@ void main() {
expect(find.byType(Column), paints..rect()); expect(find.byType(Column), paints..rect());
await tester.pumpWidget( await tester.pumpWidget(
Center( const Center(
child: SizedBox( child: SizedBox(
height: 0.0, height: 0.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SizedBox(width: 200.0, height: 200.0), SizedBox(width: 200.0, height: 200.0),
], ],
), ),

View File

@ -232,7 +232,7 @@ void main() {
testWidgets('Top AnnotatedRegion provides status bar overlay style and bottom AnnotatedRegion provides navigation bar overlay style', (WidgetTester tester) async { testWidgets('Top AnnotatedRegion provides status bar overlay style and bottom AnnotatedRegion provides navigation bar overlay style', (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
await tester.pumpWidget( await tester.pumpWidget(
Column(children: const <Widget>[ const Column(children: <Widget>[
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>( Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle( value: SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue, systemNavigationBarColor: Colors.blue,
@ -258,7 +258,7 @@ void main() {
testWidgets('Top only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { testWidgets('Top only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
await tester.pumpWidget( await tester.pumpWidget(
Column(children: const <Widget>[ const Column(children: <Widget>[
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>( Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle( value: SystemUiOverlayStyle(
systemNavigationBarColor: Colors.blue, systemNavigationBarColor: Colors.blue,
@ -278,7 +278,7 @@ void main() {
testWidgets('Bottom only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async { testWidgets('Bottom only AnnotatedRegion provides status bar and navigation bar style properties', (WidgetTester tester) async {
setupTestDevice(); setupTestDevice();
await tester.pumpWidget( await tester.pumpWidget(
Column(children: const <Widget>[ const Column(children: <Widget>[
Expanded(child: SizedBox.expand()), Expanded(child: SizedBox.expand()),
Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>( Expanded(child: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle( value: SystemUiOverlayStyle(

View File

@ -26,25 +26,25 @@ void main() {
// | // |
// --------------------------------------- 'ground' // --------------------------------------- 'ground'
final SemanticsTester semantics = SemanticsTester(tester); final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(const MaterialApp(
home: Column( home: Column(
children: <Widget>[ children: <Widget>[
const Text('ground'), Text('ground'),
Card( Card(
elevation: 10.0, elevation: 10.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const Text('absolute elevation: 10'), Text('absolute elevation: 10'),
PhysicalModel( PhysicalModel(
elevation: 5.0, elevation: 5.0,
color: Colors.black, color: Colors.black,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const Text('absolute elevation: 15'), Text('absolute elevation: 15'),
Card( Card(
elevation: 7.0, elevation: 7.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('absolute elevation: 22'), Text('absolute elevation: 22'),
Card( Card(
elevation: 8.0, elevation: 8.0,
@ -56,7 +56,7 @@ void main() {
], ],
), ),
), ),
const Card( Card(
elevation: 15.0, elevation: 15.0,
child: Text('absolute elevation: 25'), child: Text('absolute elevation: 25'),
), ),
@ -102,15 +102,15 @@ void main() {
// is reversed // is reversed
final SemanticsTester semantics = SemanticsTester(tester); final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(const MaterialApp(
home: Column( home: Column(
children: <Widget>[ children: <Widget>[
const Text('ground'), Text('ground'),
Card( Card(
elevation: 10.0, elevation: 10.0,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const Card( Card(
elevation: 15.0, elevation: 15.0,
child: Text('absolute elevation: 25'), child: Text('absolute elevation: 25'),
), ),
@ -119,11 +119,11 @@ void main() {
color: Colors.black, color: Colors.black,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const Text('absolute elevation: 15'), Text('absolute elevation: 15'),
Card( Card(
elevation: 7.0, elevation: 7.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('absolute elevation: 22'), Text('absolute elevation: 22'),
Card( Card(
elevation: 8.0, elevation: 8.0,
@ -135,7 +135,7 @@ void main() {
], ],
), ),
), ),
const Text('absolute elevation: 10'), Text('absolute elevation: 10'),
], ],
), ),
), ),
@ -205,8 +205,8 @@ void main() {
MergeSemantics( MergeSemantics(
child: Semantics( child: Semantics(
explicitChildNodes: true, // just to be sure that it's going to be an explicit merge explicitChildNodes: true, // just to be sure that it's going to be an explicit merge
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Card( Card(
elevation: 15.0, elevation: 15.0,
child: Text('abs. elevation 25.0'), child: Text('abs. elevation 25.0'),
@ -259,8 +259,8 @@ void main() {
MergeSemantics( MergeSemantics(
child: Semantics( child: Semantics(
explicitChildNodes: true, // just to be sure that it's going to be an explicit merge explicitChildNodes: true, // just to be sure that it's going to be an explicit merge
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Card( Card(
elevation: 5.0, elevation: 5.0,
child: Text('abs. elevation 15.0'), child: Text('abs. elevation 15.0'),

View File

@ -107,12 +107,12 @@ void main() {
testWidgets('Align widthFactor', (WidgetTester tester) async { testWidgets('Align widthFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
Align( Align(
widthFactor: 0.5, widthFactor: 0.5,
child: SizedBox( child: SizedBox(
@ -130,12 +130,12 @@ void main() {
testWidgets('Align heightFactor', (WidgetTester tester) async { testWidgets('Align heightFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[ children: <Widget>[
Align( Align(
heightFactor: 0.5, heightFactor: 0.5,
child: SizedBox( child: SizedBox(

View File

@ -59,11 +59,11 @@ void main() {
testWidgets('AnimatedAlign widthFactor', (WidgetTester tester) async { testWidgets('AnimatedAlign widthFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
AnimatedAlign( AnimatedAlign(
alignment: Alignment.center, alignment: Alignment.center,
curve: Curves.ease, curve: Curves.ease,
@ -84,10 +84,10 @@ void main() {
testWidgets('AnimatedAlign heightFactor', (WidgetTester tester) async { testWidgets('AnimatedAlign heightFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
AnimatedAlign( AnimatedAlign(
alignment: Alignment.center, alignment: Alignment.center,
curve: Curves.ease, curve: Curves.ease,
@ -108,11 +108,11 @@ void main() {
testWidgets('AnimatedAlign null height factor', (WidgetTester tester) async { testWidgets('AnimatedAlign null height factor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
AnimatedAlign( AnimatedAlign(
alignment: Alignment.center, alignment: Alignment.center,
curve: Curves.ease, curve: Curves.ease,
@ -132,13 +132,13 @@ void main() {
testWidgets('AnimatedAlign null widthFactor', (WidgetTester tester) async { testWidgets('AnimatedAlign null widthFactor', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: SizedBox.shrink( child: SizedBox.shrink(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
AnimatedAlign( AnimatedAlign(
alignment: Alignment.center, alignment: Alignment.center,
curve: Curves.ease, curve: Curves.ease,

View File

@ -17,7 +17,7 @@ void main() {
const TextField client2 = TextField(autofillHints: <String>['2']); const TextField client2 = TextField(autofillHints: <String>['2']);
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: AutofillGroup( body: AutofillGroup(
key: outerKey, key: outerKey,
@ -25,7 +25,7 @@ void main() {
client1, client1,
AutofillGroup( AutofillGroup(
key: innerKey, key: innerKey,
child: Column(children: const <Widget>[client2, TextField(autofillHints: null)]), child: Column(children: <Widget>[client2, TextField(autofillHints: null)]),
), ),
]), ]),
), ),
@ -135,9 +135,9 @@ void main() {
child: Column(children: <Widget>[ child: Column(children: <Widget>[
client1, client1,
TextField(key: keyClient3, autofillHints: const <String>['3']), TextField(key: keyClient3, autofillHints: const <String>['3']),
AutofillGroup( const AutofillGroup(
key: innerKey, key: innerKey,
child: Column(children: const <Widget>[client2]), child: Column(children: <Widget>[client2]),
), ),
]), ]),
), ),

View File

@ -658,10 +658,10 @@ void main() {
}); });
testWidgets('ColoredBox - no size, no child', (WidgetTester tester) async { testWidgets('ColoredBox - no size, no child', (WidgetTester tester) async {
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: const <Widget>[ children: <Widget>[
SizedBox.shrink( SizedBox.shrink(
child: ColoredBox(color: colorToPaint), child: ColoredBox(color: colorToPaint),
), ),
@ -681,10 +681,10 @@ void main() {
testWidgets('ColoredBox - no size, child', (WidgetTester tester) async { testWidgets('ColoredBox - no size, child', (WidgetTester tester) async {
const ValueKey<int> key = ValueKey<int>(0); const ValueKey<int> key = ValueKey<int>(0);
const Widget child = SizedBox.expand(key: key); const Widget child = SizedBox.expand(key: key);
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: const <Widget>[ children: <Widget>[
SizedBox.shrink( SizedBox.shrink(
child: ColoredBox(color: colorToPaint, child: child), child: ColoredBox(color: colorToPaint, child: child),
), ),

View File

@ -18,10 +18,10 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // Default is MainAxisAlignment.start so children so the children's
// top edges should be at 0, 100, 500, child2's height should be 400. // 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( child: Column(
key: columnKey, key: columnKey,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
Expanded(child: SizedBox(key: child1Key, 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), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -64,10 +64,10 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // Default is MainAxisAlignment.start so children so the children's
// top edges should be at 0, 100, 200 // top edges should be at 0, 100, 200
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -108,11 +108,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // The 100x100 children's top edges should be at 200, 300
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
], ],
@ -147,11 +147,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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. // The 100x100 children's top edges should be at 300, 400, 500.
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -193,11 +193,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // The 100x100 children's top edges should be at 0, 250, 500
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -240,11 +240,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // The 100x100 children's top edges should be at 25, 175, 325, 475
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -293,11 +293,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // The 100x20 children's top edges should be at 135, 290, 445
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 20.0), SizedBox(key: child0Key, width: 100.0, height: 20.0),
SizedBox(key: child1Key, width: 100.0, height: 20.0), SizedBox(key: child1Key, width: 100.0, height: 20.0),
SizedBox(key: child2Key, width: 100.0, height: 20.0), SizedBox(key: child2Key, width: 100.0, height: 20.0),
@ -335,10 +335,10 @@ void main() {
const Key flexKey = Key('flexKey'); const Key flexKey = Key('flexKey');
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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( child: Column(
key: flexKey, key: flexKey,
children: const <Widget>[ children: <Widget>[
SizedBox(width: 100.0, height: 100.0), SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0), SizedBox(width: 100.0, height: 150.0),
], ],
@ -349,11 +349,11 @@ void main() {
expect(renderBox.size.height, equals(600.0)); expect(renderBox.size.height, equals(600.0));
// Column with MainAxisSize.min without flexible children shrink wraps. // Column with MainAxisSize.min without flexible children shrink wraps.
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: flexKey, key: flexKey,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
SizedBox(width: 100.0, height: 100.0), SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0), SizedBox(width: 100.0, height: 150.0),
], ],
@ -367,11 +367,11 @@ void main() {
testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async {
const Key childKey = Key('childKey'); const Key childKey = Key('childKey');
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: SizedBox.shrink( child: SizedBox.shrink(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
key: childKey, key: childKey,
width: 100.0, width: 100.0,
@ -399,11 +399,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // 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. // 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( child: Column(
key: columnKey, key: columnKey,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
Expanded(child: SizedBox(key: child1Key, 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), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -446,11 +446,11 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // Default is MainAxisAlignment.start so children so the children's
// bottom edges should be at 0, 100, 200 from bottom // bottom edges should be at 0, 100, 200 from bottom
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -491,12 +491,12 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // The 100x100 children's bottom edges should be at 200, 300 from bottom
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
], ],
@ -531,12 +531,12 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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. // 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( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -578,12 +578,12 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // 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( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -626,12 +626,12 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // 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( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 100.0), SizedBox(key: child0Key, width: 100.0, height: 100.0),
SizedBox(key: child1Key, width: 100.0, height: 100.0), SizedBox(key: child1Key, width: 100.0, height: 100.0),
SizedBox(key: child2Key, width: 100.0, height: 100.0), SizedBox(key: child2Key, width: 100.0, height: 100.0),
@ -680,12 +680,12 @@ void main() {
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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 // 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( child: Column(
key: columnKey, key: columnKey,
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(key: child0Key, width: 100.0, height: 20.0), SizedBox(key: child0Key, width: 100.0, height: 20.0),
SizedBox(key: child1Key, width: 100.0, height: 20.0), SizedBox(key: child1Key, width: 100.0, height: 20.0),
SizedBox(key: child2Key, width: 100.0, height: 20.0), SizedBox(key: child2Key, width: 100.0, height: 20.0),
@ -723,11 +723,11 @@ void main() {
const Key flexKey = Key('flexKey'); const Key flexKey = Key('flexKey');
// Default is MainAxisSize.max so the Column should be as high as the test: 600. // 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( child: Column(
key: flexKey, key: flexKey,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(width: 100.0, height: 100.0), SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0), SizedBox(width: 100.0, height: 150.0),
], ],
@ -738,12 +738,12 @@ void main() {
expect(renderBox.size.height, equals(600.0)); expect(renderBox.size.height, equals(600.0));
// Column with MainAxisSize.min without flexible children shrink wraps. // Column with MainAxisSize.min without flexible children shrink wraps.
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: Column( child: Column(
key: flexKey, key: flexKey,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox(width: 100.0, height: 100.0), SizedBox(width: 100.0, height: 100.0),
SizedBox(width: 100.0, height: 150.0), SizedBox(width: 100.0, height: 150.0),
], ],
@ -757,12 +757,12 @@ void main() {
testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async { testWidgets('Column MainAxisSize.min layout at zero size', (WidgetTester tester) async {
const Key childKey = Key('childKey'); const Key childKey = Key('childKey');
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: SizedBox.shrink( child: SizedBox.shrink(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
verticalDirection: VerticalDirection.up, verticalDirection: VerticalDirection.up,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
key: childKey, key: childKey,
width: 100.0, width: 100.0,

View File

@ -640,14 +640,14 @@ void main() {
// Dismissible contract. This is not an example of good practice. // Dismissible contract. This is not an example of good practice.
testWidgets('dismissing bottom then top (smoketest)', (WidgetTester tester) async { testWidgets('dismissing bottom then top (smoketest)', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
width: 100.0, width: 100.0,
height: 1000.0, height: 1000.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Test1215DismissibleWidget('1'), Test1215DismissibleWidget('1'),
Test1215DismissibleWidget('2'), Test1215DismissibleWidget('2'),
], ],

View File

@ -1752,9 +1752,9 @@ void main() {
await gesture.moveTo(secondLocation); await gesture.moveTo(secondLocation);
await tester.pump(); await tester.pump();
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(const MaterialApp(
home: Column( home: Column(
children: const <Widget>[ children: <Widget>[
Draggable<int>( Draggable<int>(
data: 1, data: 1,
feedback: Text('Dragging'), feedback: Text('Dragging'),
@ -2284,9 +2284,9 @@ void main() {
await gesture.moveTo(secondLocation); await gesture.moveTo(secondLocation);
await tester.pump(); await tester.pump();
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(const MaterialApp(
home: Column( home: Column(
children: const <Widget>[ children: <Widget>[
Draggable<int>( Draggable<int>(
data: 1, data: 1,
feedback: Text('Dragging'), feedback: Text('Dragging'),
@ -3061,9 +3061,9 @@ void main() {
const HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild; const HitTestBehavior hitTestBehavior = HitTestBehavior.deferToChild;
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Column( home: Column(
children: const <Widget>[ children: <Widget>[
Draggable<int>( Draggable<int>(
feedback: SizedBox(height: 50.0, child: Text('Draggable')), feedback: SizedBox(height: 50.0, child: Text('Draggable')),
child: SizedBox(height: 50.0, child: Text('Target')), child: SizedBox(height: 50.0, child: Text('Target')),
@ -3079,9 +3079,9 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/92083 // Regression test for https://github.com/flutter/flutter/issues/92083
testWidgets('feedback respect the MouseRegion cursor configure', (WidgetTester tester) async { testWidgets('feedback respect the MouseRegion cursor configure', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Column( home: Column(
children: const <Widget>[ children: <Widget>[
Draggable<int>( Draggable<int>(
ignoringFeedbackPointer: false, ignoringFeedbackPointer: false,
feedback: MouseRegion( feedback: MouseRegion(

View File

@ -49,9 +49,9 @@ void main() {
testWidgets('Flexible defaults to loose', (WidgetTester tester) async { testWidgets('Flexible defaults to loose', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Row( const Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
children: const <Widget>[ children: <Widget>[
Flexible(child: SizedBox(width: 100.0, height: 200.0)), Flexible(child: SizedBox(width: 100.0, height: 200.0)),
], ],
), ),
@ -64,11 +64,11 @@ void main() {
testWidgets("Doesn't overflow because of floating point accumulated error", (WidgetTester tester) async { 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 // both of these cases have failed in the past due to floating point issues
await tester.pumpWidget( await tester.pumpWidget(
Center( const Center(
child: SizedBox( child: SizedBox(
height: 400.0, height: 400.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
@ -81,11 +81,11 @@ void main() {
), ),
); );
await tester.pumpWidget( await tester.pumpWidget(
Center( const Center(
child: SizedBox( child: SizedBox(
height: 199.0, height: 199.0,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
Expanded(child: SizedBox()), Expanded(child: SizedBox()),
@ -104,7 +104,7 @@ void main() {
// we only get a single exception. Otherwise we'd get two, the one we want and // 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. // an extra one when we discover we never computed a size.
await tester.pumpWidget( await tester.pumpWidget(
Column( const Column(
children: <Widget>[ children: <Widget>[
Column(), Column(),
], ],
@ -134,11 +134,17 @@ void main() {
}); });
testWidgets('Can set and update clipBehavior', (WidgetTester tester) async { 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; final RenderFlex renderObject = tester.allRenderObjects.whereType<RenderFlex>().first;
expect(renderObject.clipBehavior, equals(Clip.none)); 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)); expect(renderObject.clipBehavior, equals(Clip.antiAlias));
}); });
test('Flex/Column/Row can be const-constructed', () {
const Flex(direction: Axis.vertical);
const Column();
const Row();
});
} }

View File

@ -17,8 +17,8 @@ void main() {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Semantics( child: Semantics(
container: true, container: true,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('Michael Goderbauer'), Text('Michael Goderbauer'),
Text('goderbauer@google.com'), Text('goderbauer@google.com'),
], ],
@ -51,8 +51,8 @@ void main() {
child: Semantics( child: Semantics(
container: true, container: true,
explicitChildNodes: true, explicitChildNodes: true,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('Michael Goderbauer'), Text('Michael Goderbauer'),
Text('goderbauer@google.com'), Text('goderbauer@google.com'),
], ],
@ -98,8 +98,8 @@ void main() {
explicitChildNodes: true, explicitChildNodes: true,
child: Semantics( child: Semantics(
label: 'Signed in as', label: 'Signed in as',
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('Michael Goderbauer'), Text('Michael Goderbauer'),
Text('goderbauer@google.com'), Text('goderbauer@google.com'),
], ],
@ -140,8 +140,8 @@ void main() {
container: true, container: true,
child: Semantics( child: Semantics(
label: 'Signed in as', label: 'Signed in as',
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('Michael Goderbauer'), Text('Michael Goderbauer'),
Text('goderbauer@google.com'), Text('goderbauer@google.com'),
], ],

View File

@ -29,9 +29,9 @@ void expectRects(WidgetTester tester, List<Rect> expected) {
void main() { void main() {
testWidgets('ListBody down', (WidgetTester tester) async { testWidgets('ListBody down', (WidgetTester tester) async {
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
direction: Axis.vertical, direction: Axis.vertical,
children: const <Widget>[ ListBody(children: children) ], children: <Widget>[ ListBody(children: children) ],
)); ));
expectRects( expectRects(
@ -46,9 +46,9 @@ void main() {
}); });
testWidgets('ListBody up', (WidgetTester tester) async { testWidgets('ListBody up', (WidgetTester tester) async {
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
direction: Axis.vertical, direction: Axis.vertical,
children: const <Widget>[ ListBody(reverse: true, children: children) ], children: <Widget>[ ListBody(reverse: true, children: children) ],
)); ));
expectRects( expectRects(
@ -63,10 +63,10 @@ void main() {
}); });
testWidgets('ListBody right', (WidgetTester tester) async { testWidgets('ListBody right', (WidgetTester tester) async {
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
direction: Axis.horizontal, direction: Axis.horizontal,
children: const <Widget>[ children: <Widget>[
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: ListBody(mainAxis: Axis.horizontal, children: children), child: ListBody(mainAxis: Axis.horizontal, children: children),
@ -86,10 +86,10 @@ void main() {
}); });
testWidgets('ListBody left', (WidgetTester tester) async { testWidgets('ListBody left', (WidgetTester tester) async {
await tester.pumpWidget(Flex( await tester.pumpWidget(const Flex(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
direction: Axis.horizontal, direction: Axis.horizontal,
children: const <Widget>[ children: <Widget>[
Directionality( Directionality(
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
child: ListBody(mainAxis: Axis.horizontal, children: children), child: ListBody(mainAxis: Axis.horizontal, children: children),
@ -147,7 +147,7 @@ void main() {
FlutterError.onError = (FlutterErrorDetails error) => errors.add(error); FlutterError.onError = (FlutterErrorDetails error) => errors.add(error);
try { try {
await tester.pumpWidget( await tester.pumpWidget(
Flex( const Flex(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
direction: Axis.horizontal, direction: Axis.horizontal,
children: <Widget>[ children: <Widget>[
@ -159,7 +159,7 @@ void main() {
Flex( Flex(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
direction: Axis.vertical, direction: Axis.vertical,
children: const <Widget>[ children: <Widget>[
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: ListBody( child: ListBody(

View File

@ -11,10 +11,10 @@ void main() {
// Regression test for https://github.com/flutter/flutter/issues/48855. // Regression test for https://github.com/flutter/flutter/issues/48855.
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('0', key: ValueKey<int>(0)), Text('0', key: ValueKey<int>(0)),
Text('1', key: ValueKey<int>(1)), Text('1', key: ValueKey<int>(1)),
Text('2', key: ValueKey<int>(2)), Text('2', key: ValueKey<int>(2)),
@ -35,10 +35,10 @@ void main() {
); );
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('0', key: ValueKey<int>(0)), Text('0', key: ValueKey<int>(0)),
Text('6', key: ValueKey<int>(6)), Text('6', key: ValueKey<int>(6)),
Text('7', key: ValueKey<int>(7)), Text('7', key: ValueKey<int>(7)),
@ -62,8 +62,8 @@ void main() {
testWidgets('Building a new MultiChildRenderObjectElement with children having duplicated keys throws', (WidgetTester tester) async { testWidgets('Building a new MultiChildRenderObjectElement with children having duplicated keys throws', (WidgetTester tester) async {
const ValueKey<int> duplicatedKey = ValueKey<int>(1); const ValueKey<int> duplicatedKey = ValueKey<int>(1);
await tester.pumpWidget(Column( await tester.pumpWidget(const Column(
children: const <Widget>[ children: <Widget>[
Text('Text 1', textDirection: TextDirection.ltr, key: duplicatedKey), Text('Text 1', textDirection: TextDirection.ltr, key: duplicatedKey),
Text('Text 2', textDirection: TextDirection.ltr, key: duplicatedKey), Text('Text 2', textDirection: TextDirection.ltr, key: duplicatedKey),
], ],

View File

@ -292,11 +292,11 @@ void main() {
checkTree(tester, <TestParentData>[]); checkTree(tester, <TestParentData>[]);
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: DummyWidget( child: DummyWidget(
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Positioned( Positioned(
top: 6.0, top: 6.0,
left: 7.0, left: 7.0,

View File

@ -47,15 +47,15 @@ void main() {
testWidgets('PhysicalModel - clips when overflows and elevation is 0', (WidgetTester tester) async { testWidgets('PhysicalModel - clips when overflows and elevation is 0', (WidgetTester tester) async {
const Key key = Key('test'); const Key key = Key('test');
await tester.pumpWidget( await tester.pumpWidget(
MediaQuery( const MediaQuery(
key: key, key: key,
data: const MediaQueryData(), data: MediaQueryData(),
child: Directionality( child: Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Padding( child: Padding(
padding: const EdgeInsets.all(50), padding: EdgeInsets.all(50),
child: Row( 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')), 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')),

View File

@ -147,17 +147,17 @@ void main() {
color: Colors.green, color: Colors.green,
child: IntrinsicHeight( child: IntrinsicHeight(
child: RichText( child: RichText(
text: TextSpan( text: const TextSpan(
children: <InlineSpan>[ 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( WidgetSpan(
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
SizedBox(height: 16, width: 16), 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)),
], ],
), ),
), ),

View File

@ -284,12 +284,12 @@ void main() {
OrderPainter.log.clear(); OrderPainter.log.clear();
const Key childKey = Key('childKey'); const Key childKey = Key('childKey');
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: SizedBox.shrink( child: SizedBox.shrink(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
key: childKey, key: childKey,
width: 100.0, width: 100.0,
@ -704,13 +704,13 @@ void main() {
OrderPainter.log.clear(); OrderPainter.log.clear();
const Key childKey = Key('childKey'); const Key childKey = Key('childKey');
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: SizedBox.shrink( child: SizedBox.shrink(
child: Row( child: Row(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
key: childKey, key: childKey,
width: 100.0, width: 100.0,
@ -1125,13 +1125,13 @@ void main() {
OrderPainter.log.clear(); OrderPainter.log.clear();
const Key childKey = Key('childKey'); const Key childKey = Key('childKey');
await tester.pumpWidget(Center( await tester.pumpWidget(const Center(
child: SizedBox.shrink( child: SizedBox.shrink(
child: Row( child: Row(
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
key: childKey, key: childKey,
width: 100.0, width: 100.0,

View File

@ -113,10 +113,10 @@ void main() {
} }
testWidgets('SafeArea alone.', (WidgetTester tester) async { testWidgets('SafeArea alone.', (WidgetTester tester) async {
final Widget child = boilerplate(SafeArea( final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true, maintainBottomViewPadding: true,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: Placeholder()), Expanded(child: Placeholder()),
], ],
), ),
@ -148,10 +148,10 @@ void main() {
}); });
testWidgets('SafeArea alone - partial ViewInsets consume Padding', (WidgetTester tester) async { testWidgets('SafeArea alone - partial ViewInsets consume Padding', (WidgetTester tester) async {
final Widget child = boilerplate(SafeArea( final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true, maintainBottomViewPadding: true,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: Placeholder()), Expanded(child: Placeholder()),
], ],
), ),
@ -181,12 +181,12 @@ void main() {
}); });
testWidgets('SafeArea with nested Scaffold', (WidgetTester tester) async { testWidgets('SafeArea with nested Scaffold', (WidgetTester tester) async {
final Widget child = boilerplate(SafeArea( final Widget child = boilerplate(const SafeArea(
maintainBottomViewPadding: true, maintainBottomViewPadding: true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Column( body: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: Placeholder()), Expanded(child: Placeholder()),
], ],
), ),
@ -219,12 +219,12 @@ void main() {
}); });
testWidgets('SafeArea with nested Scaffold - partial ViewInsets consume Padding', (WidgetTester tester) async { 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, maintainBottomViewPadding: true,
child: Scaffold( child: Scaffold(
resizeToAvoidBottomInset: false, resizeToAvoidBottomInset: false,
body: Column( body: Column(
children: const <Widget>[ children: <Widget>[
Expanded(child: Placeholder()), Expanded(child: Placeholder()),
], ],
), ),

View File

@ -409,8 +409,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -449,8 +449,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
SelectionContainer.disabled(child: Text('Good, and you?')), SelectionContainer.disabled(child: Text('Good, and you?')),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -490,8 +490,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -529,8 +529,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -665,8 +665,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: focusNode, focusNode: focusNode,
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -813,8 +813,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('جيد وانت؟', textDirection: TextDirection.rtl), Text('جيد وانت؟', textDirection: TextDirection.rtl),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -854,8 +854,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -954,8 +954,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -995,8 +995,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1031,8 +1031,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1067,8 +1067,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1102,8 +1102,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1141,8 +1141,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1201,8 +1201,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1311,8 +1311,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1402,8 +1402,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),
@ -1480,8 +1480,8 @@ void main() {
home: SelectableRegion( home: SelectableRegion(
focusNode: FocusNode(), focusNode: FocusNode(),
selectionControls: materialTextSelectionControls, selectionControls: materialTextSelectionControls,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('How are you?'), Text('How are you?'),
Text('Good, and you?'), Text('Good, and you?'),
Text('Fine, thank you.'), Text('Fine, thank you.'),

View File

@ -5079,11 +5079,11 @@ void main() {
testWidgets('text selection style 1', (WidgetTester tester) async { testWidgets('text selection style 1', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Material( home: Material(
child: Center( child: Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SelectableText.rich( SelectableText.rich(
TextSpan( TextSpan(
children: <TextSpan>[ children: <TextSpan>[
@ -5131,11 +5131,11 @@ void main() {
testWidgets('text selection style 2', (WidgetTester tester) async { testWidgets('text selection style 2', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Material( home: Material(
child: Center( child: Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SelectableText.rich( SelectableText.rich(
TextSpan( TextSpan(
children: <TextSpan>[ children: <TextSpan>[

View File

@ -25,8 +25,8 @@ void main() {
SelectionContainer( SelectionContainer(
registrar: registrar, registrar: registrar,
delegate: delegate, delegate: delegate,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr), Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr), Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr), Text('column3', textDirection: TextDirection.ltr),
@ -46,9 +46,9 @@ void main() {
SelectionContainer( SelectionContainer(
registrar: registrar, registrar: registrar,
delegate: delegate, delegate: delegate,
child: SelectionContainer.disabled( child: const SelectionContainer.disabled(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr), Text('column1', textDirection: TextDirection.ltr),
Text('column2', textDirection: TextDirection.ltr), Text('column2', textDirection: TextDirection.ltr),
Text('column3', textDirection: TextDirection.ltr), Text('column3', textDirection: TextDirection.ltr),
@ -69,7 +69,7 @@ void main() {
SelectionContainer( SelectionContainer(
registrar: registrar, registrar: registrar,
delegate: delegate, delegate: delegate,
child: Column( child: const Column(
), ),
), ),
); );
@ -80,8 +80,8 @@ void main() {
SelectionContainer( SelectionContainer(
registrar: registrar, registrar: registrar,
delegate: delegate, delegate: delegate,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr), Text('column1', textDirection: TextDirection.ltr),
], ],
), ),
@ -94,7 +94,7 @@ void main() {
SelectionContainer( SelectionContainer(
registrar: registrar, registrar: registrar,
delegate: delegate, delegate: delegate,
child: Column( child: const Column(
), ),
), ),
); );
@ -111,8 +111,8 @@ void main() {
registrar: registrar, registrar: registrar,
child: SelectionContainer( child: SelectionContainer(
delegate: delegate, delegate: delegate,
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('column1', textDirection: TextDirection.ltr), Text('column1', textDirection: TextDirection.ltr),
], ],
), ),

View File

@ -12,7 +12,7 @@ void main() {
testWidgets('SemanticNode.rect is clipped', (WidgetTester tester) async { testWidgets('SemanticNode.rect is clipped', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester); final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(Directionality( await tester.pumpWidget(const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
@ -20,7 +20,7 @@ void main() {
child: Flex( child: Flex(
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
direction: Axis.horizontal, direction: Axis.horizontal,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 75.0, width: 75.0,
child: Text('1'), child: Text('1'),
@ -70,7 +70,7 @@ void main() {
testWidgets('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async { testWidgets('SemanticsNode is not removed if out of bounds and merged into something within bounds', (WidgetTester tester) async {
final SemanticsTester semantics = SemanticsTester(tester); final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(Directionality( await tester.pumpWidget(const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: SizedBox( child: SizedBox(
@ -79,14 +79,14 @@ void main() {
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
direction: Axis.horizontal, direction: Axis.horizontal,
children: <Widget>[ children: <Widget>[
const SizedBox( SizedBox(
width: 75.0, width: 75.0,
child: Text('1'), child: Text('1'),
), ),
MergeSemantics( MergeSemantics(
child: Flex( child: Flex(
direction: Axis.horizontal, direction: Axis.horizontal,
children: const <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 75.0, width: 75.0,
child: Text('2'), child: Text('2'),

View File

@ -1001,14 +1001,14 @@ void main() {
}, },
); );
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
const Text('Label 1'), Text('Label 1'),
const Text('Label 2'), Text('Label 2'),
Row( Row(
children: const <Widget>[ children: <Widget>[
Text('Label 3'), Text('Label 3'),
Text('Label 4'), Text('Label 4'),
Text('Label 5'), Text('Label 5'),
@ -1070,8 +1070,8 @@ void main() {
const Text('Label 2'), const Text('Label 2'),
Transform.rotate( Transform.rotate(
angle: pi / 2.0, angle: pi / 2.0,
child: Row( child: const Row(
children: const <Widget>[ children: <Widget>[
Text('Label 3'), Text('Label 3'),
Text('Label 4'), Text('Label 4'),
Text('Label 5'), Text('Label 5'),
@ -1638,7 +1638,7 @@ void main() {
// Construct a widget tree that will end up with a fitted box that applies // 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. // a zero transform because it does not actually draw its children.
// Assert that this subtree gets dropped (the root node has no children). // Assert that this subtree gets dropped (the root node has no children).
await tester.pumpWidget(Column( await tester.pumpWidget(const Column(
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 0, height: 0,

View File

@ -7,8 +7,8 @@ import 'package:flutter_test/flutter_test.dart';
void main() { void main() {
testWidgets('Spacer takes up space.', (WidgetTester tester) async { testWidgets('Spacer takes up space.', (WidgetTester tester) async {
await tester.pumpWidget(Column( await tester.pumpWidget(const Column(
children: const <Widget>[ children: <Widget>[
SizedBox(width: 10.0, height: 10.0), SizedBox(width: 10.0, height: 10.0),
Spacer(), Spacer(),
SizedBox(width: 10.0, height: 10.0), SizedBox(width: 10.0, height: 10.0),
@ -24,9 +24,9 @@ void main() {
const Spacer spacer2 = Spacer(); const Spacer spacer2 = Spacer();
const Spacer spacer3 = Spacer(flex: 2); const Spacer spacer3 = Spacer(flex: 2);
const Spacer spacer4 = Spacer(flex: 4); const Spacer spacer4 = Spacer(flex: 4);
await tester.pumpWidget(Row( await tester.pumpWidget(const Row(
textDirection: TextDirection.rtl, textDirection: TextDirection.rtl,
children: const <Widget>[ children: <Widget>[
SizedBox(width: 10.0, height: 10.0), SizedBox(width: 10.0, height: 10.0),
spacer1, spacer1,
SizedBox(width: 10.0, height: 10.0), SizedBox(width: 10.0, height: 10.0),
@ -54,10 +54,10 @@ void main() {
}); });
testWidgets('Spacer takes up space.', (WidgetTester tester) async { testWidgets('Spacer takes up space.', (WidgetTester tester) async {
await tester.pumpWidget(UnconstrainedBox( await tester.pumpWidget(const UnconstrainedBox(
constrainedAxis: Axis.vertical, constrainedAxis: Axis.vertical,
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
SizedBox(width: 20.0, height: 10.0), SizedBox(width: 20.0, height: 10.0),
Spacer(), Spacer(),
SizedBox(width: 10.0, height: 10.0), SizedBox(width: 10.0, height: 10.0),

View File

@ -130,7 +130,7 @@ void main() {
testWidgets('swap instances around', (WidgetTester tester) async { testWidgets('swap instances around', (WidgetTester tester) async {
const Widget a = TestWidget(persistentState: 0x61, syncedState: 0x41, child: Text('apple', textDirection: TextDirection.ltr)); 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)); 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 keyA = GlobalKey();
final GlobalKey keyB = GlobalKey(); final GlobalKey keyB = GlobalKey();

View File

@ -1331,8 +1331,8 @@ void main() {
decoration: const BoxDecoration( decoration: const BoxDecoration(
color: Color(0xff00ff00), color: Color(0xff00ff00),
), ),
child: Column( child: const Column(
children: const <Widget>[ children: <Widget>[
Text('Hello\nLine 2\nLine 3', Text('Hello\nLine 2\nLine 3',
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
style: TextStyle(height: 5), style: TextStyle(height: 5),

View File

@ -1012,13 +1012,13 @@ void main() {
testWidgets('textWidthBasis with textAlign still obeys parent alignment', (WidgetTester tester) async { testWidgets('textWidthBasis with textAlign still obeys parent alignment', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
MaterialApp( const MaterialApp(
home: Scaffold( home: Scaffold(
body: Center( body: Center(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: const <Widget>[ children: <Widget>[
Text( Text(
'LEFT ALIGNED, PARENT', 'LEFT ALIGNED, PARENT',
textAlign: TextAlign.left, textAlign: TextAlign.left,

View File

@ -190,8 +190,8 @@ void main() {
routes: <String, WidgetBuilder>{ routes: <String, WidgetBuilder>{
'/foo' : (BuildContext context) => const Text('New route'), '/foo' : (BuildContext context) => const Text('New route'),
}, },
home: Row( home: const Row(
children: const <Widget>[ children: <Widget>[
_TickingWidget(), _TickingWidget(),
_MultiTickingWidget(), _MultiTickingWidget(),
Text('Old route'), Text('Old route'),

View File

@ -808,7 +808,7 @@ void main() {
), ),
const ColoredBox(color: Color(0xff00ff00), child: square), 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(0xff0000ff), child: square),
ColoredBox(color: Color(0xffeeff00), child: square), ColoredBox(color: Color(0xffeeff00), child: square),
]), ]),

View File

@ -4303,11 +4303,11 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
}); });
Future<void> pumpWidgetForLayoutExplorer(WidgetTester tester) async { Future<void> pumpWidgetForLayoutExplorer(WidgetTester tester) async {
final Widget widget = Directionality( const Widget widget = Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: Row( child: Row(
children: const <Widget>[ children: <Widget>[
Flexible( Flexible(
child: ColoredBox( child: ColoredBox(
color: Colors.green, color: Colors.green,
@ -4959,9 +4959,9 @@ class _TestWidgetInspectorService extends TestWidgetInspectorService {
appBar: AppBar( appBar: AppBar(
title: const Text('Hello World!'), title: const Text('Hello World!'),
), ),
body: Center( body: const Center(
child: Column( child: Column(
children: const <Widget>[ children: <Widget>[
Text('Hello World!'), Text('Hello World!'),
], ],
), ),

View File

@ -841,8 +841,8 @@ void main() {
testWidgets('Object exactly matches container width', (WidgetTester tester) async { testWidgets('Object exactly matches container width', (WidgetTester tester) async {
await tester.pumpWidget( await tester.pumpWidget(
Column( const Column(
children: const <Widget>[ children: <Widget>[
Wrap( Wrap(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
spacing: 10.0, spacing: 10.0,
@ -859,8 +859,8 @@ void main() {
verify(tester, <Offset>[Offset.zero]); verify(tester, <Offset>[Offset.zero]);
await tester.pumpWidget( await tester.pumpWidget(
Column( const Column(
children: const <Widget>[ children: <Widget>[
Wrap( Wrap(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
spacing: 10.0, spacing: 10.0,
@ -893,7 +893,7 @@ void main() {
testWidgets('Horizontal wrap - IntrinsicsHeight', (WidgetTester tester) async { testWidgets('Horizontal wrap - IntrinsicsHeight', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/48679. // Regression test for https://github.com/flutter/flutter/issues/48679.
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: IntrinsicHeight( child: IntrinsicHeight(
@ -901,13 +901,13 @@ void main() {
color: Colors.green, color: Colors.green,
child: Wrap( child: Wrap(
children: <Widget>[ children: <Widget>[
const Text('Start', style: TextStyle(height: 1.0, fontSize: 16)), Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
Row( Row(
children: const <Widget>[ children: <Widget>[
SizedBox(height: 40, width: 60), 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 @@ void main() {
testWidgets('Vertical wrap - IntrinsicsWidth', (WidgetTester tester) async { testWidgets('Vertical wrap - IntrinsicsWidth', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/48679. // Regression test for https://github.com/flutter/flutter/issues/48679.
await tester.pumpWidget( await tester.pumpWidget(
Directionality( const Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Center( child: Center(
child: IntrinsicWidth( child: IntrinsicWidth(
@ -934,13 +934,13 @@ void main() {
child: Wrap( child: Wrap(
direction: Axis.vertical, direction: Axis.vertical,
children: <Widget>[ children: <Widget>[
const Text('Start', style: TextStyle(height: 1.0, fontSize: 16)), Text('Start', style: TextStyle(height: 1.0, fontSize: 16)),
Column( Column(
children: const <Widget>[ children: <Widget>[
SizedBox(height: 40, width: 60), SizedBox(height: 40, width: 60),
], ],
), ),
const Text('End', style: TextStyle(height: 1.0, fontSize: 16)), Text('End', style: TextStyle(height: 1.0, fontSize: 16)),
], ],
), ),
), ),

Some files were not shown because too many files have changed in this diff Show More