RouteContentSpec.fromJson constructor

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

Implementation

factory RouteContentSpec.fromJson(Map<String, dynamic> json) => RouteContentSpec(
  subpath: json['subpath'] as String? ?? '',
  cors: ((json['cors'] as List<dynamic>?) ?? const [])
      .whereType<Map>()
      .map((item) => RouteCorsRule.fromJson(item.cast<String, dynamic>()))
      .toList(),
  index: json['index'] as bool? ?? false,
  iap: json['iap'] as bool? ?? false,
  compression: json['compression'] as String? ?? 'brotli',
);