linting and maintainance

This commit is contained in:
Phani Pavan Kambhampati
2022-05-31 17:36:31 +05:30
parent 0b3f4bdf05
commit e830aba3cd
10 changed files with 72 additions and 59 deletions

View File

@@ -1,5 +1,4 @@
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';
@@ -7,17 +6,17 @@ void main() {
group('Modal Progress HUD', () {
Widget sut(bool inAsyncCall, Offset? offset) {
return MaterialApp(
home: new ModalProgressHUD(
home: ModalProgressHUD(
inAsyncCall: inAsyncCall,
offset: offset,
child: Text(''),
child: const Text(''),
),
);
}
testWidgets('should show progress indicator when in async call',
(tester) async {
final inAsyncCall = true;
const inAsyncCall = true;
await tester.pumpWidget(sut(inAsyncCall, null));
expect(find.byType(Text), findsOneWidget);
@@ -26,7 +25,7 @@ void main() {
testWidgets('should not show progress indicator when not in async call',
(tester) async {
final inAsyncCall = false;
const inAsyncCall = false;
await tester.pumpWidget(sut(inAsyncCall, null));
expect(find.byType(Text), findsOneWidget);
@@ -35,8 +34,8 @@ void main() {
testWidgets('should allow positioning of progress indicator',
(tester) async {
final inAsyncCall = true;
final offset = Offset(0.1, 0.1);
const inAsyncCall = true;
const offset = Offset(0.1, 0.1);
await tester.pumpWidget(sut(inAsyncCall, offset));
expect(find.byType(Positioned), findsOneWidget);
@@ -44,4 +43,4 @@ void main() {
expect(find.byType(CircularProgressIndicator), findsOneWidget);
});
});
}
}