mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
Rename Border.uniform() -> Border.fromSide() (#30792)
This commit is contained in:
parent
efe744a360
commit
a4ab0321ad
|
@ -317,7 +317,7 @@ class Border extends BoxBorder {
|
|||
/// Creates a border whose sides are all the same.
|
||||
///
|
||||
/// The `side` argument must not be null.
|
||||
const Border.uniform(BorderSide side)
|
||||
const Border.fromBorderSide(BorderSide side)
|
||||
: assert(side != null),
|
||||
top = side,
|
||||
right = side,
|
||||
|
@ -333,7 +333,7 @@ class Border extends BoxBorder {
|
|||
BorderStyle style = BorderStyle.solid,
|
||||
}) {
|
||||
final BorderSide side = BorderSide(color: color, width: width, style: style);
|
||||
return Border.uniform(side);
|
||||
return Border.fromBorderSide(side);
|
||||
}
|
||||
|
||||
/// Creates a [Border] that represents the addition of the two given
|
||||
|
|
|
@ -14,9 +14,9 @@ void main() {
|
|||
});
|
||||
|
||||
test('Border.uniform constructor', () {
|
||||
expect(() => Border.uniform(null), throwsAssertionError);
|
||||
expect(() => Border.fromBorderSide(null), throwsAssertionError);
|
||||
const BorderSide side = BorderSide();
|
||||
const Border border = Border.uniform(side);
|
||||
const Border border = Border.fromBorderSide(side);
|
||||
expect(border.left, same(side));
|
||||
expect(border.top, same(side));
|
||||
expect(border.right, same(side));
|
||||
|
|
Loading…
Reference in a new issue