diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d73df..7a7a5ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -16,4 +22,4 @@ ## 0.0.1 -- Inported code from the parent package, https://github.com/mmcc007/modal_progress_hud +- Inported code from the parent package, https://github.com/mmcc007/modal_progress_hud \ No newline at end of file diff --git a/README.md b/README.md index f1470b7..2127041 100644 --- a/README.md +++ b/README.md @@ -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. @@ -141,4 +141,4 @@ calls (see [flutter/issues/9688](https://github.com/flutter/flutter/issues/9688) ### Issues and feedback Please file [issues](https://github.com/kphanipavan/modal_progress_hud_nsn/issues/new) -to send feedback or report a bug. Thank you! +to send feedback or report a bug. Thank you! \ No newline at end of file diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index f6f1987..d5852c6 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -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 $) 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) diff --git a/example/macos/Flutter/GeneratedPluginRegistrant.swift b/example/macos/Flutter/GeneratedPluginRegistrant.swift index cccf817..9f7cec5 100644 --- a/example/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/example/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,6 +5,8 @@ import FlutterMacOS import Foundation +import modal_progress_hud_nsn func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { + ModalProgressHudNsnPlugin.register(with: registry.registrar(forPlugin: "ModalProgressHudNsnPlugin")) } diff --git a/example/pubspec.lock b/example/pubspec.lock index e3e8dfe..e517f60 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 2fb652c..e45f056 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -25,6 +25,7 @@ dependencies: cupertino_icons: ^1.0.2 dev_dependencies: + flutter_lints: ^1.0.4 flutter_test: sdk: flutter @@ -68,4 +69,4 @@ flutter: # weight: 700 # # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages + # see https://flutter.dev/custom-fonts/#from-packages \ No newline at end of file diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 3951f2f..12eaf93 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -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 $) 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) diff --git a/lib/modal_progress_hud_nsn.dart b/lib/modal_progress_hud_nsn.dart index 1f4da3f..0df2ea0 100644 --- a/lib/modal_progress_hud_nsn.dart +++ b/lib/modal_progress_hud_nsn.dart @@ -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,15 +57,15 @@ 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, ], ); } -} +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index da70a9e..e6f990d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 diff --git a/test/modal_progress_hud_nsn_test.dart b/test/modal_progress_hud_nsn_test.dart index 66aad5e..c5e118a 100644 --- a/test/modal_progress_hud_nsn_test.dart +++ b/test/modal_progress_hud_nsn_test.dart @@ -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); }); }); -} +} \ No newline at end of file