mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
24 lines
650 B
Dart
24 lines
650 B
Dart
import 'dart:async';
|
|
|
|
import 'package:flutter/services.dart';
|
|
|
|
class DownloadEvent {
|
|
static Stream<DownloadCancelEvent> downloadCancelStream() =>
|
|
_downloadCancelChannel
|
|
.receiveBroadcastStream()
|
|
.map((data) => DownloadCancelEvent(
|
|
data["notificationId"],
|
|
));
|
|
|
|
/// User canceled the download job
|
|
static const exceptionCodeUserCanceled = "userCanceled";
|
|
|
|
static const _downloadCancelChannel = EventChannel(
|
|
"com.nkming.nc_photos/download_event/action_download_cancel");
|
|
}
|
|
|
|
class DownloadCancelEvent {
|
|
const DownloadCancelEvent(this.notificationId);
|
|
|
|
final int notificationId;
|
|
}
|