ModifyPageOptions.fromJson constructor

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

Implementation

factory ModifyPageOptions.fromJson(Map<String, dynamic> json) =>
    ModifyPageOptions(
      rotation: json.containsKey("rotation")
          ? ImageRotation.values.byName(json["rotation"] as String)
          : ImageRotation.NONE,
      polygon: json.containsKey("polygon")
          ? (json["polygon"] != null
              ? (json["polygon"] as List<dynamic>)
                  .map((it) => Point<double>(
                      ((it as Map<String, dynamic>)["x"] as num).toDouble(),
                      ((it)["y"] as num).toDouble()))
                  .toList()
              : null)
          : null,
      filters: json.containsKey("filters")
          ? (json["filters"] != null
              ? (json["filters"] as List<dynamic>)
                  .map((it) =>
                      ParametricFilter.fromJson(it as Map<String, dynamic>))
                  .toList()
              : null)
          : null,
    );