From 82df23539ffc962c850e5681522c020b01b9f8c0 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Tue, 31 Jan 2023 18:03:09 -0800 Subject: [PATCH] Undo making Flex,Row,Column const (#119669) --- packages/flutter/lib/src/material/button_bar.dart | 2 +- packages/flutter/lib/src/material/tabs.dart | 2 +- packages/flutter/lib/src/widgets/basic.dart | 8 +++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/material/button_bar.dart b/packages/flutter/lib/src/material/button_bar.dart index 7cdd64ac69..8652cb14f4 100644 --- a/packages/flutter/lib/src/material/button_bar.dart +++ b/packages/flutter/lib/src/material/button_bar.dart @@ -233,7 +233,7 @@ class ButtonBar extends StatelessWidget { class _ButtonBarRow extends Flex { /// Creates a button bar that attempts to display in a row, but displays in /// a column if there is insufficient horizontal space. - const _ButtonBarRow({ + _ButtonBarRow({ required super.children, super.mainAxisSize, super.mainAxisAlignment, diff --git a/packages/flutter/lib/src/material/tabs.dart b/packages/flutter/lib/src/material/tabs.dart index d32d884fe5..8d98ffe632 100644 --- a/packages/flutter/lib/src/material/tabs.dart +++ b/packages/flutter/lib/src/material/tabs.dart @@ -275,7 +275,7 @@ class _TabLabelBarRenderer extends RenderFlex { // upon layout. The tab widths are only used at paint time (see _IndicatorPainter) // or in response to input. class _TabLabelBar extends Flex { - const _TabLabelBar({ + _TabLabelBar({ super.children, required this.onPerformLayout, }) : super( diff --git a/packages/flutter/lib/src/widgets/basic.dart b/packages/flutter/lib/src/widgets/basic.dart index 9634fe59d4..a295c95126 100644 --- a/packages/flutter/lib/src/widgets/basic.dart +++ b/packages/flutter/lib/src/widgets/basic.dart @@ -4445,7 +4445,9 @@ class Flex extends MultiChildRenderObjectWidget { /// to be necessary to decide which direction to lay the children in or to /// disambiguate `start` or `end` values for the main or cross axis /// directions, the [textDirection] must not be null. - const Flex({ + // TODO(goderbauer): Figure out whether this can be const. + // ignore: prefer_const_constructors_in_immutables + Flex({ super.key, required this.direction, this.mainAxisAlignment = MainAxisAlignment.start, @@ -4812,7 +4814,7 @@ class Row extends Flex { /// unless the row has no children or only one child) or to disambiguate /// `start` or `end` values for the [mainAxisAlignment], the [textDirection] /// must not be null. - const Row({ + Row({ super.key, super.mainAxisAlignment, super.mainAxisSize, @@ -5005,7 +5007,7 @@ class Column extends Flex { /// any. If there is no ambient directionality, and a text direction is going /// to be necessary to disambiguate `start` or `end` values for the /// [crossAxisAlignment], the [textDirection] must not be null. - const Column({ + Column({ super.key, super.mainAxisAlignment, super.mainAxisSize,