getItem method Null safety

Future<Map<String, dynamic>?> getItem(
  1. String key
)

Function that will retrieve a single json object from the database.

Implementation

Future<Map<String, dynamic>?> getItem(String key) async {
  final Database db = await _databaseFuture;
  final List<Map<String, dynamic>> queryResult =
      await db.query(_table, where: 'key = ?', whereArgs: [key]);
  return _processQueryResult(key, queryResult, db);
}