Skip to content

Commit da62b6d

Browse files
authored
Fix Border.symmetric: phase 3 (#62471)
This removes the (now unused) `invertMeaningOfVerticalAndHorizontal` flag. Fixes #61470
1 parent 3a5a3ea commit da62b6d

2 files changed

Lines changed: 7 additions & 22 deletions

File tree

‎packages/flutter/lib/src/painting/box_border.dart‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -330,25 +330,19 @@ class Border extends BoxBorder {
330330

331331
/// Creates a border with symmetrical vertical and horizontal sides.
332332
///
333-
/// All arguments default to [BorderSide.none] and must not be null.
333+
/// The `vertical` argument applies to the [left] and [right] sides, and the
334+
/// `horizontal` argument applies to the [top] and [bottom] sides.
334335
///
335-
/// If the `invertMeaningOfVerticalAndHorizontal` argument is set to true,
336-
/// then the `vertical` argument will apply to the top and bottom borders, and
337-
/// the `horizontal` argument will apply to the left and right borders. This
338-
/// is not consistent with the use of "vertical" and "horizontal" elsewhere in
339-
/// the framework, so callers are discouraged from overriding the default
340-
/// value of that argument. In a future change, the argument will be removed.
336+
/// All arguments default to [BorderSide.none] and must not be null.
341337
const Border.symmetric({
342338
BorderSide vertical = BorderSide.none,
343339
BorderSide horizontal = BorderSide.none,
344-
bool invertMeaningOfVerticalAndHorizontal = false,
345340
}) : assert(vertical != null),
346341
assert(horizontal != null),
347-
assert(invertMeaningOfVerticalAndHorizontal != null),
348-
left = invertMeaningOfVerticalAndHorizontal ? horizontal : vertical,
349-
top = invertMeaningOfVerticalAndHorizontal ? vertical : horizontal,
350-
right = invertMeaningOfVerticalAndHorizontal ? horizontal : vertical,
351-
bottom = invertMeaningOfVerticalAndHorizontal ? vertical : horizontal;
342+
left = vertical,
343+
top = horizontal,
344+
right = vertical,
345+
bottom = horizontal;
352346

353347
/// A uniform border with all sides the same color and width.
354348
///

‎packages/flutter/test/painting/border_test.dart‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,6 @@ void main() {
3535
expect(border.top, same(side2));
3636
expect(border.right, same(side1));
3737
expect(border.bottom, same(side2));
38-
const Border border2 = Border.symmetric(
39-
vertical: side1,
40-
horizontal: side2,
41-
invertMeaningOfVerticalAndHorizontal: true,
42-
);
43-
expect(border2.left, same(side2));
44-
expect(border2.top, same(side1));
45-
expect(border2.right, same(side2));
46-
expect(border2.bottom, same(side1));
4738
});
4839

4940
test('Border.merge', () {

0 commit comments

Comments
 (0)