getInputDecoration method

InputDecoration? getInputDecoration(
  1. dynamic widgets,
  2. Map? spec
)

Implementation

InputDecoration? getInputDecoration(dynamic widgets, Map? spec) {
  if (spec == null || spec.isEmpty) return null;
  Map? widgetMap;
  if (widgets is Map) {
    widgetMap = widgets;
  }

  return InputDecoration(
    isCollapsed: parseBool(spec["isCollapsed"]),
    isDense: tryParseBool(spec["isDense"]),
    alignLabelWithHint: tryParseBool(spec["alignLabelWithHint"]),
    constraints: getBoxConstraints(spec["constraints"]),
    border: getInputBorder(spec["border"]),
    disabledBorder: getInputBorder(spec["disabledBorder"]),
    enabledBorder: getInputBorder(spec["enabledBorder"]),
    errorBorder: getInputBorder(spec["errorBorder"]),
    focusedBorder: getInputBorder(spec["focusedBorder"]),
    focusedErrorBorder: getInputBorder(spec["focusedErrorBorder"]),
    contentPadding: Lowder.properties.getInsets(spec["contentPadding"]),
    errorText: spec["errorText"] != null
        ? Lowder.properties.getText(spec["errorText"], "errorMessage")
        : null,
    errorStyle: getTextStyle(spec["errorStyle"]),
    label: widgetMap?["label"],
    labelText: spec["labelText"] != null
        ? Lowder.properties.getText(spec["labelText"], "label")
        : null,
    labelStyle: getTextStyle(spec["labelStyle"]),
    focusColor: tryParseColor(spec["focusColor"]),
    filled: tryParseColor(spec["fillColor"]) != null,
    fillColor: tryParseColor(spec["fillColor"]),
    hoverColor: tryParseColor(spec["hoverColor"]),
    hintText: spec["hintText"] != null
        ? Lowder.properties.getText(spec["hintText"], "hintText")
        : null,
    hintStyle: getTextStyle(spec["hintStyle"]),
    floatingLabelStyle: getTextStyle(spec["floatingLabelStyle"]),
    floatingLabelBehavior:
        getFloatingLabelBehavior(spec["floatingLabelBehavior"]),
    prefix: widgetMap?["prefix"],
    prefixIcon: widgetMap?["prefixIcon"],
    prefixText: spec["prefixText"] != null
        ? Lowder.properties.getText(spec["prefixText"], "prefixText")
        : null,
    prefixStyle: getTextStyle(spec["prefixStyle"]),
    suffix: widgetMap?["suffix"],
    suffixIcon: widgetMap?["suffixIcon"],
    suffixText: spec["suffixText"] != null
        ? Lowder.properties.getText(spec["suffixText"], "suffixText")
        : null,
    suffixStyle: getTextStyle(spec["suffixStyle"]),
    helperText: spec["helperText"] != null
        ? Lowder.properties.getText(spec["helperText"], "helperText")
        : null,
    helperStyle: getTextStyle(spec["helperStyle"]),
    icon: widgetMap?["icon"],
  );
}