Skip to content

Commit

Permalink
Add '@pragma('vm:entry-point')' to download callbacks (fixes #433)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmshrv committed Apr 24, 2023
1 parent 26754a7 commit a0b4816
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/components/DownloadsScreen/current_downloads_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class _CurrentDownloadsListState extends State<CurrentDownloadsList> {
super.dispose();
}

// https://github.com/fluttercommunity/flutter_downloader/issues/629
@pragma('vm:entry-point')
static void downloadCallback(String id, int status, int progress) {
final SendPort? send =
IsolateNameServer.lookupPortByName('downloader_send_port');
Expand Down
2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ class ErrorScreen extends StatelessWidget {
}

class _DummyCallback {
// https://github.com/fluttercommunity/flutter_downloader/issues/629
@pragma('vm:entry-point')
static void callback(String id, int status, int progress) {
// Add the event to the DownloadUpdateStream instance.
final SendPort? send =
Expand Down

0 comments on commit a0b4816

Please sign in to comment.