fix: desktop notification not (yet?) supported on macos
This commit is contained in:
parent
02c3a9031a
commit
97f7832c27
|
|
@ -30,7 +30,7 @@ class Downloader extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DownloaderState extends State<Downloader> {
|
class _DownloaderState extends State<Downloader> {
|
||||||
final notificationsClient = NotificationsClient();
|
final notificationsClient = Platform.isMacOS ? null : NotificationsClient();
|
||||||
final curlPattern = RegExp("( [0-9.]+%)");
|
final curlPattern = RegExp("( [0-9.]+%)");
|
||||||
late final Stream<double> _progressStream;
|
late final Stream<double> _progressStream;
|
||||||
bool _downloadFinished = false;
|
bool _downloadFinished = false;
|
||||||
|
|
@ -71,7 +71,7 @@ class _DownloaderState extends State<Downloader> {
|
||||||
controller.close();
|
controller.close();
|
||||||
setState(() {
|
setState(() {
|
||||||
_downloadFinished = true;
|
_downloadFinished = true;
|
||||||
notificationsClient.notify(
|
notificationsClient?.notify(
|
||||||
_cancelled
|
_cancelled
|
||||||
? context.t('Download cancelled')
|
? context.t('Download cancelled')
|
||||||
: context.t('Download complete'),
|
: context.t('Download complete'),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue