nc-photos/app/lib/web/notification.dart
2022-04-09 11:25:04 +08:00

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");
}