encodeSnackBarThemeData static method

Map<String, dynamic>? encodeSnackBarThemeData(
  1. SnackBarThemeData? value
)

Encodes the given value to the JSON representation.

{
  "actionBackgroundColor": "<Color>",
  "actionOverflowThreshold": "<double>",
  "actionTextColor": "<Color>",
  "backgroundColor": "<Color>",
  "behavior": "<SnackBarBehavior>",
  "closeIconColor": "<Color>",
  "contentTextStyle": "<TextStyle>",
  "disabledActionBackgroundColor": "<Color>",
  "disabledActionTextColor": "<Color>",
  "elevation": "<double>",
  "insetPadding": "<EdgeInsets>",
  "shape": "<ShapeBorder>",
  "showCloseIcon": "<bool>",
  "width": "<double>"
}

See also:

Implementation

static Map<String, dynamic>? encodeSnackBarThemeData(
  SnackBarThemeData? value,
) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'actionBackgroundColor': encodeColor(value.actionBackgroundColor),
      'actionOverflowThreshold': value.actionOverflowThreshold,
      'actionTextColor': encodeColor(value.actionTextColor),
      'backgroundColor': encodeColor(value.backgroundColor),
      'behavior': encodeSnackBarBehavior(value.behavior),
      'closeIconColor': encodeColor(value.closeIconColor),
      'contentTextStyle': encodeTextStyle(value.contentTextStyle),
      'disabledActionBackgroundColor': encodeColor(
        value.disabledActionBackgroundColor,
      ),
      'disabledActionTextColor': encodeColor(value.disabledActionTextColor),
      'elevation': value.elevation,
      'insetPadding': encodeEdgeInsetsGeometry(value.insetPadding),
      'shape': encodeShapeBorder(value.shape),
      'showCloseIcon': value.showCloseIcon,
      'width': value.width,
    };
  }

  return _stripDynamicNull(result);
}