mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
28 lines
886 B
Dart
28 lines
886 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:logging/logging.dart';
|
|
import 'package:nc_photos/app_localizations.dart';
|
|
import 'package:nc_photos/k.dart' as k;
|
|
import 'package:nc_photos/platform/notification.dart' as itf;
|
|
import 'package:nc_photos/snack_bar_manager.dart';
|
|
|
|
class NotificationManager implements itf.NotificationManager {
|
|
@override
|
|
notify(itf.Notification n) async {
|
|
if (n is itf.LogSaveSuccessfulNotification) {
|
|
SnackBarManager().showSnackBar(SnackBar(
|
|
content: Text(L10n.global().downloadSuccessNotification),
|
|
duration: k.snackBarDurationShort,
|
|
));
|
|
} else {
|
|
_log.shout("[notify] Unknown type: ${n.runtimeType}");
|
|
throw UnsupportedError("Unsupported notification");
|
|
}
|
|
}
|
|
|
|
@override
|
|
dismiss(dynamic id) async {
|
|
return;
|
|
}
|
|
|
|
static final _log = Logger("web.notification.NotificationManager");
|
|
}
|