portal_ui_core 0.4.1
portal_ui_core: ^0.4.1 copied to clipboard
Design tokens, ThemeExtension, and theme factories for the Portal UI kit.
0.4.1 #
- Screenshots on the pub.dev page. No code changes.
0.4.0 #
-
PortalTimelineTile(new): a pure layout tile (isFirst/isLast/node/child) for a running event rail, promoted from portal_task's timeline on its second consumer (portal_travel's trip itinerary). -
PortalCurrencyField/PortalMoneyField(new) +PortalCurrency/PortalMoney(new, informat/portal_currency.dart): a reusable searchable currency picker and a paired amount+currency money field, with the formatting model behind them. Shared by portal_travel and portal_finance. -
PortalListItem: a text-valued accessory (value,valueAndAction,navigatewith text) is now capped at 45% of the row and ellipsizes, so the title gives way last (the G1 spec; the old kit did this and ui_core did not, so Settings rows read "AI provi… Portal Cloud" at 360). Done with a small two-slot render object, not aLayoutBuilder, so rows insideIntrinsicWidth/AlertDialogstill lay out. Controls,metaand custom widget accessories are unchanged. Honours text direction. Known limit: the cap onvalueAndActionincludes its 48dp button, so it overflows below ~107dp of pair width. -
PortalDecimalStepper(new) andPortalStepper.format(optional): a stepper in fractional steps (7.5 h of sleep) built onPortalStepper, counted in integer steps so there is no float drift.PortalStepperstays int-only and unchanged by default. -
PortalLoadState { loading, empty, error, data }: the fleet's four states as one enum, so a page switches on one value instead of several nullable fields.PortalFeatureCard,PortalDetailHero,PortalFormStack,PortalOption/portalOptionSection,PortalChevronLink: promoted from the design kit's demo-onlyFeatureCard,DetailHero,FormStack,DemoOption/demoOptionSectionandChevronLinkto real ui_core types, so an app's own screens (not just the kit) can use them.PortalConfirmDialogandPortalActionSheetBodyextracted fromportalConfirmandshowPortalActionSheetrespectively, so a design-review book can render the same chrome inline without pushing a route; both functions are unchanged and now call their extracted widget.PortalNetworkImagedraws a distinct "no photo yet" gradient-and-glyph placeholder whenurlis strictlynull(an empty string or a failed fetch keep the existing flat fallback). -
PortalAppIdentity(icon, name, tagline, logo): an app's mark, name and line, with no colour field (the app's owncolorScheme.primaryalready is the brand).PortalStartupSplashandPortalStartupGatetake an optionalidentity:and prefer it over theiricon/title/subtitleparams, which are now@Deprecated('Pass identity instead')but still work.PortalOnboardingPage(identity:, greeting:, question:, onSignIn:): the signed-out start screen -- identity's mark (or a givenhero) centred above aPortalButtonDockwith one primary Sign in action, a compact offline warning over the dock whenoffline: true(and Sign in disabled), and an optionalfootnote. Ported from the design kit'sKitOnboardingonto ui_core primitives.
Fix: PortalButtonDock gaps come from tokens.spacing.sm; the secondary action in PortalPrompt takes its height, padding and font size from minTapTarget, spacing.lg and typeScale.md instead of 36 / 16 / 14 (default tokens: 36 becomes 48 painted).
Fix: PortalStepProgress announces a done step (doneLabel, default done) and draws done, current and upcoming bars at three heights; PortalAppFeedback.messageFrom shows a String error as it is and the fallback for any other (no raw Exception.toString()), and a resolver that throws falls back; the per-component theme extensions snap at the midpoint when one side leaves a colour or size unset, instead of blending it to transparent or zero.
Fix: portalInputDialog validates the trimmed text it returns; PortalBlockingProgress.run removes its own route instead of popping whatever the task left on top.
Fix: PortalCalendar day cells can be selected by a screen reader (the cell had a button role but no tap action); PortalListItem no longer reads the trailing text twice when only the leading is interactive, announces disabledReason as the row hint, and includes meta (and the meta accessory text) in the row label.
Fix: PortalFilterChip compact hugs its label in a Wrap instead of filling the line, compact wins over a theme minHeight, and the delete target no longer covers the end of the label (the close glyph now owns a minTapTarget-wide box); PortalButton (and PortalButton.icon, so PortalStepper(size: sm)) hit area is minTapTarget, not the paint, and a null onPressed announces as a disabled button instead of plain content (PortalPressable(button:)).
Fix: PortalTextField.amount rejects an edit that is not a whole amount instead of truncating it (1234.56 plus a stray dot stays 1234.56) and accepts a comma decimal; PortalTextField and PortalSelect name the control by its label and no longer read the visible label a second time (PortalFormField(excludeLabelSemantics:)); PortalSelect shows the hint for a value matching no item or two instead of asserting, and no longer rebuilds (dropping focus) on a pick.
Fix: PortalFormat rounds to the shown precision before choosing sign (signed(-0.004) is £0.00, not -£0.00; PortalAmount no longer tints it success), compact(999960) is 1M not 1,000K, a negative duration keeps its sign, and date / time read a UTC value in local time.
-
PortalDateStyle.dayMonthUnpadded(5 Sep),.dayMonthYearUnpadded(5 Sep 2026),.monthDay(Oct 5),.weekdayMonthDay(Monday, Oct 5) andPortalDurationStyle.hoursMinutes(1h 30m,2h 0m,45m),.minutesSeconds(5m 0s,90m 20s),.minutesSpelled(45 min,90 min): for the local date and duration helpers apps still keep. Defaults (dd MMM, spelled) unchanged. Month and weekday names follow the locale. Not built: a custom pattern string. -
PortalStepper(value:, onChanged:, min: 0, max: 999, step: 1, label:, unit:, valueStyle:, decreaseTooltip:, increaseTooltip:, size:, variant: ghost, foregroundColor:):- 2 pcs +for a quantity or limit. TwoPortalButton.icons (hit area at leastminTapTarget), a bound reached disables its button, the result is clamped, the text is a live region. Read from lifestyle's_quantity(label: '2/4',unit), shopping'sQuantityCounter(valueStyle,foregroundColor; the well and rule around it stay the app's) and task's energy limit (twoPortalButton.icons atsize: sm; its icon and number beside them are aRowaround the stepper). Not built: press-and-hold repeat, a typed-in number, adoublevalue. The tooltips default to EnglishDecrease/Increase; pass them localised. -
PortalSegmentedTabs(scrollable: true): more than four segments, each at its label's width in a row that scrolls sideways (the default is still equal shares, unchanged). Not built: auto-switching on overflow (a caller knows its label count). -
PortalSelect<T>(items: [PortalSelectItem(value:, label:, icon:)], onChanged:, value:, label:, hint:, helper:, errorText:, required:): the dropdown, onPortalFormFieldlikePortalTextField(label above, hint until chosen, error beats helper), fill and borders from the theme'sInputDecorationTheme, at leastminTapTargettall, label as the control's semantic name, a nullonChangeddisables it. Wraps Material'sDropdownButtonFormFieldfor the menu. Not built: avalidator/Formintegration (passerrorText), a searchable or multi-select menu. -
PortalScrollPage(controller:): aScrollControllerfor the page's scroll view; the caller disposes it. Default (none) unchanged. -
PortalFilterChip(onDeleted:, deleteTooltip:): a removable chip (input chip). A close glyph ends the chip; its hit area isminTapTargetsquare over the chip's end, even on acompactchip, and it announces as its own named button (deleteTooltipis required withonDeleted, asserted). The chip body keeps its ownonTap. Not built: a separatePortalInputChipclass. -
PortalListItem(struck: true, titleMaxLines: 1):struckdraws the title with a line through it (a done task);titleMaxLineslets the title wrap before it ellipsizes. Defaults unchanged. Not built: a "done" semantic state (the label is unchanged; say it insubtitle). -
PortalButtonDock(inline: true)(also on.grid): the same actions with no surface, no rule and no padding, for a dock inside a scroll body; the body's padding places it. Default unchanged. -
PortalButton.icon(icon:, iconWidget:, selected:):iconWidgettakes any glyph (aFaIcon, an SVG; exactly one oficon/iconWidget), andselected(bool?, null = plain button) makes it a toggle: filled glyph (IconData form),primaryContainertint (explicit colours still win) and a selected semantic state.tooltipstays required. Not built: a separate unselected / selected glyph pair (pass the righticonWidgetper state). -
PortalIconTile(shape: PortalIconTileShape.roundedSquare | circle)(default unchanged), passed throughPortalListLeading.tile(shape:)and.tileBuilder(shape:). -
PortalNavBarTheme(backgroundColor:, borderColor:, markColor:, selectedWellColor:, selectedMarkColor:, boxShadow:): re-skins everyPortalBottomNavBarthroughextensionsBuilder, so an app stops passing colours per call. Widget argument beats theme beats default. Not built: a custom indicator shape (the well is the indicator). -
Type scale and formats:
PortalTypeScale(emojiXs: 20, emojiSm: 24, emojiMd: 26, emojiLg: 28, displayMd: 40, displayLg: 48)(read viatokens.typeScale; none collides withxs..xxl11-22; for a glyph or figure, not copy).PortalFormat.dateAs(date, PortalDateStyle.dayMonth | dayMonthYear | numeric | numericDayMonth)->05 Sep,05 Sep 2026,05/09/2026,05/09(never relative; en-GB month readsSeptper CLDR), andPortalFormat.duration(d, style: PortalDurationStyle.spelled | compact)->1 min 5 s(default, unchanged) or1m 5s. Not built: a custom pattern string (add a named style instead). -
PortalQuickAction(icon:, label:, onTap:, tone:, backgroundColor:, foregroundColor:, tooltip:)/.builder((context, color) => Widget, ...): a dashboard tile, glyph over a label on a tonal fill (PortalListTone), fills the width it is given, at leastminTapTargettall. The label is the accessible name;tooltipadds a tooltip where the label is ambiguous out of context. Not built: a badge or count on the tile. -
PortalListItem(dimmed: true): fades the whole row to 50% (archived, done, inactive) while it stays enabled and reads the same to a screen reader; nodisabledReasonneeded.PortalPrompt(secondaryAction:): a quieter second verb besideaction(({label, onPressed})), standard size only (asserted: it needs anaction); the one-action default is unchanged. Not built: a secondary action on compact / inline prompts (no room). -
PortalBadge(leading:): any widget glyph (aFaIcon, an SVG) in place oficon, tinted throughIconThemein the badge's ink.outlined(a hairline in the tone colour) already existed and is unchanged.PortalFilterChipTheme(selectedColor:, onSelectedColor:, unselectedColor:, onUnselectedColor:, borderColor:, minHeight:)re-skins everyPortalFilterChip(widget argument beats theme beats default);PortalFilterChip(compact: true)paints 32 (or the theme'sminHeight) and keeps theminTapTargethit area in an outer box. -
PortalButton(backgroundColor:, foregroundColor:)(widget beats the variant and theme) andPortalButton.icon(icon:, tooltip:, onPressed:, variant: secondary, size:, ...): a circular icon-only button, 36 / 48 / 56 painted,tooltiprequired (it is the name), hit areaminTapTargetaround the paint.PortalButtonDock.grid(flexes: [..], scrollable: true): per-action flex by index, and a single sideways-scrolling row of natural-width actions (columns/flexesignored there). Supersedes the "per-action flex not built" note below. -
PortalListSection(children:)is nowList<Widget>: a foreignListTileor platform widget sits in a section with the same card, dividers anddetailscope (a divider starts at aPortalListItem's text column, at the inset edge for anything else).PortalSliverListSection(itemCount:, itemBuilder:, header:, headerAction:, captionHeader:, style:, detail:): the lazy variant, a sliver (header + rows) for aCustomScrollView, so a long list is one section, not one per row. Not built:.selectableoutline in the sliver; the card is painted per row (first and last carry the corners) so ink stays above it. -
PortalIconTile(icon, {tone, size: 40, backgroundColor, foregroundColor, semanticLabel})/PortalIconTile.builder((context, color) => Widget, ...): thePortalListLeading.tilelook outside a list row (glyph is 60% ofsize; decorative unlesssemanticLabel).PortalListLeading.tilenow builds on it;PortalListTonemoved to its file (same export). Not built: a size enum (a double covers the 36/44/52/60componentSizes.iconContainer*steps too). -
Fix (accessibility): a control in a row's leading or trailing slot was unreachable by a screen reader (the leading and
PortalListAccessory.widgetwere wrapped inExcludeSemantics, and the row excluded its children). NewPortalListLeading.interactive(child, extent:)andPortalListAccessory.widget(child, interactive: true)keep the child's own semantics (the row then stops excluding its descendants and its text reads once); decorative leadings and the default.widgetare unchanged.PortalListAccessory.valueAndAction(value, unit:, sentiment:, icon:, tooltip:, onPressed:): a value plus an icon button, the value in the row's label and the button its own named target. A custom interactive child supplies its own name (semanticLabelis not added to the row's label). -
Tokens:
tokens.iconSizes(PortalIconSizes: xxs 12, xs 14, sm 16, md 18, dense 20, lg 22, xl 28, xxl 36, xxxl 44) andtokens.componentSizes(PortalComponentSizes: button heights 36 / 44 / 52, input heights 48 / 56, card padding 14 / 18 / 22, icon container 36 / 44 / 52 / 60, track heights 6 / 4, dot 6). Defaults are finance'sAppIconSizeandAppSizes, plus the 12 and 20 steps task uses. Nothing in the kit reads them yet, so no widget changed size; they are for apps to take in place of a literal. Not done: the kit export (kit_export.dart) does not list them, andPortalButton/PortalProgresskeep their own heights. -
PortalCardTheme(padding:, borderRadius:, backgroundColor:, border:, elevation:): re-skins everyPortalCard(and the stat card and empty state built on it) throughPortalThemeConfig.extensionsBuilder. Widget argument beats theme beats the variant's default; a setborderalso draws ontonalandelevated.PortalCard.elevationis now nullable (null reads the theme, then flat). -
Dialogs on
portalConfirm's chrome:portalInputDialog(context, title:, message:, label:, hint:, initialValue:, confirmLabel:, cancelLabel:, validator:, textCapitalization:, keyboardType:, maxLines:, trim:)->Future<String?>(a validator error keeps it open; done submits a single line),portalChoiceDialog<T>(context, title:, choices: [PortalChoice(value:, label:, icon:, isDestructive:)], message:, cancelLabel:)->Future<T?>, andPortalBlockingProgress.run(context, task, message:)(a non-dismissible spinner modal that closes whether the task returns or throws, and rethrows).PortalTextField(textCapitalization:)added for the input dialog. Not built: a multi-field form dialog (use a sheet). -
PortalButtonDock.grid(actions:, columns:, showRule:): N equal actions (task's detail bars use 3-4) in rows ofcolumns(default all, at most 4), 8 apart; primary + secondary stays the default constructor. Not built: per-action flex (all cells are equal). -
PortalListLeading.tile(..., backgroundColor:, foregroundColor:),.tileBuilder((context, color) => Widget, ...)(aFaIconor SVG on the tile, no font dependency here),.custom(Widget, extent:)(logo plates) and.icon(icon, color:);PortalEmptyState(iconWidget:)(iconis now optional, one of the two is required).PortalListItem(subtitleWidget:, metaWidget:, progress:, progressColor:, progressLabel:, onLongPress:, destructive:)andPortalListAccessory.widget(child, semanticLabel:)/.iconButtons([PortalListIconAction(icon:, tooltip:, onPressed:)]). Read from finance'sLedgerRow/AccountRowand task'sAppListTile. Not built:LedgerRow's uppercase overline above the title (usesubtitleWidget), task's external-link glyph and FA chevron (.widget), a chevron under a custom accessory. -
PortalStatCard(valueColor:, backgroundColor:, margin:)andPortalStatCardTheme(backgroundColor:): a figure that carries a state (value ink, tinted card). Widget beats theme beats the card's own tone. Not built: finance's label-first layout with a small mark and a caption line (a different arrangement, kept in the app;footercarries a caption). -
PortalAmount(tone:, foregroundColor:, fontSize:, fontWeight:, compact:, decimals:)withPortalAmountTone(neutral, credit, alert, muted, onPlate): finance'sMoneyTextneeds, defaults unchanged.foregroundColorbeatstone;decimals: falserounds to whole units;compactis the kit's£12.4K.test/portal_amount_test.dartcompares the text withMoneyText's format. Differences kept on purpose: a negative is the kit's hyphen-minus where finance draws U+2212;compactis one decimal (£3K, not intl's£3.02K); a value that rounds to zero carries no+. Not built: finance's slashed-zero face (the app's typeface via tokens),textAlign/maxLines. -
Fix:
PortalFormat.datecounted relative days by local-midnightDuration, so across a DST changeYesterdayreadToday. It now compares calendar dates (y/m/d), the same rule as finance'sAppDateUtils.calendarDaysBetween. -
PortalCalendar(selected:, onSelected:, initialMonth:, markedDays:, firstWeekday:, markedLabel:, onMonthChanged:): gym's month grid, moved up. Day cells keep a 0.72 painted disc inside aminTapTargethit area, each day is a semantic button named by the localized full date (andmarkedLabelwhen marked, selection reported as selected), month buttons use Material's localized tooltips.PortalCalendarTheme(selectedColor:, onSelectedColor:, markerColor:)re-skins it. Not built: a date range, min/max dates, a year picker (none of the apps needed one). -
PortalTextField(controller:, focusNode:, initialValue:, label:, hint:, helper:, errorText:, required:, obscureText:, keyboardType:, textInputAction:, onChanged:, onSubmitted:, validator:, inputFormatters:, maxLines:, minLines:, enabled:, autofocus:, filled:, prefix:, prefixText:, suffix:, autofillHints:)andPortalTextField.amount(controller:, currencySymbol:, signed:, ...)withformatAmount/parseAmount. Label, helper and error arePortalFormField's (above the control, not a floating label); the control takes fill and borders from the theme'sInputDecorationTheme;filledis the borderless pill (recipe note, invite box); the field is at leastminTapTargettall. The amount form is finance'sAmountField: decimal keypad, no second dot or third decimal, whole value selected on focus.PortalTextFieldTheme(filledColor:, contentPadding:, borderRadius:)re-skins the filled form. Not built: task's floatinglabelText(uselabel), lifestyle's uppercase letter-spaced caption (an app choice;overlineis the kit's eyebrow), finance's default-currency lookup (passcurrencySymbol). -
PortalBadge(label:, tone:, icon:, outlined:, foregroundColor:, backgroundColor:)withPortalBadgeTone(neutral, primary, secondary, success, warning, danger, info), andPortalProgress(value:, height:, fillColor:, trackColor:, overflowColor:, semanticLabel:),PortalSegmentedProgress(segments:, height:, showLegend:, formatValue:)(PortalProgressSegment) andPortalStepProgress(count:, current:, isDone:, onStepTap:). Union of gym's badge/progress, finance'sStatusBadge/ProgressTrack/SegmentedTrack, journey's status chip (outlined+foregroundColor) and recipe's step bar. Re-skinned byPortalBadgeTheme(padding:, textStyle:, tintAlpha:, borderRadius:)andPortalProgressTheme(height:, fillColor:, trackColor:, overflowColor:, doneColor:). Not built: finance'sProgressMeterrow (leading/trailing figures around a track) is a layout ofPortalProgress, not a component. -
Component re-skin hook:
PortalStatCardTheme(accentColor:, valueColor:, labelColor:, padding:, wellAlpha:)andPortalEmptyStateTheme(iconColor:, iconWellColor:, iconSize:, titleColor:, messageColor:),ThemeExtensions with every field nullable (null derives from tokens; a widget argument still wins), registered through the existingPortalThemeConfig.extensionsBuilder. Read with.of(context). New components add their own alongside. -
G8:
PortalArt(svg, width:, semanticLabel:)renders a spot illustration whose{{role}}placeholders (primary, primaryContainer, surfaceContainerHigh, outlineVariant, card, onPrimary, surface, error, onError, onSurface, tertiary, outline, onSurfaceVariant) are filled from the live theme, so one drawing follows light, dark and the seed. New dependency:flutter_svg ^2.3.0. An unknown role throws instead of painting black. The art itself is generated per app byscripts/export-art.pyfrom the kit viewer. -
G6: the example app has a Screens page (transactions, settings, edit-profile form, result) built from G1-G5, and
example/test/screens_golden_test.dartdraws each in light and dark at 1.0 and 1.3 text scale with the real typeface and icon fonts loaded.flutter test --update-goldensinexample/regenerates them. A disabledPortalListItemnow dims its leading and trailing to 38% and top-aligns them to the title line. -
G5:
PortalResultScreen(state:, title:, body:, art:, dock:, onClose:)(PortalResultStatesuccess / error / pending): art, title and body centred above the dock; the page keeps only a Close; an error is a live region. The form, settings, detail and start recipes are indocs/UI_PATTERNS.md, not classes. -
G4:
PortalButtonDock(primary:, secondary:, showRule:)andPortalScrollPage(bottom:). The dock is full width on the page tone, padding 12 16 32 (12 at the bottom with the keyboard open), 8 between buttons, with a 1 dp top rule only while content scrolls beneath it;PortalScrollPagereports that throughPortalDockRule, a dock elsewhere passesshowRule. The buttons are the caller'sPortalButtons (large primary, ghost or tonal secondary). -
G3:
PortalPrompt(message:, title:, sentiment:, size:, icon:, action:, onDismiss:, visible:)withPortalSentiment(neutral / positive / warning / negative),PortalPromptSize(standard / compact / inline) andPortalPromptAction. One tonal emphasis: the sentiment's base at 12% overportal.card, a badge disc in four glyph shapes, text kept ink (an inline negative takeserror), any foreground under 4.5:1 (text) or 3:1 (badge) stepping 12% towardonSurface. At most one action; compact takes an action or a dismiss, never both. A live region, with an assertive announce for a negative one the first time it shows (inline stays polite).PortalListItem.disabledReasonis now an inline prompt. Not built: the badge's delayed scale-in (the container animates; the badge rides with it). -
G2:
PortalFormat.of(context)(money,signed,compact,percent,date(short:),time,duration,range,bytes) andPortalAmount(value, currency, size: hero | row, signed:, unit:, delta:)withPortalAmountDelta. New dependency:intl ^0.20.2. Rules are the kit's: symbol always,.00only whenpadded, hyphen-minus negatives, a space before the unit, en-dash ranges, tabular figures, a long value scales down instead of wrapping.compactis English K/M/B only. en-GB dates readSept(CLDR), where the kit's table saysSep. Not built: the hero's Settled / Pending status chip. -
G1:
PortalListItem(title:, subtitle:, meta:, leading:, inverted:, trailing:, onTap:, disabledReason:, isNew:)/.skeleton(leading:)andPortalListSection(header:, headerAction:, captionHeader:, style:, detail:, children:)/.selectable(selected:). The leading is one ofPortalListLeading.icon | tile | avatar | thumbnail | order; the trailing is onePortalListAccessory:none | navigate({value}) | checkbox | radio | switchControl | iconButton | button | value | meta. A control accessory makes the whole row its target;iconButtonandbuttonmake only themselves. Inset sections paintportal.cardatradius.lg, dividers start at the text column and none follows the last row.disabledReasonis a plain muted line until G3's inline prompt lands. -
PortalAppBar(excludeHeaderSemantics:), default false: passes through toAppBarso atitleWidgetthat is a control (the assistant's model switcher) reads as a button, not a heading. -
PortalReviewScope(enabled:, child:, statuses:)andPortalReviewTag(id:, child:)for the design-review demo (apps/portal_design):enabledswitches the id badges on and off -- the scope draws nothing of its own (the demo toggles it from Widgetbook's side panel, so no pill covers the page) -- colouredtodo/changes/approvedoff theColorScheme.PortalReviewTagwith noPortalReviewScopeancestor -- the case for every shipped app -- returnschildunchanged, so it costs nothing outside the demo. The badge isIgnorePointerand paints outside the child's own box, so it never changes layout. -
Four chat primitives, brand-neutral:
PortalChatBubble(child:, author:, leading:, footer:, onLongPress:, maxWidthFactor:),PortalTypingDots(size:, color:, semanticsLabel:),PortalComposer(controller:, onSubmit:, focusNode:, enabled:, busy:, onStop:, leading:, trailing:, above:, variant:)andPortalPromptCard(icon:, title:, subtitle:, onTap:)+PortalPromptCardRow(children:, wrapped:). Structure lifted fromportal_ai's hand-rolled chat surfaces (the bubble's asymmetric tail, the composer's pill-vs-docked split, the suggestion deck's scroller-vs-grid) but every literal replaced with a token:PortalChatBubble's tail usesBorderRadiusDirectionalso it points at its own author's edge under RTL instead of flipping to the wrong one, the user's gradient fill istokens.gradients.accent, andPortalTypingDots' stagger comes fromtokens.motion.staggerStep/slowand holds a still frame (no ticker at all) underMediaQuery.disableAnimations.PortalComposerkeeps the field building once and rebuilding only its send button on keystroke, same as the composer it replaces, so the platform text-input connection survives a send;PortalComposerVariant.floating/dockedswap the pill-with-inline-controls layout for the bordered-card-with-footer-row one.PortalPromptCardis built directly onPortalPressable(notPortalCard, which has no haptic hook) for a light tap haptic. This is the kit side only --portal_aistill hand-rolls its own; a later pass wires it onto these. -
Icon system: Material Symbols, one voice (new dep
material_symbols_icons, re-exported asSymbols;PortalIconsis a typedef of the same class so the fleet's icon set has a Portal name). Every glyph isSymbols.<name>_rounded— the rounded style only, so the outlined and sharp fonts tree-shake to ~2 KB each in a release build — and the axes live in the theme, not at call sites:buildPortalThemesetsIconThemeData(fill: 0, weight: 400, grade: 0, opticalSize: 24)oniconTheme(Material's default colours) andprimaryIconTheme(onPrimary), andapplyPortalComponentThemesnow recolours those withcopyWithinstead of replacing them, so the axes survive the config path (test pins both). Selection isfill0 → 1 on the same glyph, animated ontokens.motion.standard:PortalBottomNavBarfills the selected destination overtokens.motion.medium(PortalNavDestination.selectedIconis now optional — it stays for the apps' remainingIcons.x_outlined/Icons.xpairs, and the fill runs alongside a swap) andPortalFilterChipfills itsiconovertokens.motion.fast, in step with its own colour change.PortalSegmentedTabshas no icon slot, so nothing to fill there. ui_core's own glyphs (PortalSearchField, the app bar overflow, the startup splash, the toast host) migrated —Symbolshas no_outlinenames; unfilled is outline. Measured on the example gallery,flutter build apk --release: 51,275,684 → 51,341,427 bytes (+64 KB) for its 26 glyphs — the rounded font shrinks 15.07 MB → 60 KB, so tree-shaking holds and the sed-to-Icons.x_roundedfallback is not needed. The axes only reach aThemeDatabuilt bybuildPortalTheme/PortalThemeConfig: an app that hand-rollsThemeData(iconTheme: IconThemeData(color:, size:))gets Flutter'sIconThemeData.fallback()for the missing axes, i.e. opsz 48, and ui_core's Symbols glyphs render thinner there — move onto the factory before or with the app's Symbols sweep. Both fill tweens clamp to[0, 1](a springmotion.standardmay overshoot;Iconasserts the range) and drop toDuration.zerounder reduce-motion, as does the nav bar's well. -
PortalFab(icon:, tooltip:, onPressed:)/PortalFab.extended(icon:, label:, onPressed:, tooltip:, scrollController:)andPortalToolbar(actions:, clearance:). The FAB is the theme'sfloatingActionButtonTheme(colour, corner) drawn throughPortalPressable— scale under the finger, spring back, Material's ripple kept on top — with onePortalHaptics.medium()on tap, and flat by decision like the toolbar and glass header:floatingActionButtonTheme.elevationis ignored (a press-scaled shadow can only live insidePortalPressable's ownMaterial), so apps drop their FABelevation:in the D sweeps. The icon is pinned to 24 dp like Material's FAB so the box is 56 square under the 22 dp fleet icon theme too. The extended form collapses to the 56 dp icon while the page scrolls down and re-extends on a scroll up or on reaching the top by any route — drag,animateTo,jumpTo(AnimatedSizeontokens.motion.standard, instant under reduce-motion), followingscrollControlleror the route'sPrimaryScrollController— which aPortalScrollPagebody attaches to on Android/iOS, so inside one it needs no wiring there (desktop passesscrollController); every tab of anIndexedStackshell shares that controller, so a position under the finger is read by direction and an idle one only when its offset moved to the top.tooltipis required on the icon-only form and defaults tolabelon the extended one, excluded from semantics while the label is visible. NoHero: B2's shared-axis transition makes a FAB flight noise and two FABs on a screen stop colliding on a tag. The toolbar is M3 Expressive's floating pill of icon actions —PortalActions drawn byPortalActionButton, the app bar's inline icon button (formerly private), sotooltipand badge come for free — as glass on every visual theme like the collapsedPortalHeader:portal.cardatPortalGlassStyle.tintAlphaover ablurSigmabackdrop blur, the theme hairline as its edge, no shadow (a translucent fill over a shadow's own fill only reads as a darker pill).clearance(defaultPortalBottomNavBar.overlayClearance) is the room kept under it for a nav that floats over the body; 0 when theScaffoldowns the nav. Sit it infloatingActionButtonwithcenterFloat. -
PortalAvatarMark(initials:, image:, size:, statusColor:),PortalCountBadge(child:, count:, visible:, backgroundColor:, foregroundColor:)andPortalProgressRing(value:, size:, strokeWidth:, label:, color:). The avatar is Material'sCircleAvataronprimaryContainer— the photo inforegroundImageso a 404 or offline degrades to the initials, two characters upper-cased in the type style that fits the step — at the newDesignTokens.avatarSizes(PortalAvatarMarkSize.sm32 /md40 /lg56 — notPortalAvatarSize, which theportal_avatarbrick seeds into apps), with an optional status ring in a semantic colour drawn inside the token size so a row of avatars stays aligned. It is namedPortalAvatarMark, not the spec'sPortalAvatar, becauseportal_platformalready exports a publicPortalAvatar(user:)and gym uses it in files that import both packages; that one keeps its name and its session lookup, and can draw with this in the D batch. The badge is Material'sBadge/Badge.count(offset, 6 dp dot, 16 dp pill,999+) plus what every call site wrote by hand:count: 0hides,count: nullis a dot, andbackgroundColor/foregroundColortake a semantic pair (s.success/s.onSuccess) — themeerror/onErrorwhen null. It isPortalCountBadge, notPortalBadge, because theportal_badgebrick seeds a label chip by that name (gym has one) and the barrel would make it ambiguous. The ring isCircularProgressIndicatorwith a round cap and the theme's track, springing to each new value ontokens.motion.standardovertokens.motion.medium(from empty on first build; jumps under reduce-motion), clamped to 0..1 so a full ring never wraps, with the animated percentage in tabular figures in the centre (or your ownlabel), in aFittedBoxthat only shrinks so a large text scale stays inside the arc — excluded from semantics because the indicator announces it. Diameter defaults toavatarSizes.lg, stroke tospacing.xs. -
PortalRefresh(onRefresh:, child:, edgeOffset:): the fleet's pull-to-refresh overRefreshIndicator, for the 35 default-look spinner discs in the apps. Flat (elevation0) onsurfaceContainerHigh,primaryarc at a 2.5 stroke, onePortalHaptics.light()the moment the pull is released past the threshold.edgeOffsetis where the disc drops out from —PortalRefresh.belowBar(context, large:)is the status bar plus a pinnedPortalSliverAppBar, or plus the expandedPortalHeader.large(nowPortalHeader.expandedHeight, 152, passed to the sliver explicitly rather than left to Material's private default) — so the disc appears under the bar instead of over it.PortalScrollPage(onRefresh:)uses it and picks the offset from its own bar: 0 with none, the compact offset for its default bar or a customappBar:, the large one forheader:. -
PortalHeader.large(title:, subtitle:, actions:, trailing:)andPortalScrollPage(header:): the fleet's large-title header overSliverAppBar.large, for the 11 hand-rolledSliverAppBars in the apps. Material owns the collapse and the cross-fade; the header putstextStyles.headlineon the expanded title (bodyon the subtitle under it) and collapses into the compact bar's own title — the same_PortalAppBarTitlePortalAppBardraws — so a large-title page scrolls into exactly the bar its siblings wear, actions overflow into the same sheet. The collapsed bar is the one glass surface on every visual theme: the theme's bar colour atPortalGlassStyle.tintAlphaover ablurSigmabackdrop blur (a private sliverBackdropFilter, clipped to the bar — Flutter has no sliver one),scrolledUnderElevation0.header:onPortalScrollPagecarries its own title and actions, so the page'stitle/actions/trailingare ignored beside it;appBar:still wins for a hand-dressed sliver. -
PortalSwipeRow(key:, child:, leading:, trailing:, borderRadius:): the fleet's swipe-to-act row overDismissible, for the hand-styledDismissibles in the apps. Each side takes aPortalSwipeAction(icon:, label:, foregroundColor:, onTrigger:, confirm:, dismisses:); the revealed background is the action's colour at 18% with its icon and label in the colour, the icon grows from 0.7× as the finger nears the 40% threshold and pops to 1.2× onspatialFast— with onePortalHaptics.medium()— the moment it is crossed.confirm(() => portalConfirm(context, …)) is asked after the slide-out and false springs the row back;dismisses: falseis a toggle (complete, pin) that firesonTriggerand settles back instead of leaving the list. Both actions are exposed as custom semantics actions, so a screen reader triggers them without the gesture; the background isExcludeSemanticsso its label does not merge into the row's. The gesture, fling and slide-out are Material's, which means the row's own settle after a release isDismissible's linearmovementDuration(tokens.motion.fast), not a spring — the spring is on the icon. -
PortalSheet.show<T>(context, builder:, title:, detents:, isScrollControlled:, showGrabber:, isDismissible:): the fleet's modal bottom sheet overshowModalBottomSheet, replacing the per-call restyling at 36 sites. Surface,radii.xltop and grabber styling come from B4'sbottomSheetTheme; the sheet passesshowDragHandle(default on — hidden whenisDismissible: false, since Material gives the handle its own drag-to-close),useSafeAreafor the status bar, and wraps the content inSafeArea(top: false)plus the keyboard'sviewInsetsso the surface still runs under the nav bar.isScrollControlleddefaults to true (amainAxisSize: minbody stays short; the keyboard lifts the sheet instead of squashing it inside the 9/16 cap). It slides ontokens.motion.emphasized(the spatial spring; its 1.5% overshoot lifts the bottom edge a few px off the screen for a couple of frames — the trade for the spring) attokens.motion.medium, leaves onstandard.flippedlike B2's pop, and skips the animation under reduce-motion.detents: [0.45, 0.9]puts aDraggableScrollableSheetinside (fractions of the height under the grabber and above the keyboard, snapping between them,PrimaryScrollControllercarrying the sheet's controller to the body); the smallest detent rests rather than closes — the grabber, barrier and back dismiss — because Material closes on reaching the minimum, which would make a two-detent sheet dismiss whenever it collapsed.title:wraps the body in the scaffold, letting aScrollViewbody scroll itself.PortalSheetScaffold(title:, body:, actions:, scrollable:)is the title + scrolling body + pinned action row most sheets hand-build, all on the page gutter; the body scrolls in aSingleChildScrollViewon the primary controller unlessscrollable: falsehands that to aListViewof its own. -
Remaining sub-themes off Material defaults, on the
PortalThemeConfigpath (buildPortalThemealone still leaves them at M3; the example gallery now builds through the config so it shows them).datePickerThemeandtimePickerThemesit on the dialog's shell —surfaceContainerHigh(a surface palette'scardColorstill wins),radii.xl, hairline, elevation 0 — with the time picker's dial and unselected hour/minute field at the input fill (M3's default Highest folds into a surface palette's panel) andradii.md.bottomSheetThemekeepsradii.xltop on the panel surface and styles the drag handle without forcing it on: apps still hand-draw one on transparent sheets, and C1'sPortalSheetpassesshowDragHandleitself.tabBarThemedrops the divider line and setsonSurfaceselected /onSurfaceVariantunselected; the indicator stays M3's 3dp rounded label-width bar soTabBar.indicatorColorandTabBar.secondarykeep working.sliderThemeis M3's 2024 slider spelled out forSliderandRangeSlider, sinceyear2023: falseis deprecated: a 4×44 pill handle that narrows under the finger (HandleThumbShape), a 16dp track with a 6dp gap either side of it (GappedSliderTrackShape), 2dp tick marks, and a rounded-rect value label; the inactive track isprimaryat 15% like the progress track, because a surface palette mapssecondaryContainera hair off the card. -
Dynamic colour seam, opt in.
PortalThemeConfig.dynamicColor(default false) andPortalDynamicColorBuilder(config:, builder:), which hands the builderPortalThemeModes— a plainconfig.build()while the flag is off; with it on, the widget asks thedynamic_colorplugin (new dep) for the device's Material You scheme — owning the query itself rather than wrappingDynamicColorBuilder, so the flag can flip at runtime without remounting the app under it — andPortalThemeConfig.build(wallpaper:)harmonises the brand seed toward its primary (Blend.harmonize: hue rotated up to 15°, chroma and tone kept) rather than replacing it, so the app nods to the wallpaper and stays on brand; the semantic roles derive from the harmonised primary and follow. First frame and any device without dynamic colour are the brand palette. No app turns it on. -
Page transitions by default:
buildPortalThemesetspageTransitionsThemeto aPortalPageTransitionsBuilderon every platform — the horizontal shared-axis slidePortalPageTransitions.sharedAxisalready drew, on theeffectsspring attokens.motion.medium— so a plainMaterialPageRoutemoves the Portal way with no call-site change.PortalPageTransitions.fadeThroughstays the call-site route for a root destination (the theme is per platform, not per route).PortalHero(tag:, child:, borderRadius:)wrapsHerowith a shuttle that clips the flight to a radius lerped from the departing end's corners to the arriving end's, so a card no longer snaps square the frame it lifts off;PortalCard(heroTag:)opts a card in with its own radius. -
Tonal cards, larger radii, squircle on.
PortalRadiidefaults step up to sm 8 / md 12 / lg 20 / xl 28 (roundedto 10/16/24/32 so it still means rounder than default) andDesignTokens.expressiveCornersis on, so cards are continuous-corner squircles unless a token bundle says otherwise.PortalRadiiUtils.continuousBorderdoubles the radius it is handed: Flutter's continuous corner puts its apex at r/8 against a circle's 0.29r, so at face value the squircle read tighter than the rounded rect it replaced. Glass and hero cards still clip to circular corners. The card theme is a tone on the page —surfaceContainerLow(dark:surfaceContainerHigh), no border, a surface palette'scardColorstill wins — andPortalCardgetsvariant: tonalas its default besideoutlined(the old bordered look),elevated(surface plus thecardshadow, now painted outside the clippingMaterialso it actually shows) andglass;standardstays as an alias ofoutlined(deprecation waits for the app migration soflutter analyzestays green there). Filled buttons are pills (PortalButtonprimary/destructive and theFilledButton/ElevatedButtonthemes atradii.full), tonal/outlined/ghost keepradii.md. Dialogs, sheets and popups sit atsurfaceContainerHigh, one tone above a card. Inputs fillsurfaceContainerHighestatradii.mdwith no border until focus or error; where a surface palette foldssurfaceContainerHighestinto its card colour the fill steps tosurfaceContainerHigh, so a field never vanishes into the card, sheet or dialog that holds it. -
Type ramp:
PortalTextStyles.hero(44/w800, tracked -1.0) abovedisplayfor the one figure a screen is about; every style now carries aheighton one rule (1.1 figures, 1.2 headings, 1.25 subtitle, 1.5 body, 1.4 caption/overline).emphasized(style)is one weight heavier and 0.2 tighter,numeric(style)turns on tabular figures so counters and columns of amounts stop jittering.PortalStatCardsets its value innumeric(title), ornumeric(hero)withhero: true. -
PortalGradientsonDesignTokens.gradients: the three gradients the fleet draws, built from theColorSchemeso they follow a theme change —surfaceSheen(scheme)(top-leftonSurfaceat 4% to nothing, layered over a surface colour),accent(scheme)(primary→primaryContainerat 135°) andimageScrim(scheme)(scrimat 60% rising from the bottom edge, for text over an image).PortalCard(sheen: true)lays the sheen over its surface behind the content, every variant. Replaces the ad-hocLinearGradients in app code, gym'ssubtleGradientfirst. -
PortalSemanticColors: the status rolesColorSchemelacks —success,warning,info(each withon*,*Container,on*Container) plusdanger*mirroringerror*so status code reads one type. Defaults per brightness from fixed hues (green 145°, amber 40°, blue 215°) on the M3 error tone recipe, rotated toward the scheme's primary withBlend.harmonize;buildPortalThemeattaches it,PortalSemanticColors.of(context)falls back to computed defaults when a theme was hand-rolled, andPortalThemeConfig.extensionsBuilderoverrides per brightness (a laterPortalSemanticColorsreplaces the default). Success toasts now paintsuccess(wassecondary), destructive toastsdanger;PortalStatCard(delta:)paints a+/-change insuccess/danger. -
PortalHaptics: the fleet's haptic vocabulary over the stdlibHapticFeedback—selection/light/medium/heavyplus the compoundsuccess(light→medium),warning(medium×2) anderror(heavy→light→light), 40 ms apart. One global switch,PortalHaptics.enabled, set from the newPortalThemeConfig.haptics(default true) when a theme is built. Wired where it earns its place: segmented tabs and bottom nav click on a selection change, filter chips on every tap (the chip cannot know whether the consumer toggles or ignores a re-tap), the confirm dialog's confirm is medium, success/destructive toasts play success/error as they appear, andPortalPressable(haptic:)plays aPortalHapticKindbeforeonTapfor anything else. -
PortalPressable: press state for anything tappable — shrinks to the newPortalMotion.pressScaletoken (0.97) on the effects spring while held, springs back on the spatial one. It hosts theInkWell, so the scale follows Material's own pressed state (a press that becomes a scroll releases) and a quick tap still plays the press out before springing back; the ripple is off unless asked for.PortalCard(onTap:)presses the whole surface with no ripple,PortalButtonkeeps its ripple and adds the scale (a loading button now goes through the same path and announces as disabled),PortalFilterChipandPortalStatCardpress too. -
Spring motion tokens.
PortalMotioncarries the M3 Expressive springs (spatialFast/Default/Slow,effectsFast/Default/Slow) asSpringDescriptions plusPortalSpringCurve, aCurvethat plays a spring to its settle time and exposes that asdurationfor implicit animations.standardis now the effects spring (never overshoots, so nothing that lerps opacity, shadows or padding breaks) andemphasizedthe spatial one; page transitions, the stagger reveal, bottom nav, segmented tabs and filter chip run on them. -
Plus Jakarta Sans ships in the package (
assets/fonts/, OFL).PortalTypeScale.fontFamilydefaults to it andbuildPortalThemesets it asThemeData.fontFamily, so an app gets the fleet typeface with no font of its own; a per-style family inPortalTextStylesstill wins. -
PortalListAccessory.navigate(swatch:): a 20 dp colour dot (decorative, out of semantics) drawn in place of the value text, for an accent picker.valuestill names the row in its label. Default (none) unchanged. -
PortalAppBar/PortalSliverAppBar(status:, statusIcon:): a one-line muted status under the title (Synced just now, optional 14 dp leading icon), a live region so a change is announced. A bar has asubtitleor astatus, not both (asserted). Default (none) renders the bar as before. Not built: the kit'scount · statuspair (give the count instatus).
0.1.2 #
- Example app and screenshots.
