title: How to fix slow issue when using async and await for caching using Sqflite?
body: <p>I store all API data to cache. some APIs have more than 10000 data. Postman response time is within one second. but in application very slow to navigate to next page. I used this code:</p>
  
  <pre><code>    onPressed: () async {
      ...
      }   
       else {
  var token = Token(
                                        id: 1,
                                        token: tokens,
                                        refreshToken: model.data.refreshToken,
                                      );
                                       await storeRegister(_url,tokens);
                                       await storeEquipmentReg(_url,tokens);
                                       await storeSyncLogin(_url,tokens);
                                       await HelperDefCatMaster().deleteDefCatMaster();
                                       await storeDefCatMaster(_url,tokens);
                                       await HelperDefRegisterCat().deleteDefRegisterCat();
                                       await storeDefRegisterCat(_url,tokens);
                                       await HelperDefCatMaster().deleteDefCatRelation();
                                       await storeDefCatRelation(_url,tokens);
                                       await HelperDefCatMaster().deleteWoDescription();
                                        await storeWoDescription(_url,tokens);
                                       await HelperDefCatMaster().deleteCategoryDefect();
                                       await storeCategoryDefect(_url,tokens);
                                       await storeWorkSource(_url,tokens);
                                       await storeWorkTypes(_url,tokens);
                                       await storePriorities(_url,tokens);
                                      await Helper().insert(token);
                                      Navigator.push(
                                          context,
                                          MaterialPageRoute(
                                              builder: (context) =&gt; ListPage(model.data.token)));
                                    }
  </code></pre>
  
  <p>storePriorities function look like,</p>
  
  <pre><code>storePriorities(String url, String token) async {
    final response = await http.get(
      '${url}/v1.0/Priorities',
      headers: {'Authorization': 'Bearer ${token}'},
    );
    final jsonResponse = json.decode(response.body);
    Priorities model = Priorities.fromJson(jsonResponse);
    int length = model.data.length;
    for (int i = 0; i &lt; length; i++) {
      var data = DataPriorities(
        i: model.data[i].i,
        d: model.data[i].d,
      );
      await HelperDefCatMaster().insertPriorities(data);
    }
  }
  </code></pre>