import 'package:flutter/foundation.dart'; import 'package:local_notifier/local_notifier.dart'; const _appName = "AppFlowy"; /// Manages Local Notifications /// /// Currently supports: /// - MacOS /// - Windows /// - Linux /// class NotificationService { static Future initialize() async { await localNotifier.setup( appName: _appName, shortcutPolicy: ShortcutPolicy.requireCreate, // Windows Specific ); } } /// Creates and shows a Notification /// class NotificationMessage { NotificationMessage({ required String title, required String body, String? identifier, VoidCallback? onClick, }) { _notification = LocalNotification( identifier: identifier, title: title, body: body, )..onClick = onClick; _show(); } late final LocalNotification _notification; void _show() => _notification.show(); }