views static method

Fetches the views saved in the DB. @returns A Future that completes whit the views retrieved from the DB.

Implementation

static Future<List<MBAutomationView>?> views() async {
  Database db = await _database();
  final res = await db.query(
    'view',
    orderBy: 'timestamp ASC',
  );
  if (res.isNotEmpty) {
    return res.map((e) => MBAutomationView.fromDbData(dbData: e)).toList();
  }
  return null;
}