theme property

ThemeData? theme

Theme for AppBar, when isSearchMode == true.

Since you can't just wrap AppBarWithSearchSwitch with Theme widget - this parameter will make it for you.


    appBar: AppBarWithSearchSwitch(
       theme: Theme.of(context).copyWith(
               textSelectionTheme: TextSelectionThemeData(
                  selectionHandleColor: Theme.of(context).primary,
                  selectionColor: Theme.of(context).colorScheme.primary.withOpacity(0.5),
                  cursorColor: Theme.of(context).colorScheme.primary,
       appBarBuilder: (context) {
         return AppBar(
           title: Text('Your text here'),

See also: titleTextStyle, searchInputDecoration, or just write your own with title.


final ThemeData? theme;