harbor library

Every edge of the screen, claimed once.

Each edge is claimed once, by the layer that owns it, and everything inside gets what is left. Bars claim the edges. Content keeps clear of them, runs under them, or reads the room itself, and the keyboard rises over whatever does not ride it.

Classes

HarborAligned
An overlay at alignment in the room, margin in from its edges: a floating button, a toast.
HarborAnchor
A point a float can be anchored to: give it to a HarborAnchorPoint around the widget to anchor to (a button in a bar, a row in a list), and to the HarborAnchored placement that should sit by it.
HarborAnchorClip
Clips its child at the edge of anchor facing side: below an anchor, nothing above the anchor's bottom edge is drawn. For a toast or float that emerges from under the field it hangs from, slid in from that edge while this keeps it hidden until it clears it.
HarborAnchored
An overlay by anchor: on its side, gap away, lined up with it by crossAlignment, and kept inside the room, margin in from its edges. A menu under its button, a bubble over a tab, "Copied" by the button that copied.
HarborAnchorPoint
Marks child as the point anchor refers to.
HarborAttachedBar
A bar attached to the nearest frame from deeper in the tree, for a bar that belongs to the content rather than to the page (an unsaved changes bar, a hint, a floating pill). It joins the bars on edge, innermost, measured and stacked like any other, and leaves when this widget does. It is built where the frame's bars are, so it sees the frame's inherited widgets, not this widget's.
HarborAttachedBarHandle
A bar attached to a frame by HarborController.attachBar; give it to HarborController.updateAttachedBar and HarborController.detachBar.
HarborBar
A bar: something built against one edge of a HarborFrame, such as a header, a tab bar, a rail or a composer. Its size is measured, never declared, and it claims that much of the edge.
HarborBarRecord
One bar as it was last laid out.
HarborBarrier
What an overlay puts between itself and the page: how it looks, whether a tap on it dismisses the overlay, and what a screen reader says about it. Sheets (showHarborSheet), dialogs (showHarborDialog, HarborDialogRoute) and floats (HarborFloat) all take one, so a barrier means the same everywhere.
HarborCenter
Centers child in the frame, then nudges it just far enough that it overlaps the bars and the keyboard by no more than overlapBudget: a canvas's controls that should sit in the middle of the screen, not the middle of whatever room is left, but never mostly under a sheet.
HarborClaim
A request that a bar hide, returned by HarborController.hideBar. Release it when the content no longer needs the edge.
HarborClear
Keeps child clear of everything in the way on edges, then marks those edges handled so nothing beneath keeps clear of them a second time.
HarborConsumerRecord
One widget that took an inset out of what lies beneath it, on one edge, as the inspector reads it: a HarborClear, a HarborScrollView, a frame nested in a body, and the rest (HarborInspectorEntry.consumers lists them).
HarborController
A frame's handle on itself, for what content asks of it.
HarborCoverageListener
Reports how much of its child the bars and system edges on edge of the frame it is in cover: 0 in the room, 1 entirely under them, called with each change. The hero title that hands off to the header as it scrolls under it.
HarborDefaults
Choices an app or a page makes once for everything beneath it: which hinges overlays and bars keep off, how toasts queue, time and sit, and what barriers are announced as.
HarborDefaultsScope
Merges defaults over the defaults above it, for everything beneath: the shape of DefaultTextStyle.merge, for a subtree that is not a HarborFrame. A frame takes the same value as HarborFrame.defaults.
HarborDialogRoute<T>
The route showHarborDialog pushes: a RawDialogRoute that builds a harbor dialog, as Material's DialogRoute is the route showDialog pushes.
HarborEdgeEffect
What a bar draws at its edge: how the boundary between the bar and the content passing under it is drawn.
HarborEdges
Arithmetic on EdgeInsetsDirectional by HarborEdge, shared by every layer.
HarborFadeBand
One edge's fade: the band where content passing under a bar fades out.
HarborFadeMask
An alpha mask that fades child out along its fade bands. Paints nothing extra when there are none, so it can always be in the tree.
HarborFloat
Something floating over a frame's body: placed in the room, the part nothing covers, so it clears the system edges, every bar and the keyboard without knowing about them.
HarborFrame
A frame: a layer whose edges bars are built against, with the body in the middle and floats over whatever room nothing covers.
HarborFrameObserver
Hears frames join and leave a HarborFrameRegistry, as a NavigatorObserver hears routes come and go.
HarborFrameRegistry
Everything frames in one view know about each other: which is on top (where a toast goes) and the list the inspector reads.
HarborHandled
Marks edges handled for everything beneath: after a layer has kept clear of them, the area below reads zero there and cannot clear them a second time.
HarborHideBar
Asks the bars on edge to hide while active: to go dark (keep their space) or withdraw (give it back). For a panel that takes over the bottom edge, or lyrics that need the whole screen.
HarborInspector
The inspector: who holds which edge, at which layer, in every frame in a view. A debug overlay and a snapshot API, unrelated to Flutter's WidgetInspector.
HarborInspectorEntry
One frame in the inspector, in global coordinates.
HarborInspectorOverlay
Draws the inspector over child: every bar's space (overlay bars in teal, solid bars in sand), each frame's room outlined, and the keyboard in blue. Inside each room, a line on each edge names the widgets that took an inset out of what lies beneath them there and how much (HarborInspectorEntry.consumers): top: HarborScrollView "inbox" 103, alike ones grouped (start: HarborClear.rowInsets ×12 16) and those that took nothing left out.
HarborKeepVisible
Keeps its child scrolled clear of the bars and the keyboard that cover the edges of the frame it is in.
HarborKeepVisibleRegion
A region that can lift its content: when a HarborLift inside it would be covered by what covers the bottom (a sheet, a page cover, the keyboard), the region moves its content up just far enough, and back down when the cover goes. Content already clear stays where it is. With reduced motion (MediaQueryData.disableAnimations) it moves at once.
HarborKeyboard
Reads the keyboard, as the frame sees it.
HarborKeyboardSource
Feeds a keyboard height the platform does not report into harbor: a keyboard drawn by a plugin or a platform view, a TV's on-screen keyboard reported over a channel, or a panel of your own that should push content up as a keyboard does.
HarborKeyboardSpace
The space a bar that HarborKeyboardStance.reserves keeps: a box exactly as tall as the keyboard's settled height. While the keyboard is hidden it shows child (a panel that takes the keyboard's place); while it is shown the keyboard covers it. Neither moves when they trade.
HarborKeyboardState
The keyboard as a frame sees it.
HarborLayoutRecord
The bar positions and clearances a frame laid out last, in its own coordinates.
HarborLift
Lifts its child over what covers the bottom (a sheet, a page cover, the keyboard), for content that does not scroll: the HarborKeepVisibleRegion around it moves its content up just far enough that this widget is clearance clear, and settles back when the cover goes. Outside a region it does nothing.
HarborPageCover
A page cover: a sheet (or any overlay) reporting how far it covers the bottom of the frame that opened it, so that frame's content keeps clear of it while it is up.
HarborPanes
Two panes, one either side of a hinge or fold, or side by side on a screen wide enough, and one alone otherwise: list and detail, two pages of a book, a canvas and its tools. Modelled on Windows' and .NET MAUI's TwoPaneView, and on the TwoPane of Microsoft's dual_screen.
HarborPlacement
Where an overlay sits in the room: at a point of it (HarborAligned) or by an anchor (HarborAnchored). HarborFloat, HarborPopover and HarborToasts.show all take one, so a placement written for one means the same in the others.
HarborPopover
An anchored float opened from anywhere: a menu from a list row, a popover from a button, declared where it is opened rather than in HarborFrame.floats.
HarborRoom
Publishes HarborRoomData beneath a harbor layer.
HarborRoomData
What bounds the room at a point in the tree: why MediaQuery.padding is what it is.
HarborRoot
The root every frame sits under. Mount it once, above the app's Navigator (MaterialApp.builder is the place), so routes, dialogs and sheets all share its system edges, its keyboard gauge and its toasts.
HarborScaledScreen
A scaled screen: lays child out on a fixed reference screen (a TV's 1200×675, say) and scales it to fit the real one, letterboxed.
HarborScrollView
A scroll view whose viewport runs to the frame's edges, under the bars, while its content comes to rest clear of them at both ends. It is a StatelessWidget that builds a CustomScrollView, not a ScrollView subclass: is ScrollView is false, and it has no buildSlivers.
HarborSheet
A sheet's surface: a new page frame with its own bars. Its header is an overlay bar the body scrolls under, with an edge effect; its footer is a solid bar that rides the keyboard and keeps 16 above the screen's edge on a phone with no home indicator. Neither is given a height: both are measured.
HarborSheetController
Closes and rebuilds a sheet showHarborSheet opened, from outside it: a now-playing drawer that a button on the page opens and closes, an editor's tool panel the page puts away when a tool is picked.
HarborSheetExtent
A sheet's heights, for a draggable sheet: fractions of the space above the keyboard.
HarborSizing
How a frame sizes itself: it fills the space it is given, as a page does, or it HarborSizing.hugs its body, as a content-sized sheet does.
HarborSliverBar
A bar that lives in a HarborScrollView: a header that scrolls with the content and then pins, clear of the bars above it, and becomes a bar for everything after it. The first one in a scroll view with no bar above takes the status bar itself, so its backdrop runs under it. Several stack.
HarborSliverClear
One sliver of a scroll view you build yourself, kept clear at the ends you choose. Use it on the sliver at each end of a CustomScrollView; a whole scroll view is better as a HarborScrollView.
HarborSticky
Keeps child in sight at the top of the room while the item it is in scrolls under the bars: a pill that rides with its card and then sticks just below the header, until the card itself has scrolled away.
HarborSystemEdges
Where a frame's system edges come from. Set it once, on HarborRoot or on the first HarborFrame; everything beneath inherits it.
HarborTitleSafe
A TV's title-safe area: the band at each edge a television may crop or overscan, which content must stay out of.
HarborToastEntry
A shown toast, returned by HarborToasts.show: what a caller may do with it.
HarborToastHold
A hold on a toast's time, returned by HarborToastEntry.hold.
HarborToasts
Transient floats: messages shown in a frame's room for a while.
HarborToastTiming
How long a toast stays up, and what counts toward that time: HarborToasts.show(timing:).

Enums

HarborAnchorSide
Which side of its anchor an anchored float or toast sits on. start and end are in reading order, as in AlignmentDirectional.centerStart: start is on the right under right-to-left.
HarborBarKind
How a bar meets the body of its frame.
HarborBarState
Whether a bar is in service.
HarborCrossAlignment
How an anchored float or toast lines up with its anchor across its side, as a Row's or Column's CrossAxisAlignment lines up its children: above or below the anchor, start and end are in reading order (a dropdown under its button's leading edge); at its start or end, they are its top and bottom.
HarborEdge
An edge of a frame. Directional, so a side follows the reading direction rather than the physical side of the screen.
HarborEdgeEffectKind
HarborExtentPolicy
How a withdrawing bar gives its space back.
HarborFollow
Which bars a HarborClear keeps up with.
HarborHinge
Which hinges and folds across a foldable's screen harbor keeps things off: a sheet or dialog opens on one side of them, and a toast or float keeps to the side that holds it. Modelled on Material 3's HingePolicy.
HarborKeyboardPhase
Where the keyboard is in its cycle: hidden, opening, shown or closing.
HarborKeyboardStance
How a bar meets the keyboard.
HarborPanePriority
Which pane HarborPanes shows when there is room for only one.
HarborPanesMode
How HarborPanes laid its panes out.
HarborPosture
How a foldable is held, from its fold: open flat, half open on a table, or half open like a book. Android's tabletop and book postures, read from MediaQuery.displayFeatures.
HarborRest
Where content comes to rest under a bar with a fade.
HarborRoomAspect
Which part of the HarborRoomData a reader depends on, so it rebuilds only for that.
HarborSystemEdgeFeature
What the system edges are made of: the part of the screen the platform keeps for itself. The inspector shows which feature put each inset there.
HarborSystemEdgeStance
How a bar takes the system edge it is built against.
HarborToastClosedReason
Why a toast was closed, as HarborToastEntry.closed reports it.
HarborToastPhase
Where a toast is in its life, read synchronously with HarborToastEntry.phase.
HarborToastQueue
What a toast does when one is already up at its slot, alignment or anchor.
HarborToastSlot
Where a toast is shown within the room of its frame.
HarborToastTarget
Which frame a toast goes to.

Functions

showHarborDialog<T>(BuildContext context, {required WidgetBuilder builder, bool inheritRoom = false, HarborBarrier barrier = const HarborBarrier.dimmed(), String? semanticLabel, bool useRootNavigator = true, RouteSettings? routeSettings, Offset? anchorPoint, TraversalEdgeBehavior? traversalEdgeBehavior, bool? requestFocus, AnimationStyle? animationStyle, RouteTransitionsBuilder? transitionBuilder, HarborHinge? hinge, bool clearsSystemEdges = true}) → Future<T?>
Opens builder's dialog over context.
showHarborSheet<T>(BuildContext context, {required WidgetBuilder builder, bool coversPage = false, HarborBarrier barrier = const HarborBarrier.dimmed(), double? maxWidth, bool useRootNavigator = false, Offset? anchorPoint, bool? requestFocus, bool reachesTop = false, RouteSettings? routeSettings, AnimationStyle? sheetAnimationStyle, HarborSheetController? controller, AnimationController? transitionAnimationController, String? semanticLabel, HarborHinge? hinge, bool fillsScreenAtHinge = false}) → Future<T?>
Opens builder's sheet (usually a HarborSheet) over context's frame.

Typedefs

HarborEdgeEffectPainter = Widget Function(BuildContext context, Map<HarborEdge, HarborFadeBand> bands, Widget body)
Wraps a frame's body so content fades out as it passes under the bars.
HarborToastTransitionBuilder = Widget Function(BuildContext context, Animation<double> animation, Widget child)
Builds a toast's entrance and exit around child from animation, which runs from 0 to 1 as the toast is shown and back as it is hidden.