getEvents method

Future<List<Event>> getEvents()

Implementation

Future<List<Event>> getEvents() async {
  final db = await database;
  final List<Map<String, dynamic>> maps = await db.query('events');

  return List.generate(maps.length, (index) {
    return Event.fromMap(maps[index]);
  });
}