refactor: update formatting

This commit is contained in:
edde746
2025-12-15 02:29:03 +01:00
parent e072960d36
commit 3c89d0eba8
175 changed files with 14599 additions and 15569 deletions
+3 -16
View File
@@ -20,12 +20,7 @@ enum SnackBarType {
/// [message] The message to display
/// [type] The type of snackbar (info, success, error)
/// [duration] Optional duration override
void showSnackBar(
BuildContext context,
String message, {
SnackBarType type = SnackBarType.info,
Duration? duration,
}) {
void showSnackBar(BuildContext context, String message, {SnackBarType type = SnackBarType.info, Duration? duration}) {
if (!context.mounted) return;
final (backgroundColor, defaultDuration) = switch (type) {
@@ -35,11 +30,7 @@ void showSnackBar(
};
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(message),
backgroundColor: backgroundColor,
duration: duration ?? defaultDuration,
),
SnackBar(content: Text(message), backgroundColor: backgroundColor, duration: duration ?? defaultDuration),
);
}
@@ -48,11 +39,7 @@ void showSnackBar(
/// [context] The build context
/// [message] The message to display
/// [duration] Optional duration, defaults to 3 seconds
void showAppSnackBar(
BuildContext context,
String message, {
Duration? duration,
}) {
void showAppSnackBar(BuildContext context, String message, {Duration? duration}) {
showSnackBar(context, message, type: SnackBarType.info, duration: duration);
}