getBlock method Null safety

Uint8List? getBlock(
  1. Uint8List id
)

Gets a serialized block by its id.

Implementation

Uint8List? getBlock(Uint8List id) {
  BlockModel? block = _blockService.get(id);
  if (block == null) return null;

  List<TransactionModel> transactions = _transactionService.getByBlock(id);
  if (transactions.isEmpty) return null;

  return _serializeBlock(block, transactions);
}