BankSliverAppBar class
The BankAppBar title hierarchy as a sliver, with the collapsing large-title pattern.
In BankAppBarTitleMode.collapsing (the default here) the bar opens with the large title anchored to its bottom edge and, as content scrolls under it, the large title scales down and fades out while a compact centred title fades into the toolbar row. Exactly one of the two is in the semantics tree at a time, so the heading is announced once.
CustomScrollView(
slivers: [
BankSliverAppBar(title: 'Accounts', subtitle: 'Sara Ahmed'),
SliverList.list(children: accountTiles),
],
)
Pass titleMode to opt out: BankAppBarTitleMode.standard gives a plain pinned bar, and BankAppBarTitleMode.large keeps the large title without the hand-off, so it simply scrolls away.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BankSliverAppBar
Constructors
-
BankSliverAppBar({Key? key, String? title, String? subtitle, Widget? leading, bool automaticallyImplyLeading = true, List<
Widget> ? actions, Color? backgroundColor, Color? foregroundColor, bool? centerTitle, PreferredSizeWidget? bottom, TextStyle? titleStyle, TextStyle? subtitleStyle, TextStyle? collapsedTitleStyle, double? elevation, Color? shadowColor, double? toolbarHeight, BankAppBarTitleMode titleMode = BankAppBarTitleMode.collapsing, double? largeTitleHeight, double? expandedHeight, bool pinned = true, bool floating = false, bool snap = false, bool stretch = false}) -
const
Properties
-
actions
→ List<
Widget> ? -
Trailing actions of the toolbar row. They stay in the toolbar at every
collapse position, so they never travel with the large title.
final
- automaticallyImplyLeading → bool
-
Whether to imply a leading back button when leading is null.
final
- backgroundColor → Color?
-
Overrides BankThemeData.surface as the background colour.
final
- bottom → PreferredSizeWidget?
-
Optional tab bar or search bar attached below the toolbar. It stays
pinned with the toolbar, so the large title is inset above it.
final
- centerTitle → bool?
-
Alignment of the compact toolbar title. Defaults to
truein BankAppBarTitleMode.collapsing — the large title hands off to a centred compact title — andfalseotherwise.final - collapsedTitleStyle → TextStyle?
-
Merged over the computed collapsed-title style
(BankTokens.headlineSmall at w700).
final
- elevation → double?
-
Overrides BankThemeData.elevationLow as the bar elevation.
final
- expandedHeight → double?
-
Overrides the fully-expanded bar height. Defaults to the toolbar, the
large-title tier, and bottom stacked.
final
- floating → bool
-
Whether the bar reappears as soon as the user scrolls back up, rather
than only at the top of the list.
final
- foregroundColor → Color?
-
Overrides BankThemeData.onSurface as the foreground colour.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- largeTitleHeight → double?
-
Overrides the height of the large-title tier. See
BankAppBar.largeTitleHeight.
final
- leading → Widget?
-
Leading action of the toolbar row.
final
- pinned → bool
-
Whether the collapsed toolbar stays on screen. Defaults to
true: a collapsing large title needs somewhere to land.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shadowColor → Color?
-
Overrides BankThemeData.outline as the elevation shadow colour.
final
- snap → bool
-
Whether a floating bar snaps fully open or closed when the scroll ends.
final
- stretch → bool
-
Whether the bar stretches past its expanded height on overscroll.
final
- subtitle → String?
-
Optional supporting line rendered below title while expanded.
final
- subtitleStyle → TextStyle?
-
Merged over the computed subtitle style.
final
- title → String?
-
Primary app-bar heading.
final
- titleMode → BankAppBarTitleMode
-
How the title block is sized and placed. Defaults to
BankAppBarTitleMode.collapsing.
final
- titleStyle → TextStyle?
-
Merged over the computed expanded-title style.
final
- toolbarHeight → double?
-
Overrides kToolbarHeight as the collapsed toolbar height.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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