InputOptions.minimal constructor

InputOptions.minimal({
  1. String? hintText,
  2. Color? textColor,
  3. Color? hintColor,
  4. Color? backgroundColor,
  5. double? borderRadius,
  6. TextEditingController? textController,
  7. bool sendOnEnter = true,
})

Creates a minimal input field with no outer container.

Implementation

factory InputOptions.minimal({
  String? hintText,
  Color? textColor,
  Color? hintColor,
  Color? backgroundColor,
  double? borderRadius,
  TextEditingController? textController,
  bool sendOnEnter = true,
}) {
  return InputOptions(
    textController: textController,
    useOuterContainer: false,
    sendOnEnter: sendOnEnter,
    textStyle: textColor != null ? TextStyle(color: textColor) : null,
    decoration: InputDecoration(
      hintText: hintText,
      hintStyle: hintColor != null ? TextStyle(color: hintColor) : null,
      filled: backgroundColor != null,
      fillColor: backgroundColor,
      border: borderRadius != null
          ? OutlineInputBorder(
              borderRadius: BorderRadius.circular(borderRadius),
              borderSide: BorderSide.none,
            )
          : null,
      contentPadding: const EdgeInsets.symmetric(
        horizontal: 16.0,
        vertical: 10.0,
      ),
    ),
  );
}