fromJson static method

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

Implementation

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

  return ThemeParameters(
    backgroundColor: (json['background_color'] as int?) ?? 0,
    secondaryBackgroundColor:
        (json['secondary_background_color'] as int?) ?? 0,
    headerBackgroundColor: (json['header_background_color'] as int?) ?? 0,
    bottomBarBackgroundColor:
        (json['bottom_bar_background_color'] as int?) ?? 0,
    sectionBackgroundColor: (json['section_background_color'] as int?) ?? 0,
    sectionSeparatorColor: (json['section_separator_color'] as int?) ?? 0,
    textColor: (json['text_color'] as int?) ?? 0,
    accentTextColor: (json['accent_text_color'] as int?) ?? 0,
    sectionHeaderTextColor: (json['section_header_text_color'] as int?) ?? 0,
    subtitleTextColor: (json['subtitle_text_color'] as int?) ?? 0,
    destructiveTextColor: (json['destructive_text_color'] as int?) ?? 0,
    hintColor: (json['hint_color'] as int?) ?? 0,
    linkColor: (json['link_color'] as int?) ?? 0,
    buttonColor: (json['button_color'] as int?) ?? 0,
    buttonTextColor: (json['button_text_color'] as int?) ?? 0,
  );
}