AppliesTo.fromJson constructor

AppliesTo.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory AppliesTo.fromJson(Map<String, Object?> json) => AppliesTo(
      json['type'] as String,
      json.entries
              .where((entry) => entry.key != 'type')
              .map((entry) => MapEntry(entry.key, entry.value))
              .isEmpty
          ? null
          : Map.fromEntries(
              json.entries.where((entry) => entry.key != 'type')),
    );