I have a getter for a singleton instance of a SQFlite
Database
, like this:
static Database _db;
static Future<Database> get db async {
if( _db == null )
_db = await openOrCreateDatabase();
return _db;
}
Now, I want to perform a query on the db
:
final List<Map<String, dynamic>> rows = await (await db).query(
'mytable',
where: 'id<?',
whereArgs: [10]
);
I find the await (await db)
ugly - is there a nicer way to "chain" two await
's together in serial?