JkAppBarLayout class

A container that manages appBar, bottomBar, and a scrollable child Widget. AppBar will be collapsed/expanded accordding to scrolling offset. All the bars are customizable widgets. The scrollable child must be one of the following widget: * JkAppBarListView (a clone of official ListView but support bars collapsed/expanded) * JkAppBarGridView (a clone of official GridView but support bars collapsed/expanded) * JkAppBarSingleChildScrollView (a clone of official SingleChildScrollView but support bars collapsed/expanded) Any other scrollable widget won't make app bars collapsed/expanded during scrolling.

Inheritance

Constructors

JkAppBarLayout({Key? key, Widget? appBar, Widget? appBarPinned, Widget? bottomBar, Widget? bottomBarPinned, JkAppBarBackgroundBuilder? appBarBackgroundBuilder, bool backgroundIncludingAppBarPinned = false, bool floating = true, bool snap = true, Axis scrollDirection = Axis.vertical, bool applySafeArea = true, Color? appBarBackgroundColor, bool appBarDefaultTheme = true, bool enableInkWell = true, required Widget child})
const

Properties

appBar Widget?
Top app bar that can be collapsed/expanded by scrolling. It's a widget so you can customize it.
final
appBarBackgroundBuilder JkAppBarBackgroundBuilder?
Called to build background for appBar. Widget return by this function will become the backgroud of appBar. If this is set, appBar could NOT set background. This function provide a parameter collapsedRatio, which is between 0(fully expanded) and 1(fully collapsed). You can make some effects (ex. fading) according to 'collapsedRatio'.
final
appBarBackgroundColor Color?
final
appBarDefaultTheme bool
final
appBarPinned Widget?
below appBar, won't collapsed/expanded, always shown, which known as 'pinned' It's a widget so you can customize it.
final
applySafeArea bool
enable SafeArea
final
backgroundIncludingAppBarPinned bool
If true, make widget returned by appBarBackgroundBuilder also cover the area of both appBarPinned and appBar. This parameter only works if appBarBackgroundBuilder provided
final
bottomBar Widget?
bottom bar that can be collapsed/expanded by scrolling. It's a widget so you can customize it.
final
bottomBarPinned Widget?
above bottomBar, won't collapsed/expanded, always shown, which known as 'pinned' It's a widget so you can customize it.
final
child Widget
A widget shows the content
final
enableInkWell bool
set to 'true' if there is any InkWell effect widget inside. if not set to 'true', all the InkWell effect may be invisible.
final
floating bool
Whether the app bar should become visible as soon as the user scrolls towards the beginning of the list.
final
hashCode int
The hash code for this object.
no setterinherited
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
scrollDirection Axis
final
snap bool
Automatically collapse bar if collapsed ratio >= 50% Automatically expand bar if collapsed ratio < 50% false means disable automatically collapse/expand. It won't work when dragging scrollbar by mouse, which depends on flutter issue: https://github.com/flutter/flutter/issues/138536
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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