parseFilledButtonTheme function

FilledButtonThemeData? parseFilledButtonTheme(
  1. ThemeData theme,
  2. Map<String, dynamic>? j
)

Implementation

FilledButtonThemeData? parseFilledButtonTheme(
    ThemeData theme, Map<String, dynamic>? j) {
  if (j == null) {
    return null;
  }

  TextStyle? parseTextStyle(String propName) {
    return j[propName] != null ? textStyleFromJson(theme, j[propName]) : null;
  }

  return FilledButtonThemeData(
      style: FilledButton.styleFrom(
    iconColor: parseColor(theme, j["icon_color"]),
    foregroundColor: parseColor(theme, j["foreground_color"]),
    backgroundColor: parseColor(theme, j["bgcolor"]),
    shadowColor: parseColor(theme, j["shadow_color"]),
    disabledBackgroundColor: parseColor(theme, j["disabled_bgcolor"]),
    disabledForegroundColor: parseColor(theme, j["disabled_foreground_color"]),
    disabledIconColor: parseColor(theme, j["disabled_icon_color"]),
    overlayColor: parseColor(theme, j["overlay_color"]),
    surfaceTintColor: parseColor(theme, j["surface_tint_color"]),
    elevation: parseDouble(j["elevation"]),
    padding: edgeInsetsFromJson(j["padding"]),
    enableFeedback: parseBool(j["enable_feedback"]),
    disabledMouseCursor: parseMouseCursor(j["disabled_mouse_cursor"]),
    enabledMouseCursor: parseMouseCursor(j["enabled_mouse_cursor"]),
    shape: outlinedBorderFromJSON(j["shape"]),
    textStyle: parseTextStyle("text_style"),
    visualDensity: parseVisualDensity(j["visual_density"]),
    side: borderSideFromJSON(theme, j["border_side"]),
    animationDuration: durationFromJSON(j["animation_duration"]),
    alignment: alignmentFromJson(j["alignment"]),
    iconSize: parseDouble(j["icon_size"]),
    fixedSize: sizeFromJson(j["fixed_size"]),
    maximumSize: sizeFromJson(j["maximum_size"]),
    minimumSize: sizeFromJson(j["minimum_size"]),
  ));
}