From 97f7832c279b20a3e3d29393aedd5c1f9cd345d8 Mon Sep 17 00:00:00 2001 From: Yannick Mauray Date: Thu, 27 Jun 2024 20:48:05 +0200 Subject: [PATCH] fix: desktop notification not (yet?) supported on macos --- lib/src/pages/downloader.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/src/pages/downloader.dart b/lib/src/pages/downloader.dart index adb1062..9505e48 100644 --- a/lib/src/pages/downloader.dart +++ b/lib/src/pages/downloader.dart @@ -30,7 +30,7 @@ class Downloader extends StatefulWidget { } class _DownloaderState extends State { - final notificationsClient = NotificationsClient(); + final notificationsClient = Platform.isMacOS ? null : NotificationsClient(); final curlPattern = RegExp("( [0-9.]+%)"); late final Stream _progressStream; bool _downloadFinished = false; @@ -71,7 +71,7 @@ class _DownloaderState extends State { controller.close(); setState(() { _downloadFinished = true; - notificationsClient.notify( + notificationsClient?.notify( _cancelled ? context.t('Download cancelled') : context.t('Download complete'),