TSliverAppBar constructor
const
TSliverAppBar({
- Key? key,
- Widget? title,
- TextStyle? titleStyle,
- List<
Widget> ? actions, - IconData? leadingIcon,
- VoidCallback? leadingOnPressed,
- bool showBackArrow = false,
- double expandedHeight = 200.0,
- Widget? flexibleSpace,
- Widget? background,
- bool floating = false,
- bool pinned = true,
- bool snap = false,
- bool useTitleInFlexibleSpace = true,
- Color? backgroundColor,
A customizable and flexible SliverAppBar with scrolling effects.
This widget provides advanced app bar functionality with options to:
- Customize the title using
titleand its style viatitleStyle. - Show a back arrow using
showBackArrow, or use a custom icon withleadingIcon. - Provide a callback for the leading icon press event with
leadingOnPressed. - Add action buttons using the
actionsparameter. - Control the expanded height of the app bar with
expandedHeight. - Add custom content when the app bar is expanded using
flexibleSpace. - Set a custom background using
background. - Control scrolling behavior with
floating,pinned, andsnap.
Note: If both title and a FlexibleSpaceBar.title are provided,
both titles will be displayed simultaneously when scrolling. To avoid redundancy,
prefer providing only one title source.
Implementation
const TSliverAppBar({
super.key,
this.title,
this.titleStyle,
this.actions,
this.leadingIcon,
this.leadingOnPressed,
this.showBackArrow = false,
this.expandedHeight = 200.0,
this.flexibleSpace,
this.background,
this.floating = false,
this.pinned = true,
this.snap = false,
this.useTitleInFlexibleSpace = true,
this.backgroundColor,
});