toList method

Future<List<ISQLiteItem>> toList(
  1. ISQLiteItem item
)

Implementation

Future<List<ISQLiteItem>> toList(ISQLiteItem item) async {
  final db = await getOpenDatabase();
  final tableName = item.getTableName();
  final List<Map<String, dynamic>> results = await db.query(tableName);
  if (results.isEmpty) {
    return [];
  }
  final List<ISQLiteItem> items =
      results.map((map) => item.fromMap(map)).toList();
  return items;
}