frosted_ui 0.3.0
frosted_ui: ^0.3.0 copied to clipboard
Frosted glass for Flutter: panes rimmed with light stand on a canvas lit by soft washes of colour, and one ink act carries each page, by day and by night.
0.3.0 #
Frosted 0.3.0 stands on ui_core 0.3.0: its dialog, sheets, tooltip, tab bar, wheels, number field and rating keep their paint and take their behaviour from ui_core's parts, and it gains a context menu.
Breaking
FrostedNumberFieldhands back a typed figure at each key only while it stands betweenminandmax; one outside waits until it is taken (Return, or the focus leaving) and is clamped then: with a floor of 5, typing 12 no longer snaps to 5 at the 1. A round moves the value to the next multiple ofstepfrommin, so a round at 5 of a step of 10 lowers it to 0. A screen reader hears one field that steps up and down, not two buttons beside it.FrostedRatingcan be cleared: Home or 0 sets none, where the arrows stopped at one step.FrostedTooltipis aStatelessWidgetandFrostedTabBaraStatefulWidget.- In
package:frosted_ui/frosted_parts.dart:FrostedSoftDialogRouteis a ui_coreDesignDialogRoute(its page isbuilder: WidgetBuilder, notpageBuilder, and it has notransitionDuration);FrostedSoftSideSheetRoutehas notransitionDuration(ui_core's side sheet moves on a spring);FrostedSoftensBelowis gone, the routes softening the page below throughfrostedSoftBarrier, theirbarrierBuilder. - The checks Frosted's own tests ran from
ui_coreare inui_core_test(a dev dependency).
Moves
- The dialog and the sheets open and close on a spring (ui_core's sheet spring, which settles in about a quarter of a second), from wherever they are when they turn; a sheet let go mid-drag carries the finger's speed. Under Reduce Motion the panel cuts in while the page below dims, rather than fading: glass under a fade reads clear.
showFrostedDialoggrows its card in over the page asFrostedDialog.showdoes, rather than fading it.
Added
FrostedContextMenu: a menu ofDesignMenuEntrys opened where the user asks for it, by a right click, a long press, Shift+F10 or the Menu key, its rows the menu bar's.frostedShortcutLabel(context, activator): a shortcut written as Frosted's menus write it, "⇧⌘Z" on a Mac (each symbol its glyph) and "Ctrl+Shift+Z" elsewhere. The gallery's menus and palette write theirs with it.FrostedComboboxandFrostedMultiSelectsay asearchis loading, and say when it failed with a Try again row that Down reaches and Return runs;debounceDurationwaits for typing to rest.FrostedAmountFieldtakesonEditingComplete,inputFormattersandkeyboardType;FrostedSheet.raisetakes asemanticLabel, andFrostedSheet.shownames its sheet by its title.- In
package:frosted_ui/frosted_parts.dart:theme.dartcopied out of the package analyzes on its own. The baked token records (FrostedTokensand its parts) are a library of their own, and the theme's glass and control edge are drawn from its colours (frostedMaterialsOf,frostedRestRingOn), not from a theme of the package's.frostedFocusInkgives the ink focus is drawn in.
Flutter 3.50
- The example and the tests stand on
material_uiandcupertino_ui, which Flutter 3.50 asks for in place ofpackage:flutter/material.dartandcupertino.dart. The README's set-up starts an app onmaterial_ui'sMaterialApp, whose page routes take Frosted's motion fromFrostedThemewith noThemeDataof their own. FrostedPreview's app stands in a semantics container of its own. The route under a nested app stands a modal barrier, which hides from a screen reader whatever painted before it in its container, andmaterial_ui'sMaterialAppholds none of its own as Flutter's did: a heading above a preview left the page's semantics. The gallery's demo apps and Harbor's navigator stand in containers of their own too.FrostedNavigationBarstands on its fade into the canvas again, 104 up from the screen's foot, as the source's tab bar does: a card scrolling on under the glass dissolves into the canvas there, so its rim no longer runs beside the slab's sides on the same gutter and its rounded foot no longer frames the slab from under it. The inventory stands the bar on a stage of the canvas the fade's height, so the fade meets the canvas rather than drawing a box on the card.- Keyboard focus shows as light, never a dark line round glass. By day a theme whose accent is its words' ink (opal) draws focus in its cool blue, not near black: the focus ring's line and a focused field's edge (still under its white glow). Themes with a coloured accent draw focus as before, and by night focus is as it was.
From ui_core 0.3.0
- The tooltip stays while the pointer moves onto it, one shows at a time, and along a toolbar the next shows at once.
- The tab bar is one Tab stop; the arrows move along it (mirrored right to left), Home and End to its ends, and a screen reader hears a tab bar, each tab with its place ("Income, tab 2 of 3").
- The wheels take Page Up and Page Down, Home and End, and a row's first letters; Left and Right move between the time picker's wheels; a row crossing the band ticks.
- The rating shows where a press would set it while a pointer rests over it, and takes End and the digits.
- The dialog tells a screen reader it is a dialog,
FrostedDialog.show's an alert; the dialog and the sheets keep focus inside them and give it back as they close, and a sheet, a side sheet or a page dragged and let go where it was holds the focus again. Escape closes a dialog or a sheet whose barrier a tap does not dismiss, however the focus sits (aPopScopestill refuses it). - A tab whose words grow where it stands (larger text, the chosen tab's words turning bold) lays the tab bar out again rather than cutting its words.
0.2.1 #
Frosted 0.2.1 stands on ui_core 0.2.1. Nothing is renamed or removed.
- iOS's Reduce Motion now calms Frosted. Flutter reports it in
AccessibilityFeatures.reduceMotion, notMediaQuery.disableAnimationsOf, which was allFrostedMotion.ofread, so on an iPhone set to Reduce Motion every switch, toast, menu and sheet still eased.FrostedMotion.ofreads ui_core'sdesignReduceMotionOf(Android's Remove animations, the web'sprefers-reduced-motionand iOS's Reduce Motion), and the progress indicators, the skeleton and the loading state stop and start their loops as the setting changes. - An insight's visit dots no longer say "1 visits":
FrostedLocalizations.visits(count)speaks them in the app's plural forms, "1 visit" and "13 visits" in English by default. It has a body, so localizations written for 0.2.0 still build. - From ui_core 0.2.1: a menu or popover gives focus back to the control that opened it as it closes, a combobox's list no longer opens again on that returned focus (so Android's back pops the page), and Home and End keep the item they focus in view.
0.2.0 #
Frosted 0.2.0 stands on ui_core 0.2.0.
- Fields, sheets and menus no longer crash in apps set to a language other than English; their built-in labels now follow the app's language. The theme brings the Material and Cupertino words its parts need when the app gives none (in every language Flutter translates, English for the rest), and a field's text menu says Cut, Copy and Paste in the app's language.
- The words every look shares (Cancel, Close, Today, ...) come from ui_core in 30 languages;
DesignLocalizationsis exported besideFrostedLocalizations. A pending transaction's note is a word ofFrostedLocalizations(pending), so it is translated with the rest. - Every control is a finger's target: 48 px under a finger and 44 px under a pointer, through ui_core's
DesignTapTarget, so what a tap reaches, what a screen reader outlines and the layout agree. A field answers a tap anywhere on its well; a removable tag answers in its lane; the filter chips and a phone's tab strip run on under the screen's gutters and take taps there. - Shadows are whole: a strip, a sheet or a swipe row no longer cuts the shadow of a chosen plate, a lifted card or an action; a swipe row clips only along its swipe.
- Large text: filter chips and segmented buttons grow with the reader's text size; a shared strip ends a word too long for its share in an ellipsis; a form row's control moves under its words when they have no room beside it.
- Spacing on a 2-point grid: the gaps and insets that sat at 3, 5, 11 or 13 now sit at 2, 4 or 12; the segmented control is 28 tall in a 32 strip, as iOS's.
- The tab bar stands on the page's margin with its chosen plate set in evenly; a list group's hairline is a rule over the row, not a box round it; the command palette dims and softens the page behind it as every raised slab does.
- Pages move in Frosted's own way on every platform, rather than the platform's: a page pushed over another clears in
as it settles 24 px toward the end (300 ms), the page under it standing still, and goes back the way it came. A
FrostedPagetakes it, and so does every page route of an app onmaterial_ui, the Material Frosted is built on; an app on Flutter's ownMaterialAppputsfrostedPageTransitionsin its theme'sPageTransitionsTheme(the README's set-up does), and itsMaterialPageRoutes and go_router's pages match. A full-screen dialog rises 24 px instead, iOS keeps its drag from the edge to go back (ui_core'sDesignSwipeBackPageTransitionsBuilderround Frosted's motion, in the map's iOS entry), and Reduce Motion makes it a cut. Switching tabs or sidebar destinations changes the page in place. - By night a switch that is on shows a dark knob on its light track (it read as off or disabled), and a field, a code box or a well in error is edged in red rather than in a pale pink that read as focus; by day the error edge is a clearer red too. The empty state's light no longer stands in a pale box.
- Open lists show the chosen option at a glance. In a select's or a menu's list, and in the lists a combobox, a multi-select or a menu bar opens, the chosen row stands on the brighter chosen glass, as a chosen chip or tab does (it was a checkmark on the same quiet tint a hover used). A pointer over another row, or the keyboard holding one, lights it with the quieter tint, never the chosen glass, so neither reads as a second choice; a menu's rows now light under a pointer too. A multi-select's tags, typed words and hint start where every other field's words do (they stood 4 px further out).
- Every menu lights one row at a time: a select's or a menu's, a menu bar's and a split button's. A pointer moving over a row moves the lit row there and the keys go on from it (Return takes the pointer's row in a menu); a pointer resting on a row the keys left lights nothing. Opened by a pointer, a menu lights no row until the pointer or a key moves (a menu bar's or a split button's lit its first row); the first Down then lights the first row. The keyboard's ring stands inside its row, the menu's inset clear all round it and its corners concentric with the menu's (it stood 4 px outside the row, about 2 px from the menu's edge).
- A select's and a menu's open list take the keyboard: opened by a key (Enter or Space, or an arrow on a select) the chosen option takes the focus, or the first when none is chosen; the arrows move at once (right after a pointer opened it too) and go round the ends, Home and End go to them, a typed letter jumps to the next option it starts, Enter or Space chooses and closes, and Escape closes and gives the field the focus back. A select tells a screen reader whether its list is open.
- A combobox's and a multi-select's lists take ui_core 0.2.0's keys: the arrows go round the ends, and on a closed
list they open it without moving. A combobox opened before its words are edited lists every option with the chosen
one held (it listed only that one); edited words narrow it.
isOptionEnabledonFrostedComboboxandFrostedMultiSelectdims an option the arrows then pass over and neither a press nor Return takes, nor typing in a multi-select. Their pointer and keys hold one row: a pointer moving over a row lights it and the arrows go on from there, so the list never shows two lit rows. A long list opens with its chosen row in view and keeps the row the keys light in view; a combobox at the foot of the screen opens its list above it when there is more room there (it opened below with room for a row). In a menu bar's menu a typed letter goes to the next item it starts. - In a browser, typing goes on after Return in a combobox, a multi-select and a command palette's search: Return
takes the option, adds the tag or runs the command, and the field keeps the focus and takes the next letters (a
multi-select's next tag needed a click, and the letters after Return went nowhere).
FrostedTextFieldtakesonEditingCompletefor a field of your own that keeps the focus after Return, such as an "add another" field; use it in place ofonSubmitted, never with it. - Android's back closes what is open over a page before the page: a sheet, a dialog, a menu or a select's list, and now a popover, a split button's or a menu bar's menu (the focus back on its control) and a combobox's or a multi-select's list (the focus staying in the field).
- A tablet is no longer a stretched phone. From 600 wide (
FrostedBreakpoints.medium, where Material's medium window class starts;FrostedBreakpoints.isCompactsays a phone's) a sheet stands as the centred card it is on the desktop, and the tab bar hugs its tabs in the middle of the foot rather than spanning the window. A menu, a popover or a split button's menu opened by a key gives its first row the focus as it opens (its panel built nothing on its first frame). FrostedTheme.ofgives the default theme when noFrostedThemeis above (asTheme.ofdoes), so text selected on iOS under a host placed belowhome:no longer throws;FrostedTheme.maybeOfstill gives null.- Every public widget describes its fields in the inspector and in a failing test's tree, its defaults hidden; the parts that take a value in a range (sliders, a rating, page dots, pagination, a number field, a resizable split, a meter, a badge, a code field) assert it in debug builds.
FrostedStyleis ui_core'sDesignStyle, shared by every look; code that builds one changes nothing.- Deprecated:
FrostedLocalizations'cut,copy,paste,lookUp,searchWeb,shareandscanText, which the text menu no longer reads; useMaterialLocalizations' button labels. - Deprecated:
FrostedThemeData.copyWith'sshadows,glass,pearlandsheens. A free shadow could make Frosted's soft lift a hard one, and an opaque or dark tint turned its glass into paint. Take them from a preset (FrostedThemeData.preset), or setopaqueMaterials: true, the solid form for high contrast. They still work until they are removed; nodart fixmoves them, since no value stands in for them one for one. - Breaking in debug builds: the ink act keeps its pill. A
FrostedButtonwhose ownstyle:gives it a shape that squares its ends fails an assert naming law 6 (the ink pill); a release build draws the pill. The theme's button shape (FrostedComponentThemes.button) still shapes every glass button and now passes the ink act by, so a theme of square buttons squares the glass ones only. To shape a button, shape aFrostedButton.glass.
0.1.1 #
- Filter chips (
FrostedFilterChipGroup) no longer slide a chosen plate across the gaps between them: each chip carries its own chosen glass, which fades in where the chip stands while the chip left fades back. The segmented control, whose segments share one capsule, still slides. FrostedSlidershows the click cursor under a mouse, over its whole track and its thumb; while it is off, the cursor of what is under it.- More parts show their cursor under a mouse: the click cursor on
FrostedNavigationBar's tabs,FrostedNavAction,FrostedRangeSlider's track andFrostedColorPicker's hue and opacity tracks (their thumbs keep the resize cursor); the open hand onFrostedReorderableListView's grip, aFrostedSwipeActionsrow and a phone sheet's grabber.
0.1.0 #
- First release of Frosted as a package: light through frosted glass, by the names Material gives its components
(
FrostedButton,FrostedTextField,FrostedSelect,FrostedAppBar,FrostedNavigationBar,FrostedNavigationDrawer,FrostedListTile,FrostedCheckbox,FrostedSwitch,FrostedSlider,FrostedSegmentedButton,FrostedTabBar,FrostedDialog,FrostedSnackBar, ...), withonPressed,value/onChangedandselectedIndexthroughout, from a phone to a desktop (menu bar, command palette, data table, tree view, resizable panes, hover card). FrostedThemeDatashaped like Material's:colorScheme,textTheme(displayLargetolabelSmall, and the look's figures),shadows, and the look's ownglass,pearl,toastandhues, each withcopyWith; the theme hascopyWith,lerpand value equality.FrostedThemeas anInheritedThemeand the whole install, in any app'sbuilder:(Material, Cupertino or Widgets), withdarkData:for the dark appearance;AnimatedFrostedTheme.- Seven presets (opal, quartz, garnet, glacier, cobalt, jade, copper), each designed in light and dark, and
FrostedThemeData.from(accent:)for a palette of your own that keeps 4.5:1 for words. FrostedDensity(standard, comfortable, compact), following the platform until set (compact on macOS, Windows and Linux);FrostedTypefacefor your own faces;componentsfor every part's theme;style:on the parts, aFrostedStylewithButtonStyle's slots.- Tokens for your own parts:
FrostedCorners(radii and the look's outlines),FrostedSpacing,FrostedStrokes,FrostedMotion. FrostedGlyphs(the glyphs the components draw, by meaning) andFrostedLocalizations(every word they say).- Frosted's own text selection handles and context menu on every field; nothing of Material shows.
- Every control's target is 48 px under a finger and 44 px under a pointer; faces keep their size.
frostedLoadFonts, to set the first frame in the bundled faces.- No router: the package takes none.
- Bricolage Grotesque and DM Sans bundled (SIL OFL 1.1); icons from Lucide (ISC).
