Skip to content

Commit 1f23fa4

Browse files
committed
inset_shadow test [nfc]: Pull PaintPatternPredicate helper outside its test
So we can add another test that uses it.
1 parent d25adc6 commit 1f23fa4

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

test/widgets/inset_shadow_test.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ void main() {
2929
check(childRect).equals(parentRect);
3030
});
3131

32-
testWidgets('render shadow correctly', (tester) async {
33-
PaintPatternPredicate paintGradient({required Rect rect}) {
34-
// This is inspired by
35-
// https://github.com/flutter/flutter/blob/7b5462cc34af903e2f2de4be7540ff858685cdfc/packages/flutter/test/cupertino/route_test.dart#L1449-L1475
36-
return (Symbol methodName, List<dynamic> arguments) {
37-
check(methodName).equals(#drawRect);
38-
check(arguments[0]).isA<Rect>().equals(rect);
39-
// We can't further check [ui.Gradient] because it is opaque:
40-
// https://github.com/flutter/engine/blob/07d01ad1199522fa5889a10c1688c4e1812b6625/lib/ui/painting.dart#L4487
41-
check(arguments[1]).isA<Paint>().shader.isA<ui.Gradient>();
42-
return true;
43-
};
44-
}
32+
PaintPatternPredicate paintGradient({required Rect rect}) {
33+
// This is inspired by
34+
// https://github.com/flutter/flutter/blob/7b5462cc34af903e2f2de4be7540ff858685cdfc/packages/flutter/test/cupertino/route_test.dart#L1449-L1475
35+
return (Symbol methodName, List<dynamic> arguments) {
36+
check(methodName).equals(#drawRect);
37+
check(arguments[0]).isA<Rect>().equals(rect);
38+
// We can't further check [ui.Gradient] because it is opaque:
39+
// https://github.com/flutter/engine/blob/07d01ad1199522fa5889a10c1688c4e1812b6625/lib/ui/painting.dart#L4487
40+
check(arguments[1]).isA<Paint>().shader.isA<ui.Gradient>();
41+
return true;
42+
};
43+
}
4544

45+
testWidgets('render shadow correctly', (tester) async {
4646
await tester.pumpWidget(const Directionality(
4747
textDirection: TextDirection.ltr,
4848
child: Center(

0 commit comments

Comments
 (0)