fromJson static method

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

Implementation

static PreferenceCenterConfig? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  try {
    var identifier = json["id"];
    var display = json["display"] != null ? PreferenceCenterCommonDisplay._fromJson(json["display"]) : null;
    var sections = PreferenceCenterSection._fromJsonList(_toList(json["sections"]));
    return PreferenceCenterConfig._internal(identifier, display, sections);
  } catch (e) {
    print("Invalid config: $e");
  }
}