AppBarWithSearchSwitch constructor

AppBarWithSearchSwitch({
  1. required PreferredSizeWidget appBarBuilder(
    1. BuildContext context
    ),
  2. Key? key,
  3. void onChanged(
    1. String value
    )?,
  4. VoidCallback? onClosed,
  5. void onSubmitted(
    1. String value
    )?,
  6. VoidCallback? onCleared,
  7. String tooltipForClearButton = 'Clear',
  8. String tooltipForCloseButton = 'Close search',
  9. IconData? closeSearchIcon = Icons.close,
  10. IconData? clearSearchIcon = Icons.backspace,
  11. String fieldHintText = 'Search',
  12. bool keepAppBarColors = true,
  13. bool closeOnSubmit = true,
  14. bool clearOnSubmit = false,
  15. bool clearOnClose = false,
  16. bool showClearButton = true,
  17. bool closeOnClearTwice = true,
  18. bool submitOnClearTwice = true,
  19. TextInputType keyboardType = TextInputType.text,
  20. double toolbarWidth = double.infinity,
  21. InputDecoration? searchInputDecoration,
  22. Widget animation(
    1. Widget child
    )?,
  23. ValueNotifier<bool>? customIsSearchModeNotifier,
  24. ValueNotifier<bool>? customIsActiveNotifier,
  25. ValueNotifier<String>? customTextNotifier,
  26. ValueNotifier<String>? customSubmitNotifier,
  27. ValueNotifier<bool>? customHasText,
  28. TextEditingController? customTextEditingController,
  29. Widget leading(
    1. BuildContext context
    )?,
  30. Widget title(
    1. BuildContext context
    )?,
  31. List<Widget>? actions,
  32. bool automaticallyImplyLeading = true,
  33. Widget? flexibleSpace,
  34. PreferredSizeWidget? bottom,
  35. double? elevation,
  36. double? scrolledUnderElevation,
  37. Color? shadowColor,
  38. Color? surfaceTintColor,
  39. ShapeBorder? shape,
  40. Color? backgroundColor,
  41. Color? foregroundColor,
  42. IconThemeData? iconTheme,
  43. IconThemeData? actionsIconTheme,
  44. bool primary = true,
  45. bool? centerTitle,
  46. bool excludeHeaderSemantics = false,
  47. double? titleSpacing,
  48. double toolbarOpacity = 1.0,
  49. double bottomOpacity = 1.0,
  50. double? toolbarHeight,
  51. double? leadingWidth,
  52. TextStyle? toolbarTextStyle,
  53. TextStyle? titleTextStyle,
  54. SystemUiOverlayStyle? systemOverlayStyle,
  55. 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,
        ),
      );