According to the business logic, I need to use WebView to download blob videos in Flutter. After looking online for a long time, I haven't found a suitable solution that can adapt to Android and iOS at the same time, so I had to just write it by myself. Different ideas are used. The basic idea is:
- Start a simple back-end service in Flutter. I choose Jaguar here
- Download the Blob and convert it to File, then post it as FormData
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.16299.1087], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.5)
[√] IntelliJ IDEA Ultimate Edition (version 2021.1)
[√] Connected device (2 available)
pubspec.yaml
jaguar: ^3.0.4
jaguar_cors: any
permission_handler: ^7.1.0
gallery_saver: ^2.1.2
- Build Flutter APP,and click the button at the right bottom.
- Change the blob url and the backend address in blob.html,then clicke SAVE TEST FILE
- null safety is not using.
- Notice about CORS,referring to Jaguar CORS