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

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

View file

@ -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(),
);
}