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
107 changed files with 520 additions and 515 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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