SEP24InfoResponse.fromJson constructor Null safety

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

Implementation

factory SEP24InfoResponse.fromJson(Map<String, dynamic> json) {
  Map<String, dynamic>? depositDynamic =
      json['deposit'] == null ? null : json['deposit'];

  Map<String, SEP24DepositAsset> depositMap = {};
  if (depositDynamic != null) {
    depositDynamic.forEach((key, value) {
      depositMap[key] = SEP24DepositAsset.fromJson(value);
    });
  }
  Map<String, dynamic>? withdrawDynamic =
      json['withdraw'] == null ? null : json['withdraw'];

  Map<String, SEP24WithdrawAsset> withdrawMap = {};
  if (withdrawDynamic != null) {
    withdrawDynamic.forEach((key, value) {
      withdrawMap[key] = SEP24WithdrawAsset.fromJson(value);
    });
  }

  return SEP24InfoResponse(
      depositMap,
      withdrawMap,
      json['fee'] == null ? null : FeeEndpointInfo.fromJson(json['fee']),
      json['features'] == null
          ? null
          : FeatureFlags.fromJson(json['features']));
}