IntentDetails.fromJson constructor

IntentDetails.fromJson(
  1. Map<String, dynamic> jsonMap
)

Implementation

factory IntentDetails.fromJson(Map<String, dynamic> jsonMap) {
  return IntentDetails(
      selectedMethod: jsonMap['selected_method'] ?? jsonMap['selectedMethod'],
      intent: jsonMap['intent'] != null
          ? IntentData.fromJson(jsonMap['intent'])
          : null,
      walletBalance:
          (jsonMap['walletBalance'] ?? jsonMap["wallet"])?.toDouble(),
      transaction: jsonMap['transaction'] != null
          ? TransactionData.fromJson(jsonMap['transaction'])
          : null,
      intentState: jsonMap['state'] != null
          ? IntentStateDetailsExtension.fromJson(jsonMap['state'])
          : null,
      productItems: (jsonMap['productItems'] as List<dynamic>?)
          ?.map((e) => ProductItem.fromJson(e))
          .toList());
}