Initial Commit

This commit is contained in:
Phani Pavan K
2021-02-18 15:11:05 +05:30
commit 56f5210712
92 changed files with 2372 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:modal_progress_hud_nsn/modal_progress_hud_nsn.dart';
void main() {
group('Modal Progress HUD', () {
Widget sut(bool inAsyncCall, Offset offset) {
return MaterialApp(
home: new ModalProgressHUD(
inAsyncCall: inAsyncCall,
offset: offset,
child: Text(''),
),
);
}
testWidgets('should show progress indicator when in async call',
(tester) async {
final inAsyncCall = true;
await tester.pumpWidget(sut(inAsyncCall, null));
expect(find.byType(Text), findsOneWidget);
expect(find.byType(CircularProgressIndicator), findsOneWidget);
});
testWidgets('should not show progress indicator when not in async call',
(tester) async {
final inAsyncCall = false;
await tester.pumpWidget(sut(inAsyncCall, null));
expect(find.byType(Text), findsOneWidget);
expect(find.byType(CircularProgressIndicator), findsNothing);
});
testWidgets('should allow positioning of progress indicator',
(tester) async {
final inAsyncCall = true;
final offset = Offset(0.1, 0.1);
await tester.pumpWidget(sut(inAsyncCall, offset));
expect(find.byType(Positioned), findsOneWidget);
expect(find.byType(Text), findsOneWidget);
expect(find.byType(CircularProgressIndicator), findsOneWidget);
});
});
}