Home > Blockchain >  Show a percentage indicator while fetching data from Rest API Flutter
Show a percentage indicator while fetching data from Rest API Flutter

Time:07-28

I am calling multiple API calls at the start of application and I want to show a percentage indicator to notify the user about the progress of data fetching.

I did find some plugins like percent_indicator, But I don't know how to calculate the percentage of task which is being done.

Anyone help me please with this issue.

Thankx

CodePudding user response:

One simple way is to treat all calls equal, so the formula would be:

n / totalNumberCalls x 100 %

To get a more accurate result try to set weight to each call. This is naturally more experimental.

  • Related