AutoLeadingButton class

An AutoRoute replacement of appBar aut-leading-button

Unlike the default BackButton this button will always the top-most route in the whole hierarchy not only current-stack

meant to be used with AppBar -> AppBar(leading: AutoLeadingButton())

e.g if we have such hierarchy

  • page1
  • page2
    • sub-page1
    • sub-page2 and Page2 has an AutoLeadingButton(), clicking it will pop sub-page2 then page2
Inheritance

Constructors

AutoLeadingButton({Key? key, Color? color, bool? showIfParentCanPop, bool showIfChildCanPop = true, bool ignorePagelessRoutes = false, AutoLeadingButtonBuilder? builder})
Default constructor
const
AutoLeadingButton.builder({Key? key, Color? color, bool? showIfParentCanPop, bool showIfChildCanPop = true, bool ignorePagelessRoutes = false, required NullableWidgetBuilder builder})
builds a nullable leading widget based on the current router state
const

Properties

builder → AutoLeadingButtonBuilder?
Clients can use this builder to customize the looks and feels of their leading buttons
final
color → Color?
The color of BackButton and CloseButton
final
hashCode → int
The hash code for this object.
no setterinherited
ignorePagelessRoutes → bool
Whether to ignore pageless routes when calculating top-most route
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showIfChildCanPop → bool
Whether to pop current stack and not care about child routes
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<AutoLeadingButton>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited