Try to search your question here, if you can't find : Ask Any Question Now ?

How to fetch all data once without for-loop?

HomeCategory: stackoverflowHow to fetch all data once without for-loop?
Avatarjulie asked 4 months ago

in here I stored one by one value. API has 1 million data. Response time is 3 seconds but storing cache so much time. How to add all data once like select insert query.

storeDefCatMaster(String url,String token) async {
  final response = await http.get(
    headers: {'Authorization': 'Bearer ${token}'},);
  final jsonResponse = json.decode(response.body);
  DefCatMaster model = DefCatMaster.fromJson(jsonResponse);
  int length =;
  for(int i=0; i<length; i++) {
    var data = DataDefCatMaster(
    await helper.insert(data);
1 Answers
Best Answer
AvatarArben answered 4 months ago
Your Answer

15 + 1 =

Popular Tags

WP Facebook Auto Publish Powered By :