Rename Border.uniform() -> Border.fromSide() (#30792)

This commit is contained in:
Todd Volkert 2019-04-17 10:58:42 -07:00 committed by GitHub
parent efe744a360
commit a4ab0321ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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));