byPrimary method Null safety

Future<T?> byPrimary(
  1. Bean<T> obj
)

Implementation

Future<T?> byPrimary(Bean<T> obj) async {
  final sql = statementByPk();
  final queryObj = query(sql);
  final results = await queryObj.fetch(obj);
  if (results.isNotEmpty) {
    return results.first;
  }
}