Showing
1 changed file
with
15 additions
and
8 deletions
| @@ -2,10 +2,17 @@ import 'package:flutter/widgets.dart'; | @@ -2,10 +2,17 @@ import 'package:flutter/widgets.dart'; | ||
| 2 | import 'package:flutter_test/flutter_test.dart'; | 2 | import 'package:flutter_test/flutter_test.dart'; |
| 3 | import 'package:get/utils.dart'; | 3 | import 'package:get/utils.dart'; |
| 4 | 4 | ||
| 5 | +class Foo extends StatelessWidget { | ||
| 6 | + @override | ||
| 7 | + Widget build(BuildContext context) { | ||
| 8 | + return SizedBox.shrink(); | ||
| 9 | + } | ||
| 10 | +} | ||
| 11 | + | ||
| 5 | void main() { | 12 | void main() { |
| 6 | group('Group test for PaddingX Extension', () { | 13 | group('Group test for PaddingX Extension', () { |
| 7 | testWidgets('Test of paddingAll', (tester) async { | 14 | testWidgets('Test of paddingAll', (tester) async { |
| 8 | - Widget containerTest = Container(); | 15 | + Widget containerTest = Foo(); |
| 9 | 16 | ||
| 10 | expect(find.byType(Padding), findsNothing); | 17 | expect(find.byType(Padding), findsNothing); |
| 11 | 18 | ||
| @@ -15,7 +22,7 @@ void main() { | @@ -15,7 +22,7 @@ void main() { | ||
| 15 | }); | 22 | }); |
| 16 | 23 | ||
| 17 | testWidgets('Test of paddingOnly', (tester) async { | 24 | testWidgets('Test of paddingOnly', (tester) async { |
| 18 | - Widget containerTest = Container(); | 25 | + Widget containerTest = Foo(); |
| 19 | 26 | ||
| 20 | expect(find.byType(Padding), findsNothing); | 27 | expect(find.byType(Padding), findsNothing); |
| 21 | 28 | ||
| @@ -25,7 +32,7 @@ void main() { | @@ -25,7 +32,7 @@ void main() { | ||
| 25 | }); | 32 | }); |
| 26 | 33 | ||
| 27 | testWidgets('Test of paddingSymmetric', (tester) async { | 34 | testWidgets('Test of paddingSymmetric', (tester) async { |
| 28 | - Widget containerTest = Container(); | 35 | + Widget containerTest = Foo(); |
| 29 | 36 | ||
| 30 | expect(find.byType(Padding), findsNothing); | 37 | expect(find.byType(Padding), findsNothing); |
| 31 | 38 | ||
| @@ -35,7 +42,7 @@ void main() { | @@ -35,7 +42,7 @@ void main() { | ||
| 35 | }); | 42 | }); |
| 36 | 43 | ||
| 37 | testWidgets('Test of paddingZero', (tester) async { | 44 | testWidgets('Test of paddingZero', (tester) async { |
| 38 | - Widget containerTest = Container(); | 45 | + Widget containerTest = Foo(); |
| 39 | 46 | ||
| 40 | expect(find.byType(Padding), findsNothing); | 47 | expect(find.byType(Padding), findsNothing); |
| 41 | 48 | ||
| @@ -47,7 +54,7 @@ void main() { | @@ -47,7 +54,7 @@ void main() { | ||
| 47 | 54 | ||
| 48 | group('Group test for MarginX Extension', () { | 55 | group('Group test for MarginX Extension', () { |
| 49 | testWidgets('Test of marginAll', (tester) async { | 56 | testWidgets('Test of marginAll', (tester) async { |
| 50 | - Widget containerTest = Container(); | 57 | + Widget containerTest = Foo(); |
| 51 | 58 | ||
| 52 | await tester.pumpWidget(containerTest.marginAll(16)); | 59 | await tester.pumpWidget(containerTest.marginAll(16)); |
| 53 | 60 | ||
| @@ -55,7 +62,7 @@ void main() { | @@ -55,7 +62,7 @@ void main() { | ||
| 55 | }); | 62 | }); |
| 56 | 63 | ||
| 57 | testWidgets('Test of marginOnly', (tester) async { | 64 | testWidgets('Test of marginOnly', (tester) async { |
| 58 | - Widget containerTest = Container(); | 65 | + Widget containerTest = Foo(); |
| 59 | 66 | ||
| 60 | await tester.pumpWidget(containerTest.marginOnly(top: 16)); | 67 | await tester.pumpWidget(containerTest.marginOnly(top: 16)); |
| 61 | 68 | ||
| @@ -63,7 +70,7 @@ void main() { | @@ -63,7 +70,7 @@ void main() { | ||
| 63 | }); | 70 | }); |
| 64 | 71 | ||
| 65 | testWidgets('Test of marginSymmetric', (tester) async { | 72 | testWidgets('Test of marginSymmetric', (tester) async { |
| 66 | - Widget containerTest = Container(); | 73 | + Widget containerTest = Foo(); |
| 67 | 74 | ||
| 68 | await tester.pumpWidget(containerTest.marginSymmetric(vertical: 16)); | 75 | await tester.pumpWidget(containerTest.marginSymmetric(vertical: 16)); |
| 69 | 76 | ||
| @@ -71,7 +78,7 @@ void main() { | @@ -71,7 +78,7 @@ void main() { | ||
| 71 | }); | 78 | }); |
| 72 | 79 | ||
| 73 | testWidgets('Test of marginZero', (tester) async { | 80 | testWidgets('Test of marginZero', (tester) async { |
| 74 | - Widget containerTest = Container(); | 81 | + Widget containerTest = Foo(); |
| 75 | 82 | ||
| 76 | await tester.pumpWidget(containerTest.marginZero); | 83 | await tester.pumpWidget(containerTest.marginZero); |
| 77 | 84 |
-
Please register or login to post a comment