getSessions method

Future<List<ApiSessionModel>> getSessions()

Implementation

Future<List<ApiSessionModel>> getSessions() async {
  final db = await database;
  final List<Map<String, dynamic>> maps =
      await db.query('sessions', orderBy: 'startTime DESC');
  return List.generate(maps.length, (i) => ApiSessionModel.fromMap(maps[i]));
}