FeeItem.fromJson constructor

FeeItem.fromJson(
  1. dynamic data
)

Implementation

factory FeeItem.fromJson(dynamic data) {
  var json = DynamicJsonExtension.getJsonMap(data);

  final titleMap = (json['title'] as Map<String, dynamic>).map(
    (key, value) =>
        MapEntry(LanguageExtension.fromJson(key), value as String),
  );

  return FeeItem(
    title: titleMap,
    value: json['value'],
    discount: json['discount'] != null
        ? DiscountItem.fromJson(json['discount'])
        : null,
  );
}