fromJson method

  1. @override
ThemeData? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
ThemeData? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return ThemeData(
    accentColor: const NullableColorConverter().fromJson(
      json['accentColor'],
    ),
    accentColorBrightness: const NullableBrightnessConverter().fromJson(
      json['accentColorBrightness'],
    ),
    accentIconTheme: const NullableIconThemeDataConverter().fromJson(
      json['accentIconTheme'],
    ),
    accentTextTheme: const NullableTextThemeConverter().fromJson(
      json['accentTextTheme'],
    ),
    appBarTheme: const NullableAppBarThemeConverter().fromJson(
      json['appBarTheme'],
    ),
    applyElevationOverlayColor: json['applyElevationOverlayColor'] == null
        ? null
        : (json['applyElevationOverlayColor'] as bool),
    backgroundColor: const NullableColorConverter().fromJson(
      json['backgroundColor'],
    ),
    bannerTheme: const NullableMaterialBannerThemeDataConverter().fromJson(
      json['bannerTheme'],
    ),
    bottomAppBarColor: const NullableColorConverter().fromJson(
      json['bottomAppBarColor'],
    ),
    bottomAppBarTheme: const NullableBottomAppBarThemeConverter().fromJson(
      json['bottomAppBarTheme'],
    ),
    bottomNavigationBarTheme:
        const NullableBottomNavigationBarThemeDataConverter().fromJson(
      json['bottomNavigationBarTheme'],
    ),
    bottomSheetTheme: const NullableBottomSheetThemeDataConverter().fromJson(
      json['bottomSheetTheme'],
    ),
    brightness: const NullableBrightnessConverter().fromJson(
      json['brightness'],
    ),
    buttonBarTheme: const NullableButtonBarThemeDataConverter().fromJson(
      json['buttonBarTheme'],
    ),
    buttonColor: const NullableColorConverter().fromJson(
      json['buttonColor'],
    ),
    buttonTheme: const NullableButtonThemeDataConverter().fromJson(
      json['buttonTheme'],
    ),
    canvasColor: const NullableColorConverter().fromJson(
      json['canvasColor'],
    ),
    cardColor: const NullableColorConverter().fromJson(
      json['cardColor'],
    ),
    cardTheme: const NullableCardThemeConverter().fromJson(
      json['cardTheme'],
    ),
    checkboxTheme: const NullableCheckboxThemeDataConverter().fromJson(
      json['checkboxTheme'],
    ),
    chipTheme: const NullableChipThemeDataConverter().fromJson(
      json['chipTheme'],
    ),
    colorScheme: const NullableColorSchemeConverter().fromJson(
      json['colorScheme'],
    ),
    cupertinoOverrideTheme:
        const NullableCupertinoThemeDataConverter().fromJson(
      json['cupertinoOverrideTheme'],
    ),
    // @deprecated
    // cursorColor
    dataTableTheme: const NullableDataTableThemeDataConverter().fromJson(
      json['dataTableTheme'],
    ),
    dialogBackgroundColor: const NullableColorConverter().fromJson(
      json['dialogBackgroundColor'],
    ),
    dialogTheme: const NullableDialogThemeConverter().fromJson(
      json['dialogTheme'],
    ),
    disabledColor: const NullableColorConverter().fromJson(
      json['disabledColor'],
    ),
    dividerColor: const NullableColorConverter().fromJson(
      json['dividerColor'],
    ),
    dividerTheme: const NullableDividerThemeDataConverter().fromJson(
      json['dividerTheme'],
    ),
    elevatedButtonTheme:
        const NullableElevatedButtonThemeDataConverter().fromJson(
      json['elevatedButtonTheme'],
    ),
    errorColor: const NullableColorConverter().fromJson(
      json['errorColor'],
    ),
    fixTextFieldOutlineLabel: json['fixTextFieldOutlineLabel'] == null
        ? null
        : (json['fixTextFieldOutlineLabel'] as bool),
    floatingActionButtonTheme:
        const NullableFloatingActionButtonThemeDataConverter().fromJson(
      json['floatingActionButtonTheme'],
    ),
    focusColor: const NullableColorConverter().fromJson(
      json['focusColor'],
    ),
    fontFamily: json['fontFamily'],
    highlightColor: const NullableColorConverter().fromJson(
      json['highlightColor'],
    ),
    hintColor: const NullableColorConverter().fromJson(
      json['hintColor'],
    ),
    hoverColor: const NullableColorConverter().fromJson(
      json['hoverColor'],
    ),
    iconTheme: const NullableIconThemeDataConverter().fromJson(
      json['iconTheme'],
    ),
    indicatorColor: const NullableColorConverter().fromJson(
      json['indicatorColor'],
    ),
    inputDecorationTheme:
        const NullableInputDecorationThemeConverter().fromJson(
      json['inputDecorationTheme'],
    ),
    materialTapTargetSize:
        const NullableMaterialTapTargetSizeConverter().fromJson(
      json['materialTapTargetSize'],
    ),
    navigationRailTheme:
        const NullableNavigationRailThemeDataConverter().fromJson(
      json['navigationRailTheme'],
    ),
    outlinedButtonTheme:
        const NullableOutlinedButtonThemeDataConverter().fromJson(
      json['outlinedButtonTheme'],
    ),
    pageTransitionsTheme:
        const NullablePageTransitionsThemeConverter().fromJson(
      json['pageTransitionsTheme'],
    ),
    platform: const NullableTargetPlatformConverter().fromJson(
      json['platform'],
    ),
    popupMenuTheme: const NullablePopupMenuThemeDataConverter().fromJson(
      json['popupMenuTheme'],
    ),
    primaryColor: const NullableColorConverter().fromJson(
      json['primaryColor'],
    ),
    primaryColorBrightness: const NullableBrightnessConverter().fromJson(
      json['primaryColorBrightness'],
    ),
    primaryColorDark: const NullableColorConverter().fromJson(
      json['primaryColorDark'],
    ),
    primaryColorLight: const NullableColorConverter().fromJson(
      json['primaryColorLight'],
    ),
    primaryIconTheme: const NullableIconThemeDataConverter().fromJson(
      json['primaryIconTheme'],
    ),
    primarySwatch: const NullableMaterialColorConverter().fromJson(
      json['primarySwatch'],
    ),
    primaryTextTheme: const NullableTextThemeConverter().fromJson(
      json['primaryTextTheme'],
    ),
    radioTheme: const NullableRadioThemeDataConverter().fromJson(
      json['radioTheme'],
    ),
    scaffoldBackgroundColor: const NullableColorConverter().fromJson(
      json['scaffoldBackgroundColor'],
    ),
    scrollbarTheme: const NullableScrollbarThemeDataConverter().fromJson(
      json['scrollbarTheme'],
    ),
    secondaryHeaderColor: const NullableColorConverter().fromJson(
      json['secondaryHeaderColor'],
    ),
    selectedRowColor: const NullableColorConverter().fromJson(
      json['selectedRowColor'],
    ),
    shadowColor: const NullableColorConverter().fromJson(
      json['shadowColor'],
    ),
    sliderTheme: const NullableSliderThemeDataConverter().fromJson(
      json['sliderTheme'],
    ),
    snackBarTheme: const NullableSnackBarThemeDataConverter().fromJson(
      json['snackBarTheme'],
    ),
    splashColor: const NullableColorConverter().fromJson(
      json['splashColor'],
    ),
    splashFactory:
        const NullableInteractiveInkFeatureFactoryConverter().fromJson(
      json['splashFactory'],
    ),
    switchTheme: const NullableSwitchThemeDataConverter().fromJson(
      json['switchTheme'],
    ),
    tabBarTheme: const NullableTabBarThemeConverter().fromJson(
      json['tabBarTheme'],
    ),
    textButtonTheme: const NullableTextButtonThemeDataConverter().fromJson(
      json['textButtonTheme'],
    ),
    // @deprecated
    // textSelectionColor

    // @deprecated
    // textSelectionHandleColor
    textSelectionTheme:
        const NullableTextSelectionThemeDataConverter().fromJson(
      json['textSelectionTheme'],
    ),
    textTheme: const NullableTextThemeConverter().fromJson(
      json['textTheme'],
    ),
    timePickerTheme: const NullableTimePickerThemeDataConverter().fromJson(
      json['timePickerThemeData'],
    ),
    toggleButtonsTheme:
        const NullableToggleButtonsThemeDataConverter().fromJson(
      json['toggleButtonsTheme'],
    ),
    toggleableActiveColor: const NullableColorConverter().fromJson(
      json['toggleableActiveColor'],
    ),
    tooltipTheme: const NullableTooltipThemeDataConverter().fromJson(
      json['tooltipTheme'],
    ),
    typography: const NullableTypographyConverter().fromJson(
      json['typography'],
    ),
    unselectedWidgetColor: const NullableColorConverter().fromJson(
      json['unselectedWidgetColor'],
    ),
    // @deprecated
    // useTextSelectionTheme
    visualDensity: const NullableVisualDensityConverter().fromJson(
      json['visualDensity'],
    ),
  );
}