Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
4195ad4e
Unverified
Commit
4195ad4e
authored
Jul 14, 2020
by
Todd Volkert
Committed by
GitHub
Jul 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Border.symmetric: phase 1 (#61474)
parent
9f4499f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
box_border.dart
packages/flutter/lib/src/painting/box_border.dart
+17
-4
border_test.dart
packages/flutter/test/painting/border_test.dart
+9
-0
No files found.
packages/flutter/lib/src/painting/box_border.dart
View file @
4195ad4e
...
...
@@ -331,15 +331,28 @@ class Border extends BoxBorder {
/// Creates a border with symmetrical vertical and horizontal sides.
///
/// All arguments default to [BorderSide.none] and must not be null.
///
/// Currently, 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 the
/// `invertMeaningOfVerticalAndHorizontal` argument exists to facilitate
/// the transition of this constructor to using the correct semantics of
/// these arguments. Callers are encouraged to pass false to that argument
/// to get the correct semantics. In a future change, the default value of
/// the argument will be changed to false, followed by the removal of the
/// argument altogether.
const
Border
.
symmetric
({
BorderSide
vertical
=
BorderSide
.
none
,
BorderSide
horizontal
=
BorderSide
.
none
,
bool
invertMeaningOfVerticalAndHorizontal
=
true
,
})
:
assert
(
vertical
!=
null
),
assert
(
horizontal
!=
null
),
left
=
horizontal
,
top
=
vertical
,
right
=
horizontal
,
bottom
=
vertical
;
assert
(
invertMeaningOfVerticalAndHorizontal
!=
null
),
left
=
invertMeaningOfVerticalAndHorizontal
?
horizontal
:
vertical
,
top
=
invertMeaningOfVerticalAndHorizontal
?
vertical
:
horizontal
,
right
=
invertMeaningOfVerticalAndHorizontal
?
horizontal
:
vertical
,
bottom
=
invertMeaningOfVerticalAndHorizontal
?
vertical
:
horizontal
;
/// A uniform border with all sides the same color and width.
///
...
...
packages/flutter/test/painting/border_test.dart
View file @
4195ad4e
...
...
@@ -35,6 +35,15 @@ void main() {
expect
(
border
.
top
,
same
(
side1
));
expect
(
border
.
right
,
same
(
side2
));
expect
(
border
.
bottom
,
same
(
side1
));
const
Border
border2
=
Border
.
symmetric
(
vertical:
side1
,
horizontal:
side2
,
invertMeaningOfVerticalAndHorizontal:
false
,
);
expect
(
border2
.
left
,
same
(
side1
));
expect
(
border2
.
top
,
same
(
side2
));
expect
(
border2
.
right
,
same
(
side1
));
expect
(
border2
.
bottom
,
same
(
side2
));
});
test
(
'Border.merge'
,
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment