AnimSearchBar constructor

const AnimSearchBar({
  1. Key? key,
  2. required double width,
  3. required TextEditingController textController,
  4. Icon? suffixIcon,
  5. Icon? prefixIcon,
  6. String helpText = "Search...",
  7. Color? color = Colors.white,
  8. Color? textFieldColor = Colors.white,
  9. Color? searchIconColor = Colors.black,
  10. Color? textFieldIconColor = Colors.black,
  11. required dynamic onSuffixTap,
  12. int animationDurationInMilli = 375,
  13. required dynamic onSubmitted(
    1. String
    ),
  14. bool rtl = false,
  15. bool autoFocus = false,
  16. TextStyle? style,
  17. bool closeSearchOnSuffixTap = false,
  18. bool boxShadow = true,
  19. List<TextInputFormatter>? inputFormatters,
})

Implementation

const AnimSearchBar({
  Key? key,

  /// The width cannot be null
  required this.width,

  /// The textController cannot be null
  required this.textController,
  this.suffixIcon,
  this.prefixIcon,
  this.helpText = "Search...",

  /// choose your custom color
  this.color = Colors.white,

  /// choose your custom color for the search when it is expanded
  this.textFieldColor = Colors.white,

  /// choose your custom color for the search when it is expanded
  this.searchIconColor = Colors.black,

  /// choose your custom color for the search when it is expanded
  this.textFieldIconColor = Colors.black,

  /// The onSuffixTap cannot be null
  required this.onSuffixTap,
  this.animationDurationInMilli = 375,

  /// The onSubmitted cannot be null
  required this.onSubmitted,

  /// make the search bar to open from right to left
  this.rtl = false,

  /// make the keyboard to show automatically when the searchbar is expanded
  this.autoFocus = false,

  /// TextStyle of the contents inside the searchbar
  this.style,

  /// close the search on suffix tap
  this.closeSearchOnSuffixTap = false,

  /// enable/disable the box shadow decoration
  this.boxShadow = true,

  /// can add list of inputformatters to control the input
  this.inputFormatters,
}) : super(key: key);