SearchField constructor

const SearchField({
  1. Key? key,
  2. required TextEditingController controller,
  3. FocusNode? focusNode,
  4. bool animated = false,
  5. String? hintText,
  6. List<String> hints = const [],
  7. String? hintPrefix,
  8. Duration rotationDuration = const Duration(milliseconds: 1500),
  9. required ValueChanged<String> onChanged,
  10. GestureTapCallback? onTap,
})

Implementation

const SearchField({
  super.key,
  required this.controller,
  this.focusNode,
  this.animated = false,
  this.hintText,
  this.hints = const [],
  this.hintPrefix,
  this.rotationDuration = const Duration(milliseconds: 1500),
  required this.onChanged,
  this.onTap,
})  : assert(
        !(animated && (hints == const [] || hintPrefix == null)),
        'Hints and Hint Prefix cannot be empty for animated search field',
      ),
      assert(
        !(!animated && hintText == null),
        'Hint text cannot be null for static search field',
      );