diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index ed743d5..ca9e7ab 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_android-1.0.52/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false}],"macos":[{"name":"app_settings","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_darwin-1.6.0/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[],"windows":[{"name":"local_auth_windows","path":"/Users/yaso_meth/.pub-cache/hosted/pub.dev/local_auth_windows-1.0.11/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]}],"date_created":"2026-05-15 14:10:43.594834","version":"3.41.9","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"app_settings","path":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/yaso/.pub-cache/hosted/pub.dev/local_auth_darwin-2.0.3/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"android":[{"name":"app_settings","path":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"flutter_plugin_android_lifecycle","path":"/home/yaso/.pub-cache/hosted/pub.dev/flutter_plugin_android_lifecycle-2.0.31/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_android","path":"/home/yaso/.pub-cache/hosted/pub.dev/local_auth_android-2.0.9/","native_build":true,"dependencies":["flutter_plugin_android_lifecycle"],"dev_dependency":false}],"macos":[{"name":"app_settings","path":"/home/yaso/.pub-cache/hosted/pub.dev/app_settings-7.0.0/","native_build":true,"dependencies":[],"dev_dependency":false},{"name":"local_auth_darwin","path":"/home/yaso/.pub-cache/hosted/pub.dev/local_auth_darwin-2.0.3/","shared_darwin_source":true,"native_build":true,"dependencies":[],"dev_dependency":false}],"linux":[],"windows":[{"name":"local_auth_windows","path":"/home/yaso/.pub-cache/hosted/pub.dev/local_auth_windows-2.0.1/","native_build":true,"dependencies":[],"dev_dependency":false}],"web":[]},"dependencyGraph":[{"name":"app_settings","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"local_auth","dependencies":["local_auth_android","local_auth_darwin","local_auth_windows"]},{"name":"local_auth_android","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"local_auth_darwin","dependencies":[]},{"name":"local_auth_windows","dependencies":[]}],"date_created":"2026-07-03 08:38:52.326386","version":"3.44.4","swift_package_manager_enabled":{"ios":false,"macos":false}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2aafee1..1310c4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 0.1.0 + +* Enhance `MihSnackBar` to disappear after 2 seconds bu defaults & add close icon and remove dissmiss button. + ## 0.0.6 * Fix null value error thrown in `MihPackageWindow` while in full screen mode. diff --git a/example/android/gradle.properties b/example/android/gradle.properties index f018a61..475a628 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,7 @@ org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true +# This builtInKotlin flag was added automatically by Flutter migrator +android.builtInKotlin=false +# This newDsl flag was added automatically by Flutter migrator +android.newDsl=false diff --git a/example/lib/main.dart b/example/lib/main.dart index 9e9caa9..d2c4c9d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -116,6 +116,21 @@ class _ExampleMihPackageState extends State { buttonColor: MihColors.green(), child: Text("Press"), ), + MihButton( + width: 300, + onPressed: () { + ScaffoldMessenger.of(context).showSnackBar( + MihSnackBar( + child: Text("Tester"), + duration: 2, + backgroundColor: MihColors.secondary(), + closeIconColor: MihColors.red(), + ), + ); + }, + buttonColor: MihColors.green(), + child: Text("Snack Test"), + ), ], ), ), diff --git a/example/pubspec.lock b/example/pubspec.lock index 8080e11..9ccbeea 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -143,26 +143,26 @@ packages: dependency: transitive description: name: local_auth - sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b" + sha256: ae6f382f638108c6becd134318d7c3f0a93875383a54010f61d7c97ac05d5137 url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "3.0.1" local_auth_android: dependency: transitive description: name: local_auth_android - sha256: "48924f4a8b3cc45994ad5993e2e232d3b00788a305c1bf1c7db32cef281ce9a3" + sha256: fdb936d59ab945c7af297defd67bd1ed87b11b6db1bc16d01e94677a8f1c38ec url: "https://pub.dev" source: hosted - version: "1.0.52" + version: "2.0.9" local_auth_darwin: dependency: transitive description: name: local_auth_darwin - sha256: "0e9706a8543a4a2eee60346294d6a633dd7c3ee60fae6b752570457c4ff32055" + sha256: a8c3d4e17454111f7fd31ff72a31222359f6059f7fe956c2dcfe0f88f49826d4 url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.0.3" local_auth_platform_interface: dependency: transitive description: @@ -175,10 +175,10 @@ packages: dependency: transitive description: name: local_auth_windows - sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5 + sha256: be12c5b8ba5e64896983123655c5f67d2484ecfcc95e367952ad6e3bff94cb16 url: "https://pub.dev" source: hosted - version: "1.0.11" + version: "2.0.1" matcher: dependency: transitive description: @@ -199,17 +199,17 @@ packages: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" mih_package_toolkit: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.0.6" + version: "0.1.0" path: dependency: transitive description: @@ -275,10 +275,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.11" vector_math: dependency: transitive description: @@ -296,5 +296,5 @@ packages: source: hosted version: "15.0.0" sdks: - dart: ">=3.9.0-0 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/lib/src/mih_package_tile.dart b/lib/src/mih_package_tile.dart index eac26ce..372cf58 100644 --- a/lib/src/mih_package_tile.dart +++ b/lib/src/mih_package_tile.dart @@ -94,7 +94,7 @@ class _MihPackageTileState extends State { try { final bool didBioAuth = await _auth.authenticate( localizedReason: "Authenticate to access ${widget.packageName}", - options: const AuthenticationOptions(biometricOnly: false), + biometricOnly: false, ); if (didBioAuth) { return true; diff --git a/lib/src/mih_snack_bar.dart b/lib/src/mih_snack_bar.dart index 42214e1..198b67d 100644 --- a/lib/src/mih_snack_bar.dart +++ b/lib/src/mih_snack_bar.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:mih_package_toolkit/src/mih_colors.dart'; /// A helper function to generate a standardized MIH-styled SnackBar. /// @@ -16,20 +17,32 @@ import 'package:flutter/material.dart'; /// ```dart /// ScaffoldMessenger.of(context).showSnackBar( /// MihSnackBar( -/// backgroundColor: Colors.blue, +/// duration: 2, +/// backgroundColor: MihColors.secondary(), +/// closeIconColor: MihColors.red(), /// child: Text("Data saved successfully!"), /// ), /// ); /// ``` // ignore: non_constant_identifier_names -SnackBar MihSnackBar({Color? backgroundColor, required Widget child}) { +SnackBar MihSnackBar({ + int? duration, + Color? backgroundColor, + bool? showCloseIcon, + Color? closeIconColor, + SnackBarAction? action, + required Widget child, +}) { return SnackBar( - backgroundColor: backgroundColor, + backgroundColor: backgroundColor ?? MihColors.secondary(), content: child, shape: StadiumBorder(), behavior: SnackBarBehavior.floating, - duration: Duration(seconds: 2), + duration: Duration(seconds: duration ?? 2), + persist: false, width: null, - action: SnackBarAction(label: "Dismiss", onPressed: () {}), + action: action, + showCloseIcon: showCloseIcon ?? true, + closeIconColor: closeIconColor ?? MihColors.red(), ); } diff --git a/pubspec.lock b/pubspec.lock index 06e1814..1c8a814 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -66,10 +66,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -127,34 +127,34 @@ packages: dependency: transitive description: name: lints - sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "6.1.0" local_auth: dependency: "direct main" description: name: local_auth - sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b" + sha256: ae6f382f638108c6becd134318d7c3f0a93875383a54010f61d7c97ac05d5137 url: "https://pub.dev" source: hosted - version: "2.3.0" + version: "3.0.1" local_auth_android: dependency: transitive description: name: local_auth_android - sha256: "48924f4a8b3cc45994ad5993e2e232d3b00788a305c1bf1c7db32cef281ce9a3" + sha256: fdb936d59ab945c7af297defd67bd1ed87b11b6db1bc16d01e94677a8f1c38ec url: "https://pub.dev" source: hosted - version: "1.0.52" + version: "2.0.9" local_auth_darwin: dependency: transitive description: name: local_auth_darwin - sha256: "0e9706a8543a4a2eee60346294d6a633dd7c3ee60fae6b752570457c4ff32055" + sha256: a8c3d4e17454111f7fd31ff72a31222359f6059f7fe956c2dcfe0f88f49826d4 url: "https://pub.dev" source: hosted - version: "1.6.0" + version: "2.0.3" local_auth_platform_interface: dependency: transitive description: @@ -167,10 +167,10 @@ packages: dependency: transitive description: name: local_auth_windows - sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5 + sha256: be12c5b8ba5e64896983123655c5f67d2484ecfcc95e367952ad6e3bff94cb16 url: "https://pub.dev" source: hosted - version: "1.0.11" + version: "2.0.1" matcher: dependency: transitive description: @@ -191,10 +191,10 @@ packages: dependency: transitive description: name: meta - sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.18.0" path: dependency: transitive description: @@ -260,10 +260,10 @@ packages: dependency: transitive description: name: test_api - sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.10" + version: "0.7.11" vector_math: dependency: transitive description: @@ -281,5 +281,5 @@ packages: source: hosted version: "15.0.0" sdks: - dart: ">=3.9.0-0 <4.0.0" - flutter: ">=3.29.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/pubspec.yaml b/pubspec.yaml index a8a5b0f..5231fcd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: mih_package_toolkit description: "A comprehensive UI toolkit and utility library for building consistent MIH Packages within the MIH Project ecosystem." -version: 0.0.6 +version: 0.1.0 homepage: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit repository: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit issue_tracker: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit/issues @@ -22,12 +22,12 @@ dependencies: sdk: flutter flutter_speed_dial: ^7.0.0 app_settings: ^7.0.0 - local_auth: ^2.3.0 + local_auth: ^3.0.1 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^5.0.0 + flutter_lints: ^6.0.0 flutter: fonts: