Skip to content

Commit 3cf446c

Browse files
TahaTesserTytaniumDev
authored andcommitted
[Reland] Introduce double Flex.spacing parameter for Row/Column spacing (flutter#152890)
Relands flutter#152472 (Fixed error causing message test, maybe by flutter#152501) --- fixes [add spacing parameter to Column and Row](flutter#55378) ### `Column.spacing` Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( backgroundColor: Colors.black, body: Center( child: Padding( padding: const EdgeInsets.all(16.0), child: DecoratedBox( decoration: BoxDecoration( border: Border.all( color: Colors.amber, )), child: const Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ Column( spacing: 40.0, // ignore: avoid_redundant_argument_values mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Column( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Column( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Column( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Column( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Column( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.topCenter, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.bottomCenter, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), ], ), ), ), ), ), ); } } ``` </details> ### Preview <img width="1072" alt="Screenshot 2024-07-30 at 15 40 59" src="https://github.com/user-attachments/assets/14f21091-9e46-4a58-8552-1379f4ba9216"> ### `Row.spacing` Code sample <details> <summary>expand to view the code sample</summary> ```dart import 'package:flutter/material.dart'; void main() => runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({super.key}); @OverRide Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( backgroundColor: Colors.black, body: Center( child: Padding( padding: const EdgeInsets.all(16.0), child: DecoratedBox( decoration: BoxDecoration( border: Border.all( color: Colors.amber, )), child: const Column( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ Row( spacing: 40.0, // ignore: avoid_redundant_argument_values mainAxisAlignment: MainAxisAlignment.start, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerRight, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Row( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.center, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerRight, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Row( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.end, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerRight, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Row( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerRight, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Row( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceAround, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerRight, child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), Row( spacing: 40.0, mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: <Widget>[ ColoredBox( color: Color(0xffff0000), child: SizedBox( width: 50.0, height: 75.0, child: Align( alignment: Alignment.centerLeft, child: Text( 'RED', style: TextStyle(color: Colors.white), ), ), ), ), ColoredBox( color: Color(0xff00ff00), child: SizedBox( width: 50.0, height: 75.0, child: Center( child: Text( 'GREEN', style: TextStyle(color: Colors.black), ), ), ), ), ColoredBox( color: Color(0xff0000ff), child: SizedBox( width: 50.0, height: 75.0, child: Align( child: Text( 'BLUE', style: TextStyle(color: Colors.white), ), ), ), ), ], ), ], ), ), ), ), ), ); } } ``` </details> ### Preview <img width="1072" alt="Screenshot 2024-07-30 at 15 39 42" src="https://github.com/user-attachments/assets/717e9f5e-a491-4853-ba74-e72ec7493363">
1 parent 3e6912a commit 3cf446c

File tree

5 files changed

+618
-18
lines changed

5 files changed

+618
-18
lines changed

packages/flutter/lib/src/rendering/flex.dart

Lines changed: 84 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,19 +215,19 @@ enum MainAxisAlignment {
215215
/// after the first and last child.
216216
spaceEvenly;
217217

218-
(double leadingSpace, double betweenSpace) _distributeSpace(double freeSpace, int itemCount, bool flipped) {
218+
(double leadingSpace, double betweenSpace) _distributeSpace(double freeSpace, int itemCount, bool flipped, double spacing) {
219219
assert(itemCount >= 0);
220220
return switch (this) {
221-
MainAxisAlignment.start => flipped ? (freeSpace, 0.0) : (0.0, 0.0),
221+
MainAxisAlignment.start => flipped ? (freeSpace, spacing) : (0.0, spacing),
222222

223-
MainAxisAlignment.end => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, !flipped),
224-
MainAxisAlignment.spaceBetween when itemCount < 2 => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, flipped),
225-
MainAxisAlignment.spaceAround when itemCount == 0 => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, flipped),
223+
MainAxisAlignment.end => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, !flipped, spacing),
224+
MainAxisAlignment.spaceBetween when itemCount < 2 => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, flipped, spacing),
225+
MainAxisAlignment.spaceAround when itemCount == 0 => MainAxisAlignment.start._distributeSpace(freeSpace, itemCount, flipped, spacing),
226226

227-
MainAxisAlignment.center => (freeSpace / 2.0, 0.0),
228-
MainAxisAlignment.spaceBetween => (0.0, freeSpace / (itemCount - 1)),
229-
MainAxisAlignment.spaceAround => (freeSpace / itemCount / 2, freeSpace / itemCount),
230-
MainAxisAlignment.spaceEvenly => (freeSpace / (itemCount + 1), freeSpace / (itemCount + 1)),
227+
MainAxisAlignment.center => (freeSpace / 2.0, spacing),
228+
MainAxisAlignment.spaceBetween => (0.0, freeSpace / (itemCount - 1) + spacing),
229+
MainAxisAlignment.spaceAround => (freeSpace / itemCount / 2, freeSpace / itemCount + spacing),
230+
MainAxisAlignment.spaceEvenly => (freeSpace / (itemCount + 1), freeSpace / (itemCount + 1) + spacing),
231231
};
232232
}
233233
}
@@ -390,14 +390,17 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
390390
VerticalDirection verticalDirection = VerticalDirection.down,
391391
TextBaseline? textBaseline,
392392
Clip clipBehavior = Clip.none,
393+
double spacing = 0.0,
393394
}) : _direction = direction,
394395
_mainAxisAlignment = mainAxisAlignment,
395396
_mainAxisSize = mainAxisSize,
396397
_crossAxisAlignment = crossAxisAlignment,
397398
_textDirection = textDirection,
398399
_verticalDirection = verticalDirection,
399400
_textBaseline = textBaseline,
400-
_clipBehavior = clipBehavior {
401+
_clipBehavior = clipBehavior,
402+
_spacing = spacing,
403+
assert(spacing >= 0.0) {
401404
addAll(children);
402405
}
403406

@@ -588,6 +591,69 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
588591
}
589592
}
590593

594+
/// {@template flutter.rendering.RenderFlex.spacing}
595+
/// How much space to place between children in the main axis.
596+
///
597+
/// The spacing is only applied between children in the main axis.
598+
///
599+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is
600+
/// [MainAxisAlignment.start], then the first child will be placed at the start
601+
/// of the main axis, and the second child will be placed 10.0 pixels after
602+
/// the first child in the main axis, and so on. The [spacing] is not applied
603+
/// before the first child or after the last child.
604+
///
605+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is [MainAxisAlignment.end],
606+
/// then the last child will be placed at the end of the main axis, and the
607+
/// second-to-last child will be placed 10.0 pixels before the last child in
608+
/// the main axis, and so on. The [spacing] is not applied before the first
609+
/// child or after the last child.
610+
///
611+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is [MainAxisAlignment.center],
612+
/// then the children will be placed in the center of the main axis with 10.0
613+
/// pixels of space between the children. The [spacing] is not applied before the first
614+
/// child or after the last child.
615+
///
616+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is [MainAxisAlignment.spaceBetween],
617+
/// then there will be a minimum of 10.0 pixels of space between each child in the
618+
/// main axis. If the free space is 100.0 pixels between the two children,
619+
/// then the minimum space between the children will be 10.0 pixels and the
620+
/// remaining 90.0 pixels will be the free space between the children. The
621+
/// [spacing] is not applied before the first child or after the last child.
622+
///
623+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is [MainAxisAlignment.spaceAround],
624+
/// then there will be a minimum of 10.0 pixels of space between each child in the
625+
/// main axis, and the remaining free space will be placed between the children as
626+
/// well as before the first child and after the last child. The [spacing] is
627+
/// not applied before the first child or after the last child.
628+
///
629+
/// If the [spacing] is 10.0 and the [mainAxisAlignment] is [MainAxisAlignment.spaceEvenly],
630+
/// then there will be a minimum of 10.0 pixels of space between each child in the
631+
/// main axis, and the remaining free space will be evenly placed between the
632+
/// children as well as before the first child and after the last child. The
633+
/// [spacing] is not applied before the first child or after the last child.
634+
///
635+
/// When the [spacing] is non-zero, the layout size will be larger than
636+
/// the sum of the children's layout sizes in the main axis.
637+
///
638+
/// When the total children's layout sizes and total spacing between the
639+
/// children is greater than the maximum constraints in the main axis, then
640+
/// the children will overflow. For example, if there are two children and the
641+
/// maximum constraint is 100.0 pixels, the children's layout sizes are 50.0
642+
/// pixels each, and the spacing is 10.0 pixels, then the children will
643+
/// overflow by 10.0 pixels.
644+
///
645+
/// Defaults to 0.0.
646+
/// {@endtemplate}
647+
double get spacing => _spacing;
648+
double _spacing;
649+
set spacing (double value) {
650+
if (_spacing == value) {
651+
return;
652+
}
653+
_spacing = value;
654+
markNeedsLayout();
655+
}
656+
591657
@override
592658
void setupParentData(RenderBox child) {
593659
if (child.parentData is! FlexParentData) {
@@ -597,15 +663,15 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
597663

598664
double _getIntrinsicSize({
599665
required Axis sizingDirection,
600-
required double extent, // the extent in the direction that isn't the sizing direction
601-
required _ChildSizingFunction childSize, // a method to find the size in the sizing direction
666+
required double extent, // The extent in the direction that isn't the sizing direction.
667+
required _ChildSizingFunction childSize, // A method to find the size in the sizing direction.
602668
}) {
603669
if (_direction == sizingDirection) {
604670
// INTRINSIC MAIN SIZE
605671
// Intrinsic main size is the smallest size the flex container can take
606672
// while maintaining the min/max-content contributions of its flex items.
607673
double totalFlex = 0.0;
608-
double inflexibleSpace = 0.0;
674+
double inflexibleSpace = spacing * (childCount - 1);
609675
double maxFlexFractionSoFar = 0.0;
610676
for (RenderBox? child = firstChild; child != null; child = childAfter(child)) {
611677
final int flex = _getFlex(child);
@@ -825,7 +891,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
825891
case Axis.vertical:
826892
final double freeSpace = math.max(0.0, sizes.mainAxisFreeSpace);
827893
final bool flipMainAxis = _flipMainAxis;
828-
final (double leadingSpaceY, double spaceBetween) = mainAxisAlignment._distributeSpace(freeSpace, childCount, flipMainAxis);
894+
final (double leadingSpaceY, double spaceBetween) = mainAxisAlignment._distributeSpace(freeSpace, childCount, flipMainAxis, spacing);
829895
double y = flipMainAxis
830896
? leadingSpaceY + (childCount - 1) * spaceBetween + (sizes.axisSize.mainAxisExtent - sizes.mainAxisFreeSpace)
831897
: leadingSpaceY;
@@ -978,7 +1044,8 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
9781044
int totalFlex = 0;
9791045
RenderBox? firstFlexChild;
9801046
_AscentDescent accumulatedAscentDescent = _AscentDescent.none;
981-
_AxisSize accumulatedSize = _AxisSize.empty;
1047+
// Initially, accumulatedSize is the sum of the spaces between children in the main axis.
1048+
_AxisSize accumulatedSize = _AxisSize._(Size(spacing * (childCount - 1), 0.0));
9821049
for (RenderBox? child = firstChild; child != null; child = childAfter(child)) {
9831050
final int flex;
9841051
if (canFlex && (flex = _getFlex(child)) > 0) {
@@ -1064,7 +1131,7 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
10641131
final double remainingSpace = math.max(0.0, sizes.mainAxisFreeSpace);
10651132
final bool flipMainAxis = _flipMainAxis;
10661133
final bool flipCrossAxis = _flipCrossAxis;
1067-
final (double leadingSpace, double betweenSpace) = mainAxisAlignment._distributeSpace(remainingSpace, childCount, flipMainAxis);
1134+
final (double leadingSpace, double betweenSpace) = mainAxisAlignment._distributeSpace(remainingSpace, childCount, flipMainAxis, spacing);
10681135
final (_NextChild nextChild, RenderBox? topLeftChild) = flipMainAxis ? (childBefore, lastChild) : (childAfter, firstChild);
10691136
final double? baselineOffset = sizes.baselineOffset;
10701137
assert(baselineOffset == null || (crossAxisAlignment == CrossAxisAlignment.baseline && direction == Axis.horizontal));
@@ -1192,5 +1259,6 @@ class RenderFlex extends RenderBox with ContainerRenderObjectMixin<RenderBox, Fl
11921259
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
11931260
properties.add(EnumProperty<VerticalDirection>('verticalDirection', verticalDirection, defaultValue: null));
11941261
properties.add(EnumProperty<TextBaseline>('textBaseline', textBaseline, defaultValue: null));
1262+
properties.add(DoubleProperty('spacing', spacing, defaultValue: null));
11951263
}
11961264
}

packages/flutter/lib/src/widgets/basic.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4604,6 +4604,7 @@ class Flex extends MultiChildRenderObjectWidget {
46044604
this.verticalDirection = VerticalDirection.down,
46054605
this.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be
46064606
this.clipBehavior = Clip.none,
4607+
this.spacing = 0.0,
46074608
super.children,
46084609
}) : assert(!identical(crossAxisAlignment, CrossAxisAlignment.baseline) || textBaseline != null, 'textBaseline is required if you specify the crossAxisAlignment with CrossAxisAlignment.baseline');
46094610
// Cannot use == in the assert above instead of identical because of https://github.com/dart-lang/language/issues/1811.
@@ -4710,6 +4711,9 @@ class Flex extends MultiChildRenderObjectWidget {
47104711
/// Defaults to [Clip.none].
47114712
final Clip clipBehavior;
47124713

4714+
/// {@macro flutter.rendering.RenderFlex.spacing}
4715+
final double spacing;
4716+
47134717
bool get _needTextDirection {
47144718
switch (direction) {
47154719
case Axis.horizontal:
@@ -4751,6 +4755,7 @@ class Flex extends MultiChildRenderObjectWidget {
47514755
verticalDirection: verticalDirection,
47524756
textBaseline: textBaseline,
47534757
clipBehavior: clipBehavior,
4758+
spacing: spacing,
47544759
);
47554760
}
47564761

@@ -4764,7 +4769,8 @@ class Flex extends MultiChildRenderObjectWidget {
47644769
..textDirection = getEffectiveTextDirection(context)
47654770
..verticalDirection = verticalDirection
47664771
..textBaseline = textBaseline
4767-
..clipBehavior = clipBehavior;
4772+
..clipBehavior = clipBehavior
4773+
..spacing = spacing;
47684774
}
47694775

47704776
@override
@@ -4777,6 +4783,8 @@ class Flex extends MultiChildRenderObjectWidget {
47774783
properties.add(EnumProperty<TextDirection>('textDirection', textDirection, defaultValue: null));
47784784
properties.add(EnumProperty<VerticalDirection>('verticalDirection', verticalDirection, defaultValue: VerticalDirection.down));
47794785
properties.add(EnumProperty<TextBaseline>('textBaseline', textBaseline, defaultValue: null));
4786+
properties.add(EnumProperty<Clip>('clipBehavior', clipBehavior, defaultValue: Clip.none));
4787+
properties.add(DoubleProperty('spacing', spacing, defaultValue: 0.0));
47804788
}
47814789
}
47824790

@@ -4983,6 +4991,7 @@ class Row extends Flex {
49834991
super.textDirection,
49844992
super.verticalDirection,
49854993
super.textBaseline, // NO DEFAULT: we don't know what the text's baseline should be
4994+
super.spacing,
49864995
super.children,
49874996
}) : super(
49884997
direction: Axis.horizontal,
@@ -5174,6 +5183,7 @@ class Column extends Flex {
51745183
super.textDirection,
51755184
super.verticalDirection,
51765185
super.textBaseline,
5186+
super.spacing,
51775187
super.children,
51785188
}) : super(
51795189
direction: Axis.vertical,

0 commit comments

Comments
 (0)