Skip to main content

portal_ui_core 0.4.1 copy "portal_ui_core: ^0.4.1" to clipboard
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, in format/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, navigate with 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 a LayoutBuilder, so rows inside IntrinsicWidth/AlertDialog still lay out. Controls, meta and custom widget accessories are unchanged. Honours text direction. Known limit: the cap on valueAndAction includes its 48dp button, so it overflows below ~107dp of pair width.

  • PortalDecimalStepper (new) and PortalStepper.format (optional): a stepper in fractional steps (7.5 h of sleep) built on PortalStepper, counted in integer steps so there is no float drift. PortalStepper stays 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-only FeatureCard, DetailHero, FormStack, DemoOption/demoOptionSection and ChevronLink to real ui_core types, so an app's own screens (not just the kit) can use them. PortalConfirmDialog and PortalActionSheetBody extracted from portalConfirm and showPortalActionSheet respectively, 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. PortalNetworkImage draws a distinct "no photo yet" gradient-and-glyph placeholder when url is strictly null (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 own colorScheme.primary already is the brand). PortalStartupSplash and PortalStartupGate take an optional identity: and prefer it over their icon/title/subtitle params, 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 given hero) centred above a PortalButtonDock with one primary Sign in action, a compact offline warning over the dock when offline: true (and Sign in disabled), and an optional footnote. Ported from the design kit's KitOnboarding onto 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) and PortalDurationStyle.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. Two PortalButton.icons (hit area at least minTapTarget), 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's QuantityCounter (valueStyle, foregroundColor; the well and rule around it stay the app's) and task's energy limit (two PortalButton.icons at size: sm; its icon and number beside them are a Row around the stepper). Not built: press-and-hold repeat, a typed-in number, a double value. The tooltips default to English Decrease / 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, on PortalFormField like PortalTextField (label above, hint until chosen, error beats helper), fill and borders from the theme's InputDecorationTheme, at least minTapTarget tall, label as the control's semantic name, a null onChanged disables it. Wraps Material's DropdownButtonFormField for the menu. Not built: a validator / Form integration (pass errorText), a searchable or multi-select menu.

  • PortalScrollPage(controller:): a ScrollController for 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 is minTapTarget square over the chip's end, even on a compact chip, and it announces as its own named button (deleteTooltip is required with onDeleted, asserted). The chip body keeps its own onTap. Not built: a separate PortalInputChip class.

  • PortalListItem(struck: true, titleMaxLines: 1): struck draws the title with a line through it (a done task); titleMaxLines lets the title wrap before it ellipsizes. Defaults unchanged. Not built: a "done" semantic state (the label is unchanged; say it in subtitle).

  • 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:): iconWidget takes any glyph (a FaIcon, an SVG; exactly one of icon / iconWidget), and selected (bool?, null = plain button) makes it a toggle: filled glyph (IconData form), primaryContainer tint (explicit colours still win) and a selected semantic state. tooltip stays required. Not built: a separate unselected / selected glyph pair (pass the right iconWidget per state).

  • PortalIconTile(shape: PortalIconTileShape.roundedSquare | circle) (default unchanged), passed through PortalListLeading.tile(shape:) and .tileBuilder(shape:).

  • PortalNavBarTheme(backgroundColor:, borderColor:, markColor:, selectedWellColor:, selectedMarkColor:, boxShadow:): re-skins every PortalBottomNavBar through extensionsBuilder, 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 via tokens.typeScale; none collides with xs..xxl 11-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 reads Sept per CLDR), and PortalFormat.duration(d, style: PortalDurationStyle.spelled | compact) -> 1 min 5 s (default, unchanged) or 1m 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 least minTapTarget tall. The label is the accessible name; tooltip adds 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; no disabledReason needed. PortalPrompt(secondaryAction:): a quieter second verb beside action (({label, onPressed})), standard size only (asserted: it needs an action); the one-action default is unchanged. Not built: a secondary action on compact / inline prompts (no room).

  • PortalBadge(leading:): any widget glyph (a FaIcon, an SVG) in place of icon, tinted through IconTheme in 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 every PortalFilterChip (widget argument beats theme beats default); PortalFilterChip(compact: true) paints 32 (or the theme's minHeight) and keeps the minTapTarget hit area in an outer box.

  • PortalButton(backgroundColor:, foregroundColor:) (widget beats the variant and theme) and PortalButton.icon(icon:, tooltip:, onPressed:, variant: secondary, size:, ...): a circular icon-only button, 36 / 48 / 56 painted, tooltip required (it is the name), hit area minTapTarget around the paint. PortalButtonDock.grid(flexes: [..], scrollable: true): per-action flex by index, and a single sideways-scrolling row of natural-width actions (columns / flexes ignored there). Supersedes the "per-action flex not built" note below.

  • PortalListSection(children:) is now List<Widget>: a foreign ListTile or platform widget sits in a section with the same card, dividers and detail scope (a divider starts at a PortalListItem'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 a CustomScrollView, so a long list is one section, not one per row. Not built: .selectable outline 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, ...): the PortalListLeading.tile look outside a list row (glyph is 60% of size; decorative unless semanticLabel). PortalListLeading.tile now builds on it; PortalListTone moved to its file (same export). Not built: a size enum (a double covers the 36/44/52/60 componentSizes.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.widget were wrapped in ExcludeSemantics, and the row excluded its children). New PortalListLeading.interactive(child, extent:) and PortalListAccessory.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 .widget are 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 (semanticLabel is 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) and tokens.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's AppIconSize and AppSizes, 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, and PortalButton / PortalProgress keep their own heights.

  • PortalCardTheme(padding:, borderRadius:, backgroundColor:, border:, elevation:): re-skins every PortalCard (and the stat card and empty state built on it) through PortalThemeConfig.extensionsBuilder. Widget argument beats theme beats the variant's default; a set border also draws on tonal and elevated. PortalCard.elevation is 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?>, and PortalBlockingProgress.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 of columns (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, ...) (a FaIcon or SVG on the tile, no font dependency here), .custom(Widget, extent:) (logo plates) and .icon(icon, color:); PortalEmptyState(iconWidget:) (icon is now optional, one of the two is required). PortalListItem(subtitleWidget:, metaWidget:, progress:, progressColor:, progressLabel:, onLongPress:, destructive:) and PortalListAccessory.widget(child, semanticLabel:) / .iconButtons([PortalListIconAction(icon:, tooltip:, onPressed:)]). Read from finance's LedgerRow / AccountRow and task's AppListTile. Not built: LedgerRow's uppercase overline above the title (use subtitleWidget), task's external-link glyph and FA chevron (.widget), a chevron under a custom accessory.

  • PortalStatCard(valueColor:, backgroundColor:, margin:) and PortalStatCardTheme(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; footer carries a caption).

  • PortalAmount(tone:, foregroundColor:, fontSize:, fontWeight:, compact:, decimals:) with PortalAmountTone (neutral, credit, alert, muted, onPlate): finance's MoneyText needs, defaults unchanged. foregroundColor beats tone; decimals: false rounds to whole units; compact is the kit's £12.4K. test/portal_amount_test.dart compares the text with MoneyText's format. Differences kept on purpose: a negative is the kit's hyphen-minus where finance draws U+2212; compact is 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.date counted relative days by local-midnight Duration, so across a DST change Yesterday read Today. It now compares calendar dates (y/m/d), the same rule as finance's AppDateUtils.calendarDaysBetween.

  • PortalCalendar(selected:, onSelected:, initialMonth:, markedDays:, firstWeekday:, markedLabel:, onMonthChanged:): gym's month grid, moved up. Day cells keep a 0.72 painted disc inside a minTapTarget hit area, each day is a semantic button named by the localized full date (and markedLabel when 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:) and PortalTextField.amount(controller:, currencySymbol:, signed:, ...) with formatAmount / parseAmount. Label, helper and error are PortalFormField's (above the control, not a floating label); the control takes fill and borders from the theme's InputDecorationTheme; filled is the borderless pill (recipe note, invite box); the field is at least minTapTarget tall. The amount form is finance's AmountField: 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 floating labelText (use label), lifestyle's uppercase letter-spaced caption (an app choice; overline is the kit's eyebrow), finance's default-currency lookup (pass currencySymbol).

  • PortalBadge(label:, tone:, icon:, outlined:, foregroundColor:, backgroundColor:) with PortalBadgeTone (neutral, primary, secondary, success, warning, danger, info), and PortalProgress(value:, height:, fillColor:, trackColor:, overflowColor:, semanticLabel:), PortalSegmentedProgress(segments:, height:, showLegend:, formatValue:) (PortalProgressSegment) and PortalStepProgress(count:, current:, isDone:, onStepTap:). Union of gym's badge/progress, finance's StatusBadge/ProgressTrack/SegmentedTrack, journey's status chip (outlined + foregroundColor) and recipe's step bar. Re-skinned by PortalBadgeTheme(padding:, textStyle:, tintAlpha:, borderRadius:) and PortalProgressTheme(height:, fillColor:, trackColor:, overflowColor:, doneColor:). Not built: finance's ProgressMeter row (leading/trailing figures around a track) is a layout of PortalProgress, not a component.

  • Component re-skin hook: PortalStatCardTheme(accentColor:, valueColor:, labelColor:, padding:, wellAlpha:) and PortalEmptyStateTheme(iconColor:, iconWellColor:, iconSize:, titleColor:, messageColor:), ThemeExtensions with every field nullable (null derives from tokens; a widget argument still wins), registered through the existing PortalThemeConfig.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 by scripts/export-art.py from 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.dart draws each in light and dark at 1.0 and 1.3 text scale with the real typeface and icon fonts loaded. flutter test --update-goldens in example/ regenerates them. A disabled PortalListItem now dims its leading and trailing to 38% and top-aligns them to the title line.

  • G5: PortalResultScreen(state:, title:, body:, art:, dock:, onClose:) (PortalResultState success / 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 in docs/UI_PATTERNS.md, not classes.

  • G4: PortalButtonDock(primary:, secondary:, showRule:) and PortalScrollPage(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; PortalScrollPage reports that through PortalDockRule, a dock elsewhere passes showRule. The buttons are the caller's PortalButtons (large primary, ghost or tonal secondary).

  • G3: PortalPrompt(message:, title:, sentiment:, size:, icon:, action:, onDismiss:, visible:) with PortalSentiment (neutral / positive / warning / negative), PortalPromptSize (standard / compact / inline) and PortalPromptAction. One tonal emphasis: the sentiment's base at 12% over portal.card, a badge disc in four glyph shapes, text kept ink (an inline negative takes error), any foreground under 4.5:1 (text) or 3:1 (badge) stepping 12% toward onSurface. 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.disabledReason is 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) and PortalAmount(value, currency, size: hero | row, signed:, unit:, delta:) with PortalAmountDelta. New dependency: intl ^0.20.2. Rules are the kit's: symbol always, .00 only when padded, hyphen-minus negatives, a space before the unit, en-dash ranges, tabular figures, a long value scales down instead of wrapping. compact is English K/M/B only. en-GB dates read Sept (CLDR), where the kit's table says Sep. Not built: the hero's Settled / Pending status chip.

  • G1: PortalListItem(title:, subtitle:, meta:, leading:, inverted:, trailing:, onTap:, disabledReason:, isNew:) / .skeleton(leading:) and PortalListSection(header:, headerAction:, captionHeader:, style:, detail:, children:) / .selectable(selected:). The leading is one of PortalListLeading.icon | tile | avatar | thumbnail | order; the trailing is one PortalListAccessory: none | navigate({value}) | checkbox | radio | switchControl | iconButton | button | value | meta. A control accessory makes the whole row its target; iconButton and button make only themselves. Inset sections paint portal.card at radius.lg, dividers start at the text column and none follows the last row. disabledReason is a plain muted line until G3's inline prompt lands.

  • PortalAppBar(excludeHeaderSemantics:), default false: passes through to AppBar so a titleWidget that is a control (the assistant's model switcher) reads as a button, not a heading.

  • PortalReviewScope(enabled:, child:, statuses:) and PortalReviewTag(id:, child:) for the design-review demo (apps/portal_design): enabled switches 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) -- coloured todo/changes/approved off the ColorScheme. PortalReviewTag with no PortalReviewScope ancestor -- the case for every shipped app -- returns child unchanged, so it costs nothing outside the demo. The badge is IgnorePointer and 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:) and PortalPromptCard(icon:, title:, subtitle:, onTap:) + PortalPromptCardRow(children:, wrapped:). Structure lifted from portal_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 uses BorderRadiusDirectional so it points at its own author's edge under RTL instead of flipping to the wrong one, the user's gradient fill is tokens.gradients.accent, and PortalTypingDots' stagger comes from tokens.motion.staggerStep/slow and holds a still frame (no ticker at all) under MediaQuery.disableAnimations. PortalComposer keeps 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/docked swap the pill-with-inline-controls layout for the bordered-card-with-footer-row one. PortalPromptCard is built directly on PortalPressable (not PortalCard, which has no haptic hook) for a light tap haptic. This is the kit side only -- portal_ai still hand-rolls its own; a later pass wires it onto these.

  • Icon system: Material Symbols, one voice (new dep material_symbols_icons, re-exported as Symbols; PortalIcons is a typedef of the same class so the fleet's icon set has a Portal name). Every glyph is Symbols.<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: buildPortalTheme sets IconThemeData(fill: 0, weight: 400, grade: 0, opticalSize: 24) on iconTheme (Material's default colours) and primaryIconTheme (onPrimary), and applyPortalComponentThemes now recolours those with copyWith instead of replacing them, so the axes survive the config path (test pins both). Selection is fill 0 → 1 on the same glyph, animated on tokens.motion.standard: PortalBottomNavBar fills the selected destination over tokens.motion.medium (PortalNavDestination.selectedIcon is now optional — it stays for the apps' remaining Icons.x_outlined/Icons.x pairs, and the fill runs alongside a swap) and PortalFilterChip fills its icon over tokens.motion.fast, in step with its own colour change. PortalSegmentedTabs has 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 — Symbols has no _outline names; 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_rounded fallback is not needed. The axes only reach a ThemeData built by buildPortalTheme/PortalThemeConfig: an app that hand-rolls ThemeData(iconTheme: IconThemeData(color:, size:)) gets Flutter's IconThemeData.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 spring motion.standard may overshoot; Icon asserts the range) and drop to Duration.zero under reduce-motion, as does the nav bar's well.

  • PortalFab(icon:, tooltip:, onPressed:) / PortalFab.extended(icon:, label:, onPressed:, tooltip:, scrollController:) and PortalToolbar(actions:, clearance:). The FAB is the theme's floatingActionButtonTheme (colour, corner) drawn through PortalPressable — scale under the finger, spring back, Material's ripple kept on top — with one PortalHaptics.medium() on tap, and flat by decision like the toolbar and glass header: floatingActionButtonTheme.elevation is ignored (a press-scaled shadow can only live inside PortalPressable's own Material), so apps drop their FAB elevation: 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 (AnimatedSize on tokens.motion.standard, instant under reduce-motion), following scrollController or the route's PrimaryScrollController — which a PortalScrollPage body attaches to on Android/iOS, so inside one it needs no wiring there (desktop passes scrollController); every tab of an IndexedStack shell 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. tooltip is required on the icon-only form and defaults to label on the extended one, excluded from semantics while the label is visible. No Hero: 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 by PortalActionButton, the app bar's inline icon button (formerly private), so tooltip and badge come for free — as glass on every visual theme like the collapsed PortalHeader: portal.card at PortalGlassStyle.tintAlpha over a blurSigma backdrop 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 (default PortalBottomNavBar.overlayClearance) is the room kept under it for a nav that floats over the body; 0 when the Scaffold owns the nav. Sit it in floatingActionButton with centerFloat.

  • PortalAvatarMark(initials:, image:, size:, statusColor:), PortalCountBadge(child:, count:, visible:, backgroundColor:, foregroundColor:) and PortalProgressRing(value:, size:, strokeWidth:, label:, color:). The avatar is Material's CircleAvatar on primaryContainer — the photo in foregroundImage so a 404 or offline degrades to the initials, two characters upper-cased in the type style that fits the step — at the new DesignTokens.avatarSizes (PortalAvatarMarkSize.sm 32 / md 40 / lg 56 — not PortalAvatarSize, which the portal_avatar brick 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 named PortalAvatarMark, not the spec's PortalAvatar, because portal_platform already exports a public PortalAvatar(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's Badge/Badge.count (offset, 6 dp dot, 16 dp pill, 999+) plus what every call site wrote by hand: count: 0 hides, count: null is a dot, and backgroundColor/foregroundColor take a semantic pair (s.success/s.onSuccess) — theme error/onError when null. It is PortalCountBadge, not PortalBadge, because the portal_badge brick seeds a label chip by that name (gym has one) and the barrel would make it ambiguous. The ring is CircularProgressIndicator with a round cap and the theme's track, springing to each new value on tokens.motion.standard over tokens.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 own label), in a FittedBox that only shrinks so a large text scale stays inside the arc — excluded from semantics because the indicator announces it. Diameter defaults to avatarSizes.lg, stroke to spacing.xs.

  • PortalRefresh(onRefresh:, child:, edgeOffset:): the fleet's pull-to-refresh over RefreshIndicator, for the 35 default-look spinner discs in the apps. Flat (elevation 0) on surfaceContainerHigh, primary arc at a 2.5 stroke, one PortalHaptics.light() the moment the pull is released past the threshold. edgeOffset is where the disc drops out from — PortalRefresh.belowBar(context, large:) is the status bar plus a pinned PortalSliverAppBar, or plus the expanded PortalHeader.large (now PortalHeader.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 custom appBar:, the large one for header:.

  • PortalHeader.large(title:, subtitle:, actions:, trailing:) and PortalScrollPage(header:): the fleet's large-title header over SliverAppBar.large, for the 11 hand-rolled SliverAppBars in the apps. Material owns the collapse and the cross-fade; the header puts textStyles.headline on the expanded title (body on the subtitle under it) and collapses into the compact bar's own title — the same _PortalAppBarTitle PortalAppBar draws — 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 at PortalGlassStyle.tintAlpha over a blurSigma backdrop blur (a private sliver BackdropFilter, clipped to the bar — Flutter has no sliver one), scrolledUnderElevation 0. header: on PortalScrollPage carries its own title and actions, so the page's title/actions/trailing are ignored beside it; appBar: still wins for a hand-dressed sliver.

  • PortalSwipeRow(key:, child:, leading:, trailing:, borderRadius:): the fleet's swipe-to-act row over Dismissible, for the hand-styled Dismissibles in the apps. Each side takes a PortalSwipeAction(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× on spatialFast — with one PortalHaptics.medium() — the moment it is crossed. confirm (() => portalConfirm(context, …)) is asked after the slide-out and false springs the row back; dismisses: false is a toggle (complete, pin) that fires onTrigger and 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 is ExcludeSemantics so 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 is Dismissible's linear movementDuration (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 over showModalBottomSheet, replacing the per-call restyling at 36 sites. Surface, radii.xl top and grabber styling come from B4's bottomSheetTheme; the sheet passes showDragHandle (default on — hidden when isDismissible: false, since Material gives the handle its own drag-to-close), useSafeArea for the status bar, and wraps the content in SafeArea(top: false) plus the keyboard's viewInsets so the surface still runs under the nav bar. isScrollControlled defaults to true (a mainAxisSize: min body stays short; the keyboard lifts the sheet instead of squashing it inside the 9/16 cap). It slides on tokens.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) at tokens.motion.medium, leaves on standard.flipped like B2's pop, and skips the animation under reduce-motion. detents: [0.45, 0.9] puts a DraggableScrollableSheet inside (fractions of the height under the grabber and above the keyboard, snapping between them, PrimaryScrollController carrying 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 a ScrollView body 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 a SingleChildScrollView on the primary controller unless scrollable: false hands that to a ListView of its own.

  • Remaining sub-themes off Material defaults, on the PortalThemeConfig path (buildPortalTheme alone still leaves them at M3; the example gallery now builds through the config so it shows them). datePickerTheme and timePickerTheme sit on the dialog's shell — surfaceContainerHigh (a surface palette's cardColor still 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) and radii.md. bottomSheetTheme keeps radii.xl top on the panel surface and styles the drag handle without forcing it on: apps still hand-draw one on transparent sheets, and C1's PortalSheet passes showDragHandle itself. tabBarTheme drops the divider line and sets onSurface selected / onSurfaceVariant unselected; the indicator stays M3's 3dp rounded label-width bar so TabBar.indicatorColor and TabBar.secondary keep working. sliderTheme is M3's 2024 slider spelled out for Slider and RangeSlider, since year2023: false is 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 is primary at 15% like the progress track, because a surface palette maps secondaryContainer a hair off the card.

  • Dynamic colour seam, opt in. PortalThemeConfig.dynamicColor (default false) and PortalDynamicColorBuilder(config:, builder:), which hands the builder PortalThemeModes — a plain config.build() while the flag is off; with it on, the widget asks the dynamic_color plugin (new dep) for the device's Material You scheme — owning the query itself rather than wrapping DynamicColorBuilder, so the flag can flip at runtime without remounting the app under it — and PortalThemeConfig.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: buildPortalTheme sets pageTransitionsTheme to a PortalPageTransitionsBuilder on every platform — the horizontal shared-axis slide PortalPageTransitions.sharedAxis already drew, on the effects spring at tokens.motion.medium — so a plain MaterialPageRoute moves the Portal way with no call-site change. PortalPageTransitions.fadeThrough stays the call-site route for a root destination (the theme is per platform, not per route). PortalHero(tag:, child:, borderRadius:) wraps Hero with 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. PortalRadii defaults step up to sm 8 / md 12 / lg 20 / xl 28 (rounded to 10/16/24/32 so it still means rounder than default) and DesignTokens.expressiveCorners is on, so cards are continuous-corner squircles unless a token bundle says otherwise. PortalRadiiUtils.continuousBorder doubles 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's cardColor still wins — and PortalCard gets variant: tonal as its default beside outlined (the old bordered look), elevated (surface plus the card shadow, now painted outside the clipping Material so it actually shows) and glass; standard stays as an alias of outlined (deprecation waits for the app migration so flutter analyze stays green there). Filled buttons are pills (PortalButton primary/destructive and the FilledButton/ElevatedButton themes at radii.full), tonal/outlined/ghost keep radii.md. Dialogs, sheets and popups sit at surfaceContainerHigh, one tone above a card. Inputs fill surfaceContainerHighest at radii.md with no border until focus or error; where a surface palette folds surfaceContainerHighest into its card colour the fill steps to surfaceContainerHigh, so a field never vanishes into the card, sheet or dialog that holds it.

  • Type ramp: PortalTextStyles.hero (44/w800, tracked -1.0) above display for the one figure a screen is about; every style now carries a height on 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. PortalStatCard sets its value in numeric(title), or numeric(hero) with hero: true.

  • PortalGradients on DesignTokens.gradients: the three gradients the fleet draws, built from the ColorScheme so they follow a theme change — surfaceSheen(scheme) (top-left onSurface at 4% to nothing, layered over a surface colour), accent(scheme) (primary → primaryContainer at 135°) and imageScrim(scheme) (scrim at 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-hoc LinearGradients in app code, gym's subtleGradient first.

  • PortalSemanticColors: the status roles ColorScheme lacks — success, warning, info (each with on*, *Container, on*Container) plus danger* mirroring error* 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 with Blend.harmonize; buildPortalTheme attaches it, PortalSemanticColors.of(context) falls back to computed defaults when a theme was hand-rolled, and PortalThemeConfig.extensionsBuilder overrides per brightness (a later PortalSemanticColors replaces the default). Success toasts now paint success (was secondary), destructive toasts danger; PortalStatCard(delta:) paints a +/- change in success/danger.

  • PortalHaptics: the fleet's haptic vocabulary over the stdlib HapticFeedback — selection/light/medium/heavy plus the compound success (light→medium), warning (medium×2) and error (heavy→light→light), 40 ms apart. One global switch, PortalHaptics.enabled, set from the new PortalThemeConfig.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, and PortalPressable(haptic:) plays a PortalHapticKind before onTap for anything else.

  • PortalPressable: press state for anything tappable — shrinks to the new PortalMotion.pressScale token (0.97) on the effects spring while held, springs back on the spatial one. It hosts the InkWell, 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, PortalButton keeps its ripple and adds the scale (a loading button now goes through the same path and announces as disabled), PortalFilterChip and PortalStatCard press too.

  • Spring motion tokens. PortalMotion carries the M3 Expressive springs (spatialFast/Default/Slow, effectsFast/Default/Slow) as SpringDescriptions plus PortalSpringCurve, a Curve that plays a spring to its settle time and exposes that as duration for implicit animations. standard is now the effects spring (never overshoots, so nothing that lerps opacity, shadows or padding breaks) and emphasized the 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.fontFamily defaults to it and buildPortalTheme sets it as ThemeData.fontFamily, so an app gets the fleet typeface with no font of its own; a per-style family in PortalTextStyles still wins.

  • PortalListAccessory.navigate(swatch:): a 20 dp colour dot (decorative, out of semantics) drawn in place of the value text, for an accent picker. value still 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 a subtitle or a status, not both (asserted). Default (none) renders the bar as before. Not built: the kit's count · status pair (give the count in status).

0.1.2 #

  • Example app and screenshots.
0
likes
140
points
182
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Design tokens, ThemeExtension, and theme factories for the Portal UI kit.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

animations, auto_size_text, cached_network_image, dynamic_color, flutter, flutter_animate, flutter_svg, intl, material_color_utilities, material_symbols_icons, shimmer

More

Packages that depend on portal_ui_core