Skip to content

Instantly share code, notes, and snippets.

@arnold-parge
Created May 31, 2020 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnold-parge/b539f67f8fe6845fc74960a598d1dc4b to your computer and use it in GitHub Desktop.
Save arnold-parge/b539f67f8fe6845fc74960a598d1dc4b to your computer and use it in GitHub Desktop.
static Future<List<UserModel>> getAll() async {
var fetchStartTime = DateTime.now().millisecondsSinceEpoch;
var rawUsers = await AppSqliteDb.sqliteDb.query(UserModel.tableName);
var fetchEndTime = DateTime.now().millisecondsSinceEpoch;
appWarning(
'Time taken to fetch 1000 users from db: ${fetchEndTime - fetchStartTime}ms');
return rawUsers.map((snap) => UserModel.fromDb(snap)).toList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment