ZetaTopAppBar.search constructor

const ZetaTopAppBar.search({
  1. Key? key,
  2. bool? rounded,
  3. ZetaTopAppBarType type = ZetaTopAppBarType.defaultAppBar,
  4. bool automaticallyImplyLeading = true,
  5. ZetaSearchController? searchController,
  6. Widget? leading,
  7. Widget? title,
  8. TextStyle? titleTextStyle,
  9. ValueChanged<String>? onSearch,
  10. String? searchHintText,
  11. VoidCallback? onSearchMicrophoneIconPressed,
  12. List<Widget> actions = const [],
  13. String? clearSemanticLabel,
  14. String? microphoneSemanticLabel,
  15. String? searchSemanticLabel,
  16. String? searchBackSemanticLabel,
})

Creates a ZetaTopAppBar with an expanding search field. This will append a search icon to the right of the app bar. When the search icon is pressed, the search field will expand and replace the title widget. It will replace the leading widget with a back button which closes the search field. The search field can be controlled externally by the searchController.

Implementation

const ZetaTopAppBar.search({
  super.key,
  super.rounded,
  this.type = ZetaTopAppBarType.defaultAppBar,
  this.automaticallyImplyLeading = true,
  this.searchController,
  this.leading,
  this.title,
  this.titleTextStyle,
  this.onSearch,
  this.searchHintText,
  this.onSearchMicrophoneIconPressed,
  this.actions = const [],
  this.clearSemanticLabel,
  this.microphoneSemanticLabel,
  this.searchSemanticLabel,
  this.searchBackSemanticLabel,
})  : shrinks = false,
      assert(type != ZetaTopAppBarType.extended, 'Search app bars cannot be extended');