mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Fix Border.symmetric: phase 3 (#62471)
This removes the (now unused) `invertMeaningOfVerticalAndHorizontal` flag. Fixes https://github.com/flutter/flutter/issues/61470
This commit is contained in:
parent
3a5a3eaf68
commit
da62b6ded2
@ -330,25 +330,19 @@ class Border extends BoxBorder {
|
|||||||
|
|
||||||
/// Creates a border with symmetrical vertical and horizontal sides.
|
/// Creates a border with symmetrical vertical and horizontal sides.
|
||||||
///
|
///
|
||||||
/// All arguments default to [BorderSide.none] and must not be null.
|
/// The `vertical` argument applies to the [left] and [right] sides, and the
|
||||||
|
/// `horizontal` argument applies to the [top] and [bottom] sides.
|
||||||
///
|
///
|
||||||
/// If the `invertMeaningOfVerticalAndHorizontal` argument is set to true,
|
/// All arguments default to [BorderSide.none] and must not be null.
|
||||||
/// then the `vertical` argument will apply to the top and bottom borders, and
|
|
||||||
/// the `horizontal` argument will apply to the left and right borders. This
|
|
||||||
/// is not consistent with the use of "vertical" and "horizontal" elsewhere in
|
|
||||||
/// the framework, so callers are discouraged from overriding the default
|
|
||||||
/// value of that argument. In a future change, the argument will be removed.
|
|
||||||
const Border.symmetric({
|
const Border.symmetric({
|
||||||
BorderSide vertical = BorderSide.none,
|
BorderSide vertical = BorderSide.none,
|
||||||
BorderSide horizontal = BorderSide.none,
|
BorderSide horizontal = BorderSide.none,
|
||||||
bool invertMeaningOfVerticalAndHorizontal = false,
|
|
||||||
}) : assert(vertical != null),
|
}) : assert(vertical != null),
|
||||||
assert(horizontal != null),
|
assert(horizontal != null),
|
||||||
assert(invertMeaningOfVerticalAndHorizontal != null),
|
left = vertical,
|
||||||
left = invertMeaningOfVerticalAndHorizontal ? horizontal : vertical,
|
top = horizontal,
|
||||||
top = invertMeaningOfVerticalAndHorizontal ? vertical : horizontal,
|
right = vertical,
|
||||||
right = invertMeaningOfVerticalAndHorizontal ? horizontal : vertical,
|
bottom = horizontal;
|
||||||
bottom = invertMeaningOfVerticalAndHorizontal ? vertical : horizontal;
|
|
||||||
|
|
||||||
/// A uniform border with all sides the same color and width.
|
/// A uniform border with all sides the same color and width.
|
||||||
///
|
///
|
||||||
|
@ -35,15 +35,6 @@ void main() {
|
|||||||
expect(border.top, same(side2));
|
expect(border.top, same(side2));
|
||||||
expect(border.right, same(side1));
|
expect(border.right, same(side1));
|
||||||
expect(border.bottom, same(side2));
|
expect(border.bottom, same(side2));
|
||||||
const Border border2 = Border.symmetric(
|
|
||||||
vertical: side1,
|
|
||||||
horizontal: side2,
|
|
||||||
invertMeaningOfVerticalAndHorizontal: true,
|
|
||||||
);
|
|
||||||
expect(border2.left, same(side2));
|
|
||||||
expect(border2.top, same(side1));
|
|
||||||
expect(border2.right, same(side2));
|
|
||||||
expect(border2.bottom, same(side1));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Border.merge', () {
|
test('Border.merge', () {
|
||||||
|
Loading…
Reference in New Issue
Block a user