Use EdgeInsetsGeometry instead of EdgeInsets (#40775)

This commit is contained in:
Ori Schwartz
2019-10-02 18:31:39 -04:00
committed by Michael Goderbauer
parent 0b0942a60c
commit f8310d89e8
2 changed files with 9 additions and 1 deletions

View File

@@ -178,7 +178,7 @@ class ShapeDecoration extends Decoration {
///
/// This value may be misleading. See the discussion at [ShapeBorder.dimensions].
@override
EdgeInsets get padding => shape.dimensions;
EdgeInsetsGeometry get padding => shape.dimensions;
@override
bool get isComplex => shadows != null;

View File

@@ -61,6 +61,14 @@ Future<void> main() async {
);
}, skip: isBrowser);
test('ShapeDecoration with BorderDirectional', () {
const ShapeDecoration decoration = ShapeDecoration(
shape: BorderDirectional(start: BorderSide(color: Colors.red, width: 3)),
);
expect(decoration.padding, isInstanceOf<EdgeInsetsDirectional>());
});
testWidgets('TestBorder and Directionality - 1', (WidgetTester tester) async {
final List<String> log = <String>[];
await tester.pumpWidget(