fromDynamic static method

JsonThemeBuilder? fromDynamic(
  1. dynamic map, {
  2. JsonWidgetRegistry? registry,
})

Builds the builder from a Map-like dynamic structure. This expects the JSON format to be of the following structure:

{
  "data": <ThemeData>,
  "isMaterialAppTheme": <bool>
}

See also:

  • ThemeDecoder.decodeThemeData

Implementation

static JsonThemeBuilder? fromDynamic(
  dynamic map, {
  JsonWidgetRegistry? registry,
}) {
  JsonThemeBuilder? result;
  if (map != null) {
    result = JsonThemeBuilder(
      theme: ThemeDecoder.decodeThemeData(
            map['data'],
            validate: false,
          ) ??
          ThemeData(),
    );
  }

  return result;
}