getById method Null safety

BlockModel? getById(
  1. Uint8List id
)

Gets a BlockModel by its BlockModel.id.

Implementation

BlockModel? getById(Uint8List id) {
  List<BlockModel> blocks = _select(
      whereStmt: "WHERE $table.$columnId = x'${Bytes.hexEncode(id)}'");
  return blocks.isNotEmpty ? blocks[0] : null;
}