AppBarWithSearchSwitch constructor
AppBarWithSearchSwitch({
- required PreferredSizeWidget appBarBuilder(
- BuildContext context
- Key? key,
- void onChanged(
- String value
- VoidCallback? onClosed,
- void onSubmitted(
- String value
- VoidCallback? onCleared,
- String tooltipForClearButton = 'Clear',
- String tooltipForCloseButton = 'Close search',
- IconData? closeSearchIcon = Icons.close,
- IconData? clearSearchIcon = Icons.backspace,
- String fieldHintText = 'Search',
- bool keepAppBarColors = true,
- bool closeOnSubmit = true,
- bool clearOnSubmit = false,
- bool clearOnClose = false,
- bool showClearButton = true,
- bool closeOnClearTwice = true,
- bool submitOnClearTwice = true,
- TextInputType keyboardType = TextInputType.text,
- double toolbarWidth = double.infinity,
- InputDecoration? searchInputDecoration,
- Widget animation(
- Widget child
- ValueNotifier<
bool> ? customIsSearchModeNotifier, - ValueNotifier<
bool> ? customIsActiveNotifier, - ValueNotifier<
String> ? customTextNotifier, - ValueNotifier<
String> ? customSubmitNotifier, - ValueNotifier<
bool> ? customHasText, - TextEditingController? customTextEditingController,
- Widget leading(
- BuildContext context
- Widget title(
- BuildContext context
- List<
Widget> ? actions, - bool automaticallyImplyLeading = true,
- Widget? flexibleSpace,
- PreferredSizeWidget? bottom,
- double? elevation,
- double? scrolledUnderElevation,
- Color? shadowColor,
- Color? surfaceTintColor,
- ShapeBorder? shape,
- Color? backgroundColor,
- Color? foregroundColor,
- IconThemeData? iconTheme,
- IconThemeData? actionsIconTheme,
- bool primary = true,
- bool? centerTitle,
- bool excludeHeaderSemantics = false,
- double? titleSpacing,
- double toolbarOpacity = 1.0,
- double bottomOpacity = 1.0,
- double? toolbarHeight,
- double? leadingWidth,
- TextStyle? toolbarTextStyle,
- TextStyle? titleTextStyle,
- SystemUiOverlayStyle? systemOverlayStyle,
- ThemeData? theme,
Implementation
AppBarWithSearchSwitch({
required this.appBarBuilder,
Key? key,
this.onChanged,
this.onClosed,
this.onSubmitted,
this.onCleared,
this.tooltipForClearButton = 'Clear',
this.tooltipForCloseButton = 'Close search',
this.closeSearchIcon = Icons.close,
this.clearSearchIcon = Icons.backspace,
this.fieldHintText = 'Search',
this.keepAppBarColors = true,
this.closeOnSubmit = true,
this.clearOnSubmit = false,
this.clearOnClose = false,
this.showClearButton = true,
this.closeOnClearTwice = true,
this.submitOnClearTwice = true,
this.keyboardType = TextInputType.text,
this.toolbarWidth = double.infinity,
this.searchInputDecoration,
this.animation,
//
// > [ValueNotifier]s
//
this.customIsSearchModeNotifier,
this.customIsActiveNotifier, // deprecated: use customIsSearchModeNotifier
this.customTextNotifier,
this.customSubmitNotifier,
this.customHasText,
//
// > [TextEditingController]
//
this.customTextEditingController,
//
// > standard AppBar fields
//
this.leading, // converted to builder function
this.title, // converted to builder function
this.actions,
this.automaticallyImplyLeading = true,
this.flexibleSpace,
this.bottom,
this.elevation,
this.scrolledUnderElevation,
this.shadowColor,
this.surfaceTintColor,
this.shape,
this.backgroundColor,
this.foregroundColor,
this.iconTheme,
this.actionsIconTheme,
this.primary = true,
this.centerTitle,
this.excludeHeaderSemantics = false,
this.titleSpacing,
this.toolbarOpacity = 1.0,
this.bottomOpacity = 1.0,
this.toolbarHeight,
this.leadingWidth,
this.toolbarTextStyle,
this.titleTextStyle,
this.systemOverlayStyle,
this.theme,
}) : super(
key: key,
child: AppBarBuilder(
showClearButton: showClearButton,
onChange: onChanged,
hasText: customHasText ?? _hasTextGlobalFallBack,
isSearchMode: customIsSearchModeNotifier ??
customIsActiveNotifier ??
_isSearchModeGlobalFallBack,
textNotifier: customTextNotifier ?? _textNotifierGlobalFallBack,
submitNotifier:
customSubmitNotifier ?? _submitNotifierGlobalFallBack,
controller: customTextEditingController ??
_textEditingControllerGlobalFallBack,
),
);