Skip to content

flutter应用内升级demo下载回调组件callback方法已改成静态方法,需要修改 #4

@hehuapei

Description

@hehuapei

本人已经不研究flutter一段时间了,抽空跑了下项目,发现下载组件使用方法跟之前不一样了。
希望有继续研究的小伙伴贴一下处理方法或者直接pr,给需要的人!

对应代码位置:
flutter-app-update-demo/app_update_demo/lib/download_progress_dialog.dart
第87行和120行

官方文档:https://pub.dev/packages/flutter_downloader#-readme-tab-

FlutterDownloader.registerCallback(callback); // callback is a top-level or static function

Important note: your UI is rendered in the main isolate, while download events come from a background isolate (in other words, codes in callback are run in the background isolate), so you have to handle the communication between two isolates. For example:

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions