GlassLargeTitle class
A sliver widget that renders a large 34pt iOS 26 navigation title (and optionally an inline search bar) which collapse smoothly as the user scrolls.
Drop it as the first sliver in your CustomScrollView. Pair with GlassLargeTitleController and pass the same controller to GlassAppBar.largeTitleController to automatically cross-fade the inline bar title.
iOS 26 fidelity
- Typography: 34pt, w700, -0.5 letter-spacing — exact iOS 26 spec.
- Two-phase collapse: Large title fades first (Phase 1), then the
search bar collapses under the nav bar (Phase 2) — matching iOS 26's
UINavigationItem.searchControllerbehaviour. - Fade curve:
Curves.easeInon title,Curves.easeInon search bar. - Overscroll stretch: Title scales up slightly on rubber-band pull,
matching iOS 26's
UINavigationBarlarge-title elastic stretch. - Self-measuring: Reports rendered heights to the controller after first layout — correct collapse timing under all Dynamic Type settings.
- iPhone Duo: In the vertical bar strip (GlassVerticalBar) the title leaves the scroll view for the title row at the top of the content, at 28pt in its large weight, where the GlassAppBar.pinned sharing the controller draws it. This sliver keeps its place, so the content below starts where it does natively, and the row scrolls away with it. A searchBar becomes a magnifier at the bottom of the strip; see searchBar.
Basic usage — title only
GlassLargeTitle(
text: 'Chats',
controller: _titleController,
)
With search bar — two-phase iOS 26 collapse
GlassLargeTitle(
text: 'Messages',
controller: _titleController,
searchBar: GlassSearchBar(
placeholder: 'Search',
onChanged: (v) => _filter(v),
),
)
With trailing widget (avatar, action button)
GlassLargeTitle(
text: 'Listen Now',
controller: _titleController,
trailing: CircleAvatar(child: Text('SD')),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GlassLargeTitle
- Available extensions
Constructors
- GlassLargeTitle({required String text, required GlassLargeTitleController controller, Widget? searchBar, double fontSize = 34.0, FontWeight fontWeight = FontWeight.w700, double letterSpacing = -0.5, EdgeInsetsGeometry padding = const EdgeInsetsDirectional.fromSTEB(24, 0, 24, 8), EdgeInsetsGeometry searchBarPadding = const EdgeInsetsDirectional.symmetric(horizontal: 16, vertical: 4), Color? color, Widget? trailing, Key? key})
-
Creates a large-title sliver.
const
Properties
- color → Color?
-
Title text colour. Defaults to CupertinoColors.label resolved from
the current theme — correct dark-mode behaviour automatically.
final
- controller → GlassLargeTitleController
-
The controller that drives the collapse animation and provides the
ScrollController for your CustomScrollView.
final
- fontSize → double
-
Font size of the large title. Defaults to
34.0(iOS 26 spec).final - fontWeight → FontWeight
-
Font weight. Defaults to FontWeight.w700.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- letterSpacing → double
-
Letter spacing. Defaults to
-0.5(iOS 26 spec).final - padding → EdgeInsetsGeometry
-
Padding around the title row.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- searchBar → Widget?
-
Optional search widget displayed below the large title.
final
- searchBarPadding → EdgeInsetsGeometry
-
Padding around the search bar, when searchBar is provided.
final
- text → String
-
The navigation title text — should match the
titlepassed to GlassAppBar.final - trailing → Widget?
-
Optional widget at the trailing edge of the title row.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< GlassLargeTitle> -
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
-
glassContextMenu(
{Key? key, required List< Widget> actions, WidgetBuilder? previewBuilder, bool enabled = true, bool enableHaptics = true, double borderRadius = 32.0, double? previewBorderRadius, double rowBorderRadius = 16.0, BorderRadius? rowCorners, Color? originSlotColor, Color? backgroundColor, LiquidGlassSettings? settings, GlassQuality? quality, double backdropBlur = 0.0, Color? barrierColor, VoidCallback? onOpened, VoidCallback? onDismissed, Duration longPressDuration = const Duration(milliseconds: 700)}) → Widget -
Available on Widget, provided by the GlassContextMenuExtension extension
Wraps this widget in a GlassContextMenu displayingactionson long-press or right-click. -
glassFullScreenCover(
{required bool isPresented, VoidCallback? onDismiss, required WidgetBuilder content, bool enableSwipeToDismiss = true, double dismissThreshold = 140.0, LiquidGlassSettings? settings, GlassQuality? quality}) → Widget -
Available on Widget, provided by the GlassFullScreenCoverExtension extension
Presents a full-viewport modal cover wheneverisPresentedis true. -
Available on Widget, provided by the GlassNavigationTitleExtension extension
Annotates this widget with a navigation title that drives enclosing or descendant GlassAppBar / GlassAppBar.pinned bars (when their explicittitleis null) as well as header accessibility semantics. -
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