mirror of
https://github.com/kphanipavan/modal_progress_hud_nsn.git
synced 2025-10-29 06:42:50 -07:00
linting and maintainance
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
## 0.2.1
|
||||
|
||||
- Minor fixes in README file.
|
||||
- Added dartdoc strings.
|
||||
- Fixed most issues to follow dart guidelines.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
- Added support for other platforms.
|
||||
|
||||
@@ -20,7 +20,7 @@ Add the package to your `pubspec.yml` file.
|
||||
|
||||
```yml
|
||||
dependencies:
|
||||
modal_progress_hud_nsn: ^0.2.0
|
||||
modal_progress_hud_nsn: ^0.2.1
|
||||
```
|
||||
|
||||
Next, import the library into your widget.
|
||||
|
||||
@@ -6,9 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
modal_progress_hud_nsn
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
@@ -17,8 +14,3 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
import FlutterMacOS
|
||||
import Foundation
|
||||
|
||||
import modal_progress_hud_nsn
|
||||
|
||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
ModalProgressHudNsnPlugin.register(with: registry.registrar(forPlugin: "ModalProgressHudNsnPlugin"))
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ packages:
|
||||
name: collection
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.16.0"
|
||||
version: "1.15.0"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -56,17 +56,31 @@ packages:
|
||||
name: fake_async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
version: "1.2.0"
|
||||
flutter:
|
||||
dependency: "direct main"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_lints:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.4"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: lints
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -80,7 +94,7 @@ packages:
|
||||
name: material_color_utilities
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.1.4"
|
||||
version: "0.1.3"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -94,14 +108,14 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "0.2.0"
|
||||
version: "0.2.1"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.1"
|
||||
version: "1.8.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -113,7 +127,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.8.2"
|
||||
version: "1.8.1"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -148,14 +162,21 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.9"
|
||||
version: "0.4.8"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vector_math
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.1"
|
||||
sdks:
|
||||
dart: ">=2.17.0-0 <3.0.0"
|
||||
dart: ">=2.14.0 <3.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
|
||||
@@ -25,6 +25,7 @@ dependencies:
|
||||
cupertino_icons: ^1.0.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_lints: ^1.0.4
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
modal_progress_hud_nsn
|
||||
)
|
||||
|
||||
list(APPEND FLUTTER_FFI_PLUGIN_LIST
|
||||
)
|
||||
|
||||
set(PLUGIN_BUNDLED_LIBRARIES)
|
||||
|
||||
foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
@@ -17,8 +14,3 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
|
||||
endforeach(plugin)
|
||||
|
||||
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
|
||||
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
|
||||
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
|
||||
endforeach(ffi_plugin)
|
||||
|
||||
@@ -6,32 +6,32 @@ import 'package:flutter/material.dart';
|
||||
/// Wrap around any widget that makes an async call to show a modal progress
|
||||
/// indicator while the async call is in progress.
|
||||
///
|
||||
/// The progress indicator can be turned on or off using [inAsyncCall]
|
||||
///
|
||||
/// The progress indicator defaults to a [CircularProgressIndicator] but can be
|
||||
/// any kind of widget
|
||||
///
|
||||
/// The progress indicator can be positioned using [offset] otherwise it is
|
||||
/// centered
|
||||
///
|
||||
/// The modal barrier can be dismissed using [dismissible]
|
||||
///
|
||||
/// The color of the modal barrier can be set using [color]
|
||||
///
|
||||
/// The opacity of the modal barrier can be set using [opacity]
|
||||
///
|
||||
/// HUD=Heads Up Display
|
||||
///
|
||||
class ModalProgressHUD extends StatelessWidget {
|
||||
/// A required [bool]to toggle the loading animation.
|
||||
final bool inAsyncCall;
|
||||
|
||||
/// A [double] value which states how opaque the loading overlay should be, defaults to 0.3
|
||||
final double opacity;
|
||||
|
||||
/// A [Color] object which is assigned to the loading barrier, defaults to grey
|
||||
final Color color;
|
||||
|
||||
/// A [Widget] which is shown at the center of the modal loading barrier,
|
||||
/// defaults to the standard android spinny animation.
|
||||
final Widget progressIndicator;
|
||||
|
||||
/// An [Offset] object which is applied to the [progressIndicator] when specified.
|
||||
final Offset? offset;
|
||||
|
||||
/// A [bool] value which sets the `loading screen can be dismissible by tapping on the loading screen` rule.
|
||||
final bool dismissible;
|
||||
|
||||
/// A [Widget] which should be the the widget to be shown behind the loading barrier.
|
||||
final Widget child;
|
||||
|
||||
ModalProgressHUD({
|
||||
const ModalProgressHUD({
|
||||
Key? key,
|
||||
required this.inAsyncCall,
|
||||
this.opacity = 0.3,
|
||||
@@ -47,9 +47,9 @@ class ModalProgressHUD extends StatelessWidget {
|
||||
if (!inAsyncCall) return child;
|
||||
|
||||
Widget layOutProgressIndicator;
|
||||
if (offset == null)
|
||||
if (offset == null) {
|
||||
layOutProgressIndicator = Center(child: progressIndicator);
|
||||
else {
|
||||
} else {
|
||||
layOutProgressIndicator = Positioned(
|
||||
child: progressIndicator,
|
||||
left: offset!.dx,
|
||||
@@ -57,11 +57,11 @@ class ModalProgressHUD extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
return new Stack(
|
||||
return Stack(
|
||||
children: [
|
||||
child,
|
||||
new Opacity(
|
||||
child: new ModalBarrier(dismissible: dismissible, color: color),
|
||||
Opacity(
|
||||
child: ModalBarrier(dismissible: dismissible, color: color),
|
||||
opacity: opacity,
|
||||
),
|
||||
layOutProgressIndicator,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: modal_progress_hud_nsn
|
||||
description: A modal progress indicator widget with Sound Null Safety. A fork of https://github.com/mmcc007/modal_progress_hud
|
||||
version: 0.2.0
|
||||
version: 0.2.1
|
||||
#author: Phani Pavan K
|
||||
homepage: https://github.com/kphanipavan/modal_progress_hud_nsn
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user