EnhancedTransferStepDoc.fromJson constructor

EnhancedTransferStepDoc.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory EnhancedTransferStepDoc.fromJson(Map<String, dynamic> json) {
  final step = TransferStep.fromJson(json['step'] as String);
  final from = AccountInfo.fromJson(json['from'] as String);
  final to = AccountInfo.fromJson(json['to'] as String);

  final fromBankStr = json['from_bank'] as String?;
  final toBankStr = json['to_bank'] as String?;
  final fromBank =
      fromBankStr != null ? AccountInfo.fromJson(fromBankStr) : null;
  final toBank = toBankStr != null ? AccountInfo.fromJson(toBankStr) : null;
  return EnhancedTransferStepDoc(
    step: step,
    from: from,
    to: to,
    fromBank: fromBank,
    toBank: toBank,
  );
}