fix snackbar persistance, update dependancies

This commit is contained in:
yaso 2026-07-03 09:34:35 +02:00
parent 5a91d1e98e
commit 303022a352
9 changed files with 79 additions and 43 deletions

View file

@ -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}} {"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}}

View file

@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file. 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 ## 0.0.6
* Fix null value error thrown in `MihPackageWindow` while in full screen mode. * Fix null value error thrown in `MihPackageWindow` while in full screen mode.

View file

@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true android.useAndroidX=true
android.enableJetifier=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

View file

@ -116,6 +116,21 @@ class _ExampleMihPackageState extends State<ExampleMihPackage> {
buttonColor: MihColors.green(), buttonColor: MihColors.green(),
child: Text("Press"), 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"),
),
], ],
), ),
), ),

View file

@ -143,26 +143,26 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: local_auth name: local_auth
sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b" sha256: ae6f382f638108c6becd134318d7c3f0a93875383a54010f61d7c97ac05d5137
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.0" version: "3.0.1"
local_auth_android: local_auth_android:
dependency: transitive dependency: transitive
description: description:
name: local_auth_android name: local_auth_android
sha256: "48924f4a8b3cc45994ad5993e2e232d3b00788a305c1bf1c7db32cef281ce9a3" sha256: fdb936d59ab945c7af297defd67bd1ed87b11b6db1bc16d01e94677a8f1c38ec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.52" version: "2.0.9"
local_auth_darwin: local_auth_darwin:
dependency: transitive dependency: transitive
description: description:
name: local_auth_darwin name: local_auth_darwin
sha256: "0e9706a8543a4a2eee60346294d6a633dd7c3ee60fae6b752570457c4ff32055" sha256: a8c3d4e17454111f7fd31ff72a31222359f6059f7fe956c2dcfe0f88f49826d4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.6.0" version: "2.0.3"
local_auth_platform_interface: local_auth_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -175,10 +175,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: local_auth_windows name: local_auth_windows
sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5 sha256: be12c5b8ba5e64896983123655c5f67d2484ecfcc95e367952ad6e3bff94cb16
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.11" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -199,17 +199,17 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.0" version: "1.18.0"
mih_package_toolkit: mih_package_toolkit:
dependency: "direct main" dependency: "direct main"
description: description:
path: ".." path: ".."
relative: true relative: true
source: path source: path
version: "0.0.6" version: "0.1.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -275,10 +275,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.10" version: "0.7.11"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -296,5 +296,5 @@ packages:
source: hosted source: hosted
version: "15.0.0" version: "15.0.0"
sdks: sdks:
dart: ">=3.9.0-0 <4.0.0" dart: ">=3.12.0 <4.0.0"
flutter: ">=3.29.0" flutter: ">=3.44.0"

View file

@ -94,7 +94,7 @@ class _MihPackageTileState extends State<MihPackageTile> {
try { try {
final bool didBioAuth = await _auth.authenticate( final bool didBioAuth = await _auth.authenticate(
localizedReason: "Authenticate to access ${widget.packageName}", localizedReason: "Authenticate to access ${widget.packageName}",
options: const AuthenticationOptions(biometricOnly: false), biometricOnly: false,
); );
if (didBioAuth) { if (didBioAuth) {
return true; return true;

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:mih_package_toolkit/src/mih_colors.dart';
/// A helper function to generate a standardized MIH-styled SnackBar. /// A helper function to generate a standardized MIH-styled SnackBar.
/// ///
@ -16,20 +17,32 @@ import 'package:flutter/material.dart';
/// ```dart /// ```dart
/// ScaffoldMessenger.of(context).showSnackBar( /// ScaffoldMessenger.of(context).showSnackBar(
/// MihSnackBar( /// MihSnackBar(
/// backgroundColor: Colors.blue, /// duration: 2,
/// backgroundColor: MihColors.secondary(),
/// closeIconColor: MihColors.red(),
/// child: Text("Data saved successfully!"), /// child: Text("Data saved successfully!"),
/// ), /// ),
/// ); /// );
/// ``` /// ```
// ignore: non_constant_identifier_names // 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( return SnackBar(
backgroundColor: backgroundColor, backgroundColor: backgroundColor ?? MihColors.secondary(),
content: child, content: child,
shape: StadiumBorder(), shape: StadiumBorder(),
behavior: SnackBarBehavior.floating, behavior: SnackBarBehavior.floating,
duration: Duration(seconds: 2), duration: Duration(seconds: duration ?? 2),
persist: false,
width: null, width: null,
action: SnackBarAction(label: "Dismiss", onPressed: () {}), action: action,
showCloseIcon: showCloseIcon ?? true,
closeIconColor: closeIconColor ?? MihColors.red(),
); );
} }

View file

@ -66,10 +66,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: flutter_lints name: flutter_lints
sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.0" version: "6.0.0"
flutter_plugin_android_lifecycle: flutter_plugin_android_lifecycle:
dependency: transitive dependency: transitive
description: description:
@ -127,34 +127,34 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: lints name: lints
sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.1.1" version: "6.1.0"
local_auth: local_auth:
dependency: "direct main" dependency: "direct main"
description: description:
name: local_auth name: local_auth
sha256: "434d854cf478f17f12ab29a76a02b3067f86a63a6d6c4eb8fbfdcfe4879c1b7b" sha256: ae6f382f638108c6becd134318d7c3f0a93875383a54010f61d7c97ac05d5137
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.3.0" version: "3.0.1"
local_auth_android: local_auth_android:
dependency: transitive dependency: transitive
description: description:
name: local_auth_android name: local_auth_android
sha256: "48924f4a8b3cc45994ad5993e2e232d3b00788a305c1bf1c7db32cef281ce9a3" sha256: fdb936d59ab945c7af297defd67bd1ed87b11b6db1bc16d01e94677a8f1c38ec
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.52" version: "2.0.9"
local_auth_darwin: local_auth_darwin:
dependency: transitive dependency: transitive
description: description:
name: local_auth_darwin name: local_auth_darwin
sha256: "0e9706a8543a4a2eee60346294d6a633dd7c3ee60fae6b752570457c4ff32055" sha256: a8c3d4e17454111f7fd31ff72a31222359f6059f7fe956c2dcfe0f88f49826d4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.6.0" version: "2.0.3"
local_auth_platform_interface: local_auth_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -167,10 +167,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: local_auth_windows name: local_auth_windows
sha256: bc4e66a29b0fdf751aafbec923b5bed7ad6ed3614875d8151afe2578520b2ab5 sha256: be12c5b8ba5e64896983123655c5f67d2484ecfcc95e367952ad6e3bff94cb16
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.11" version: "2.0.1"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -191,10 +191,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: meta name: meta
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394" sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.0" version: "1.18.0"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -260,10 +260,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: test_api name: test_api
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a" sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.10" version: "0.7.11"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -281,5 +281,5 @@ packages:
source: hosted source: hosted
version: "15.0.0" version: "15.0.0"
sdks: sdks:
dart: ">=3.9.0-0 <4.0.0" dart: ">=3.12.0 <4.0.0"
flutter: ">=3.29.0" flutter: ">=3.44.0"

View file

@ -1,6 +1,6 @@
name: mih_package_toolkit name: mih_package_toolkit
description: "A comprehensive UI toolkit and utility library for building consistent MIH Packages within the MIH Project ecosystem." 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 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 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 issue_tracker: https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit/issues
@ -22,12 +22,12 @@ dependencies:
sdk: flutter sdk: flutter
flutter_speed_dial: ^7.0.0 flutter_speed_dial: ^7.0.0
app_settings: ^7.0.0 app_settings: ^7.0.0
local_auth: ^2.3.0 local_auth: ^3.0.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter
flutter_lints: ^5.0.0 flutter_lints: ^6.0.0
flutter: flutter:
fonts: fonts: