queryById method

Future<Map<String, dynamic>?> queryById(
  1. String tableName,
  2. int id
)

Implementation

Future<Map<String, dynamic>?> queryById(String tableName, int id) async {
  final result = await _database.query(tableName, where: 'id = ?', whereArgs: [id]);
  return result.isNotEmpty ? result.first : null;
}