added localization and permission error snackbar

This commit is contained in:
2026-01-22 16:27:41 +01:00
parent 8687b7788b
commit 56daf1b940

View File

@@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../l10n/app_localizations.dart';
import 'url_launcher.dart' show UrlLaunchErrorCode; import 'url_launcher.dart' show UrlLaunchErrorCode;
class Notifying { class Notifying {
@@ -46,10 +47,18 @@ class Notifying {
if (errorCode == UrlLaunchErrorCode.none) { if (errorCode == UrlLaunchErrorCode.none) {
return; return;
} else if (errorCode == UrlLaunchErrorCode.couldNotLaunch) { } else if (errorCode == UrlLaunchErrorCode.couldNotLaunch) {
errorText = 'Could not launch Url'; errorText = AppLocalizations.of(context)!.errorCouldNotLaunchUrl;
} else { } else {
errorText = 'Invalid Url'; errorText = AppLocalizations.of(context)!.errorInvalidUrl;
} }
showSnackbar(context, text: errorText, isError: true); showSnackbar(context, text: errorText, isError: true);
} }
static void showStoragePermissionErrorSnackbar(BuildContext context) {
showSnackbar(
context,
text: AppLocalizations.of(context)!.errorStoragePermisson,
isError: true,
);
}
} }