diff --git a/lib/notification_manager.dart b/lib/notification_manager.dart index 9cddae0..d6c6925 100644 --- a/lib/notification_manager.dart +++ b/lib/notification_manager.dart @@ -16,11 +16,10 @@ class NullNotificationsManager implements NotificationsManager { // the standard dbus-powered linux desktop notifications. class LinuxNotificationsManager implements NotificationsManager { int previous_id = 0; + final NotificationsClient client = NotificationsClient(); LinuxNotificationsManager() {} Future notify(String message) async { - var client = NotificationsClient(); var icon_path = Uri.file(path.join(path.current, "cwtch.png")); client.notify('New Message from Peer!', appName: "cwtch", appIcon: icon_path.toString(), replacesId: this.previous_id).then((Notification value) => previous_id = value.id); - client.close(); } }