encodeInputDecorationTheme static method
Encodes the given value
to a JSON representation.
{
"alignLabelWithHint": <bool>,
"border": <InputBorder>,
"constraints": <BoxConstraints>,
"contentPadding": <EdgeInsetsGeometry>,
"counterStyle": <TextStyle>,
"disabledBorder": <InputBorder>,
"enabledBorder": <InputBorder>,
"errorBorder": <InputBorder>,
"errorMaxLines": <int>,
"errorStyle": <TextStyle>,
"fillColor": <Color>,
"filled": <bool>,
"floatingLabelAlignment": <FloatingLabelAlignment>,
"floatingLabelBehavior": <FloatingLabelBehavior>,
"floatingLabelStyle": <TextStyle>,
"focusColor": <Color>,
"focusedBorder": <InputBorder>,
"focusedErrorBorder": <InputBorder>,
"helperMaxLines": <int>,
"helperStyle": <TextStyle>,
"hintStyle": <TextStyle>,
"hoverColor": <Color>,
"iconColor": <Color>,
"isCollapsed": <bool>,
"isDense": <bool>,
"labelStyle": <TextStyle>,
"prefixIconColor": <Color>,
"prefixStyle": <TextStyle>,
"suffixIconColor": <Color>,
"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),
'constraints': encodeBoxConstraints(value.constraints),
'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,
'floatingLabelAlignment': encodeFloatingLabelAlignment(
value.floatingLabelAlignment,
),
'floatingLabelBehavior': encodeFloatingLabelBehavior(
value.floatingLabelBehavior,
),
'floatingLabelStyle': encodeTextStyle(value.floatingLabelStyle),
'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),
'iconColor': encodeColor(value.iconColor),
'isCollapsed': value.isCollapsed,
'isDense': value.isDense,
'labelStyle': encodeTextStyle(value.labelStyle),
'prefixIconColor': encodeColor(value.prefixIconColor),
'prefixStyle': encodeTextStyle(value.prefixStyle),
'suffixIconColor': encodeColor(value.suffixIconColor),
'suffixStyle': encodeTextStyle(value.suffixStyle),
};
}
return _stripNull(result);
}