FastSearchAppBar constructor

FastSearchAppBar({
  1. Key? key,
  2. List<Widget>? actions,
  3. void onSearch(
    1. String
    )?,
  4. int? debounceTime,
  5. required String title,
  6. String? hint,
  7. bool? loading,
  8. bool animated = true,
})

FastSearchAppBar is a widget that implements a search bar in the app bar.

onSearch is a callback that returns the search value.

debounceTime is the time in milliseconds to wait before calling the onSearch callback.

title is the title of the app bar.

hint is the hint text of the search bar.

loading is a boolean that indicates if the search is loading.

animated is a boolean that indicates if the search bar will be animated.

Example:

Scaffold(

Implementation

// appBar: FastSearchAppBar(
//   title: "Fast UI Kit",
//   onSearch: (v) {},
// ),

FastSearchAppBar({
  super.key,
  this.actions,
  this.onSearch,
  this.debounceTime,
  required this.title,
  this.hint,
  this.loading,
  this.animated = true,
}) : super(
          child: _SearchAppBar(
            actions: [...?actions],
            onSearch: onSearch,
            animated: animated,
            debounceTime: debounceTime,
            title: title,
            hint: hint,
            loading: loading,
          ),
          preferredSize: Size(double.infinity,
              loading == true ? kToolbarHeight + 5 : kToolbarHeight));