getStatus method Null safety

Future<EtherScanTxStatusModel> getStatus (
  1. {required String? txhash}
)

Returns the status of a specific transaction hash

txhash - Transaction hash

Implementation

Future<EtherScanTxStatusModel> getStatus({
  required String? txhash,
}) async {
  const module = 'transaction';
  const action = 'getstatus';

  Map<String, dynamic>? query = {
    'txhash': txhash,
    'module': module,
    'action': action,
    'apiKey': apiKey,
  };

  return (await get(query)).fold(
    (l) => EtherScanTxStatusModel.empty(),
    (r) => EtherScanTxStatusModel.fromJson(r),
  );
}