JuiFlatInput constructor

JuiFlatInput({
  1. Key? key,
  2. String? labelText,
  3. dynamic hintText,
  4. dynamic initialValue,
  5. TextEditingController? controller,
  6. dynamic onChanged,
  7. dynamic onTap,
  8. Color color = JuiColors.primaryColor,
  9. bool? disabled,
  10. bool? isPassword,
  11. dynamic validator,
  12. dynamic placeholder,
  13. dynamic keyboardType,
  14. dynamic inputFormatters,
  15. TextStyle? style,
  16. bool readOnly = false,
  17. dynamic label,
  18. dynamic suffixIcon,
})

Implementation

JuiFlatInput({
  Key? key,
  String? labelText,
  hintText,
  initialValue,
  TextEditingController? controller,
  onChanged,
  onTap,
  Color color = JuiColors.primaryColor,
  bool? disabled,
  bool? isPassword,
  validator,
  placeholder,
  keyboardType,
  inputFormatters,
  TextStyle? style,
  bool readOnly = false,
  label,
  suffixIcon,
}) : super(
        key: key,
        initialValue: initialValue,
        controller: controller,
        onChanged: onChanged,
        validator: validator,
        keyboardType: keyboardType,
        inputFormatters: inputFormatters,
        style:
            const TextStyle().regular(color: disabled == true ? JuiColors.gray.shade300 : color),
        cursorColor: color,
        scrollPadding: EdgeInsets.all(JuiBreakpoints.b40),
        readOnly: readOnly,
        onTap: onTap,
        decoration: InputDecoration(
          floatingLabelBehavior: FloatingLabelBehavior.always,
          floatingLabelStyle: const TextStyle().regularBold(color: color),
          labelStyle: const TextStyle().bigText(color: color),
          label: label,
          labelText: labelText,
          hintText: hintText,
          filled: disabled == true,
          fillColor: JuiColors.gray.shade50,
          enabled: !(disabled == true),
          enabledBorder: UnderlineInputBorder(
            borderSide: BorderSide(
              color: JuiColors.gray.shade200,
              width: 1.0.r,
            ),
          ),
          disabledBorder: UnderlineInputBorder(
            borderSide: BorderSide(
              color: JuiColors.gray.shade50,
            ),
          ),
          focusedBorder: UnderlineInputBorder(
            borderSide: BorderSide(
              color: JuiColors.gray.shade200,
              width: 1.0.r,
            ),
          ),
          errorBorder: const UnderlineInputBorder(
            borderSide: BorderSide(
              color: JuiColors.error,
            ),
          ),
          focusedErrorBorder: const UnderlineInputBorder(
            borderSide: BorderSide(
              color: JuiColors.error,
            ),
          ),
          suffixIcon: suffixIcon,
        ),
      );