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(_toMap(json["display"]))
        : null;
    var sections = PreferenceCenterSection._fromJsonList(_toList(json["sections"]));
    return PreferenceCenterConfig._internal(identifier, display, sections);
  } catch (e, s) {
    print("Invalid config: $e");
    print("Stack trace:\n$s");
  }
  return null;
}