ZdsThemeData.fromJsonString constructor

ZdsThemeData.fromJsonString(
  1. String json
)

Creates a new instance of ZdsThemeData from a JSON format string.

The json parameter is a JSON string that conforms to the structure of ZdsThemeData. Example: { "identifier": "default", "themeMode": "system", // Possible values "dark", "light", "system" "contrast": "aa", // Possible values "aa", "aaa" "fontFamily": "packages/zeta_flutter/IBMPlexSans", "adjustAccessibility": true, "light": { "appBarStyle": "primary", // Possible values "surface", "background", "secondary", "primary" "primary": "#0073e6", "secondary": "#0073e6", "error": "#D70015" }, "dark": { "appBarStyle": "surface", // Possible values "surface", "background", "secondary", "primary" "primary": "#0073e6", "secondary": "#0073e6", "error": "#D70015" } }

This string is parsed to a Map using the _parseJson helper method, and then it's used to construct a new instance of ZdsThemeData.

Returns a new ZdsThemeData object from JSON data.

Implementation

factory ZdsThemeData.fromJsonString(String json) {
  return ZdsThemeData.fromJson(_parseJson(json));
}