Home > other >  How to run a part of flutter program in background
How to run a part of flutter program in background

Time:01-24

I am building a flutter application where I have to upload multiple photos to firebase storage and then create a post request to MySql. Currently, I am iteratively uploading photos one by one and then creating MySQL posts for them. I want to run this whole process in the background. Any kind of help would be highly appreciated.

CodePudding user response:

you can put your long-running tasks in separate isolate. here an example: Parse JSON in the background

CodePudding user response:

you Can use Isolated (or Actually Creating another Thread) This video Explained Isolated very well enter link description here

CodePudding user response:

Firebase SDKs perform all their network operations in a background thread.

So after you start the upload, it already uploads the data in the background without interfering with your main thread.

All callbacks (for progress reports, errors, and completion) are invoked on the main thread, so that you can update the UI from them.

  •  Tags:  
  • Related