fromJson method

  1. @override
InputDecorationTheme? fromJson(
  1. Map<String, dynamic>? json
)
override

Implementation

@override
InputDecorationTheme? fromJson(Map<String, dynamic>? json) {
  if (json == null) return null;

  return InputDecorationTheme(
    alignLabelWithHint: (json['alignLabelWithHint'] as bool),
    border: const NullableInputBorderConverter().fromJson(
      json['border'],
    ),
    contentPadding: const NullableEdgeInsetsGeometryConverter().fromJson(
      json['contentPadding'],
    ),
    counterStyle: const NullableTextStyleConverter().fromJson(
      json['counterStyle'],
    ),
    disabledBorder: const NullableInputBorderConverter().fromJson(
      json['disabledBorder'],
    ),
    enabledBorder: const NullableInputBorderConverter().fromJson(
      json['enabledBorder'],
    ),
    errorBorder: const NullableInputBorderConverter().fromJson(
      json['errorBorder'],
    ),
    errorMaxLines: (json['errorMaxLines'] as num?)?.toInt(),
    errorStyle: const NullableTextStyleConverter().fromJson(
      json['errorStyle'],
    ),
    fillColor: const NullableColorConverter().fromJson(
      json['fillColor'],
    ),
    filled: (json['filled'] as bool),
    floatingLabelBehavior:
        const NullableFloatingLabelBehaviorConverter().fromJson(
              json['floatingLabelBehavior'],
            ) ??
            FloatingLabelBehavior.auto,
    focusColor: const NullableColorConverter().fromJson(
      json['focusColor'],
    ),
    focusedBorder: const NullableInputBorderConverter().fromJson(
      json['focusedBorder'],
    ),
    focusedErrorBorder: const NullableInputBorderConverter().fromJson(
      json['focusedErrorBorder'],
    ),
    // @deprecated
    // hasFloatingPlaceholder
    helperMaxLines: (json['helperMaxLines'] as num?)?.toInt(),
    helperStyle: const NullableTextStyleConverter().fromJson(
      json['helperStyle'],
    ),
    hintStyle: const NullableTextStyleConverter().fromJson(
      json['hintStyle'],
    ),
    hoverColor: const NullableColorConverter().fromJson(
      json['hoverColor'],
    ),
    isCollapsed: (json['isCollapsed'] as bool),
    isDense: (json['isDense'] as bool),
    labelStyle: const NullableTextStyleConverter().fromJson(
      json['labelStyle'],
    ),
    prefixStyle: const NullableTextStyleConverter().fromJson(
      json['prefixStyle'],
    ),
    suffixStyle: const NullableTextStyleConverter().fromJson(
      json['suffixStyle'],
    ),
  );
}