From 56daf1b9402847da85c034bfc565be76c386b977 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 22 Jan 2026 16:27:41 +0100 Subject: [PATCH] added localization and permission error snackbar --- lib/service/notifying.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/service/notifying.dart b/lib/service/notifying.dart index bb8838a..8e12162 100644 --- a/lib/service/notifying.dart +++ b/lib/service/notifying.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; +import '../l10n/app_localizations.dart'; import 'url_launcher.dart' show UrlLaunchErrorCode; class Notifying { @@ -46,10 +47,18 @@ class Notifying { if (errorCode == UrlLaunchErrorCode.none) { return; } else if (errorCode == UrlLaunchErrorCode.couldNotLaunch) { - errorText = 'Could not launch Url'; + errorText = AppLocalizations.of(context)!.errorCouldNotLaunchUrl; } else { - errorText = 'Invalid Url'; + errorText = AppLocalizations.of(context)!.errorInvalidUrl; } showSnackbar(context, text: errorText, isError: true); } + + static void showStoragePermissionErrorSnackbar(BuildContext context) { + showSnackbar( + context, + text: AppLocalizations.of(context)!.errorStoragePermisson, + isError: true, + ); + } }