encodeInputDecorationTheme static method

Map<String, dynamic>? encodeInputDecorationTheme(
  1. InputDecorationTheme? value
)

Encodes the given value to a JSON representation.

{
  "alignLabelWithHint": <bool>,
  "border": <InputBorder>,
  "contentPadding": <EdgeInsetsGeometry>,
  "counterStyle": <TextStyle>,
  "disabledBorder": <InputBorder>,
  "enabledBorder": <InputBorder>,
  "errorBorder": <InputBorder>,
  "errorMaxLines": <int>,
  "errorStyle": <TextStyle>,
  "fillColor": <Color>,
  "filled": <bool>,
  "floatingLabelBehavior": <FloatingLabelBehavior>,
  "focusColor": <Color>,
  "focusedBorder": <InputBorder>,
  "focusedErrorBorder": <InputBorder>,
  "helperMaxLines": <int>,
  "helperStyle": <TextStyle>,
  "hintStyle": <TextStyle>,
  "hoverColor": <Color>,
  "isCollapsed": <bool>,
  "isDense": <bool>,
  "labelStyle": <TextStyle>,
  "prefixStyle": <TextStyle>,
  "suffixStyle": <TextStyle>
}

See also:

Implementation

static Map<String, dynamic>? encodeInputDecorationTheme(
  InputDecorationTheme? value,
) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'alignLabelWithHint': value.alignLabelWithHint,
      'border': encodeInputBorder(value.border),
      'contentPadding':
          encodeEdgeInsetsGeometry(value.contentPadding as EdgeInsets?),
      'counterStyle': encodeTextStyle(value.counterStyle),
      'disabledBorder': encodeInputBorder(value.disabledBorder),
      'enabledBorder': encodeInputBorder(value.enabledBorder),
      'errorBorder': encodeInputBorder(value.errorBorder),
      'errorMaxLines': value.errorMaxLines,
      'errorStyle': encodeTextStyle(value.errorStyle),
      'fillColor': encodeColor(value.fillColor),
      'filled': value.filled,
      'floatingLabelBehavior': encodeFloatingLabelBehavior(
        value.floatingLabelBehavior,
      ),
      'focusColor': encodeColor(value.focusColor),
      'focusedBorder': encodeInputBorder(value.focusedBorder),
      'focusedErrorBorder': encodeInputBorder(value.focusedErrorBorder),
      'helperMaxLines': value.helperMaxLines,
      'helperStyle': encodeTextStyle(value.helperStyle),
      'hintStyle': encodeTextStyle(value.hintStyle),
      'hoverColor': encodeColor(value.hoverColor),
      'isCollapsed': value.isCollapsed,
      'isDense': value.isDense,
      'labelStyle': encodeTextStyle(value.labelStyle),
      'prefixStyle': encodeTextStyle(value.prefixStyle),
      'suffixStyle': encodeTextStyle(value.suffixStyle),
    };
  }

  return _stripNull(result);
}