fromJson static method

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

Implementation

static FDropDownSource fromJson(Map<String, dynamic> json) {
  final type = json['type'] as String;
  if (type == 'static') {
    return StaticDropdownSource.fromJson(json);
  } else if (type == 'dynamic') {
    return DynamicDropdownSource.fromJson(json);
  }
  throw Exception('Unknown dropdown source type');
}