AutoLeadingButton.builder constructor

const AutoLeadingButton.builder({
  1. Key? key,
  2. Color? color,
  3. bool? showIfParentCanPop,
  4. bool showIfChildCanPop = true,
  5. bool ignorePagelessRoutes = false,
  6. required NullableWidgetBuilder builder,
})

builds a nullable leading widget based on the current router state

This meant to be used above the AppBar so the leading property is passed to the AppBar's leading property,

e.g


   AutoLeadingButton.builder(
   builder: (context, leading) {
    return AppBar(
           leading: leading,
           title: Text('My Page'),
           ),
       ..
        ),
    ),

Implementation

const AutoLeadingButton.builder({
  super.key,
  this.color,
  bool? showIfParentCanPop,
  this.showIfChildCanPop = true,
  this.ignorePagelessRoutes = false,
  required NullableWidgetBuilder builder,
})  : _nullableBuilder = builder,
      builder = null,
      _showIfParentCanPop = showIfParentCanPop ?? true;