findRequestInDatabase method

  1. @protected
Future<Map<String, dynamic>?> findRequestInDatabase(
  1. DatabaseExecutor db
)

Implementation

@protected
Future<Map<String, dynamic>?> findRequestInDatabase(DatabaseExecutor db) async {
  final whereStatement = requestColumns.join(' = ? AND ');
  final serialized = toSqlite();

  final response = await db.query(
    tableName,
    where: '$whereStatement = ?',
    whereArgs: requestColumns.map((c) => serialized[c]).toList(),
  );

  return response.isNotEmpty ? response.first : null;
}