CNSearchBar constructor

const CNSearchBar({
  1. Key? key,
  2. String placeholder = 'Search',
  3. ValueChanged<String>? onChanged,
  4. ValueChanged<String>? onSubmitted,
  5. VoidCallback? onCancelTap,
  6. ValueChanged<bool>? onExpandStateChanged,
  7. bool expandable = true,
  8. bool initiallyExpanded = false,
  9. double collapsedWidth = 44.0,
  10. double expandedHeight = 36.0,
  11. Color? tint,
  12. Color? backgroundColor,
  13. Color? textColor,
  14. Color? placeholderColor,
  15. bool showCancelButton = true,
  16. String cancelText = 'Cancel',
  17. bool autofocus = false,
  18. CNSearchBarController? controller,
  19. CNSymbol? searchIcon,
  20. CNSymbol? clearIcon,
})

Creates an expandable search bar.

Implementation

const CNSearchBar({
  super.key,
  this.placeholder = 'Search',
  this.onChanged,
  this.onSubmitted,
  this.onCancelTap,
  this.onExpandStateChanged,
  this.expandable = true,
  this.initiallyExpanded = false,
  this.collapsedWidth = 44.0,
  this.expandedHeight = 36.0,
  this.tint,
  this.backgroundColor,
  this.textColor,
  this.placeholderColor,
  this.showCancelButton = true,
  this.cancelText = 'Cancel',
  this.autofocus = false,
  this.controller,
  this.searchIcon,
  this.clearIcon,
});