encodeSearchBarThemeData static method

Map<String, dynamic>? encodeSearchBarThemeData(
  1. SearchBarThemeData? value
)

Encodes the given value to the JSON representation This provies the given value to follow the structure below:

{
  "backgroundColor": "<MaterialStateProperty<Color>>",
  "constraints": "<BoxConstraints>",
  "elevation": "<MaterialStateProperty<double>>",
  "hintStyle": "<MaterialStateProperty<TextStyle>>",
  "overlayColor": "<MaterialStateProperty<Color>>",
  "padding": "<MaterialStateProperty<EdgeInsetsGeometry>>",
  "shadowColor": "<MaterialStateProperty<Color>>",
  "shape": MaterialStateProperty<OutlinedBorder>,
  "side": "<MaterialStateProperty<BorderSide>>",
  "surfaceTintColor": "<MaterialStateProperty<Color>>",
  "textStyle": "<MaterialStateProperty<TextStyle>>",
  "textCapitalization": "<TextCapitalization>"
}

See also:

Implementation

static Map<String, dynamic>? encodeSearchBarThemeData(
  SearchBarThemeData? value,
) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = {
      'backgroundColor': encodeWidgetStatePropertyColor(
        value.backgroundColor,
      ),
      'constraints': encodeBoxConstraints(value.constraints),
      'elevation': encodeWidgetStatePropertyDouble(value.elevation),
      'hintStyle': encodeWidgetStatePropertyTextStyle(value.hintStyle),
      'overlayColor': encodeWidgetStatePropertyColor(value.overlayColor),
      'padding': encodeWidgetStatePropertyEdgeInsetsGeometry(value.padding),
      'shadowColor': encodeWidgetStatePropertyColor(value.shadowColor),
      'shape': encodeWidgetStatePropertyOutlinedBorder(value.shape),
      'side': encodeWidgetStatePropertyBorderSide(value.side),
      'surfaceTintColor': encodeWidgetStatePropertyColor(
        value.surfaceTintColor,
      ),
      'textStyle': encodeWidgetStatePropertyTextStyle(value.textStyle),
      'textCapitalization': encodeTextCapitalization(
        value.textCapitalization,
      ),
    };
  }

  return _stripDynamicNull(result);
}