appBarBuilder property

PreferredSizeWidget Function(BuildContext context) appBarBuilder
final

Builder function for AppBar by default (when search is inactive).

Describe how AppBar should look before search is activated (isSearchMode == false). Example: ... appBarBuilder: (context) { final appBar = AppBarWithSearchSwitch.of(context)!;

     return AppBar(
       title: Text('Your text here'),
       actions: [
         IconButton(
           icon: Icon(appBar.text != '' ? Icons.search_off : Icons.search),
           // tooltip: 'Last input: ${appBar.text}',
           // color: appBar.text != '' ? Colors.tealAccent : null,
           onPressed: () {
             appBar.startSearch(); // required
           },
         ),
       ],
     );
   },

Implementation

final PreferredSizeWidget Function(BuildContext context) appBarBuilder;