ViewPreset.fromJson constructor

ViewPreset.fromJson(
  1. Json? json
)

Parses a view preset from JSON.

Implementation

ViewPreset.fromJson(Json? json) :
  name = json?["name"] ?? "No Name",
  views = [
    for (final viewJson in json?["views"] ?? [])
      DashboardView.fromJson(viewJson) ?? DashboardView.blank,
  ],
  horizontal1 = List<double>.from(json?["horizontal1"] ?? []),
  horizontal2 = List<double>.from(json?["horizontal2"] ?? []),
  horizontal3 = List<double>.from(json?["horizontal3"] ?? []),
  horizontal4 = List<double>.from(json?["horizontal4"] ?? []),
  vertical1 = List<double>.from(json?["vertical1"] ?? []),
  vertical2 = List<double>.from(json?["vertical2"] ?? []);