fluent_2_core 0.0.4
fluent_2_core: ^0.0.4 copied to clipboard
Shared Fluent 2 design tokens and theming. Consumed by every fluent_2_* UI package.
0.0.4 #
Fixed #
FluentAppremounted the whole app the first time it rebuilt after the fonts loaded. On a platform that loads fonts,build()returned aFutureBuilderuntil they loaded and the app directly on any later rebuild, so the root widget type changed and everyStatebelow was lost — a parent togglingthemeModewiped routes, typed text and scroll positions. It now always returns the oneFutureBuilderand builds the app as soon as the fonts are loaded.- Light lavender
background2Restwas navy's colour (#73), so lavender avatars rendered navy. The palette layer is generated from the Figma file, which has that slip and seven more, and no test compared it with React. The generator now corrects all eight to Fluent UI React v9 — lavenderbackground2Rest(light), redbackground3Restandforeground2Rest, greenforeground3Restandstroke2Rest, dark redstrokeActiveRest(all dark), and plumstrokeActiveRest(both) — andtoken_parity_test.dartnow checks every palette token against React in light, dark and Teams dark.
0.0.3 #
Added #
FluentScrollBehaviornow supplies a scrollbar.buildScrollbarreturned its child unchanged, on a doc comment claiming Fluent drew its own scrollbar in the UI packages — it did not.fluent_2contained no scrollbar at all,FluentColors.scrollbarOverlay(upstreamcolorScrollbarOverlay) was referenced by nothing, and the showroom had to hand-roll aRawScrollbarwith a hardcoded thumb colour to get one. Every consuming app inherited a scrollbar-less UI with no way to opt back in short of replacing the class. It is now aRawScrollbar— frompackage:flutter/widgets.dart, so still no Material dependency — painted incolorScrollbarOverlay, on vertical scrollers on desktop platforms only. This is a visible change in every app usingFluentApp. Pass your ownscrollBehaviorto opt out.
Added #
- React parity is now pinned by a test.
test/token_parity_test.dartchecks all 228 alias tokens across the four theme variants against a machine-generated snapshot of the real@fluentui/react-themethemes (test/fixtures/react_tokens.json, regenerated withnode tool/dump_react_tokens.js). It asserts three things: every token with a React counterpart matches it; the deliberate divergences are exactly the pinned ones — a divergence that disappears fails just as loudly as one that appears, so nobody diffing against React can quietly restore the black-on-black high contrast foregrounds; and the Dart-only tokens are pinned, so adding one is a conscious act rather than a typo that is never compared against anything.
Fixed #
-
Four status colours did not match Fluent UI React v9. Diffed all 228 alias tokens across the four theme variants against
@fluentui/react-theme(9.2.1, re-checked against 9.2.2): 860 of 864 values matched. The four that did not were transcription slips in the dark column only —colorStatusSuccessForegroundInverted(both brightnesses),colorStatusWarningForeground1,colorStatusWarningForeground3andcolorStatusWarningBorder1— where the dark warning ramp had values in the wrong slots (darkWarningForeground3held React's lightWarningBorder1value). Now matches React exactly.The remaining four differences are deliberate and stay: in high contrast,
colorNeutralForegroundInvertedand its hover/pressed/selected siblings are white where React is#000000. React's value pairs black on a blackcolorNeutralBackgroundInverted, which renders every inverted surface — tooltip, popover, teaching popover — outlined but empty. See the note attokens/theme_variants.dart:252.Also confirmed: 12 Dart tokens have no React counterpart (
colorStatusSevere*,colorStatusAvailableForeground3,colorStatusAwayBackground3,colorStatusOofForeground3). These are genuine extensions backingFluentPresenceBadgeand the severe ramp — React sources those at component level rather than promoting them to theme aliases. -
FluentPageRouteno longer allocates aCurvedAnimationper frame.buildTransitionsruns from the route's ownAnimatedBuilder, so every frame of a transition built — and never disposed — a new curve holding a status listener on its parent. It is now built once and disposed with the route. -
FluentThemeOverrideno longer takes a theme dependency when it has nothing to override. It read the ancestor theme before its own early return, so a no-op override rebuilt its whole subtree on any ancestor theme change.
0.0.2 #
- Use the Fluent 2 project logo as the pub.flutter-io.cn thumbnail.
- Require
fluent_2_fonts0.0.2.
0.0.1 #
- Initial release: Fluent 2 token tables (color, typography, spacing, radius,
stroke, elevation, motion),
FluentTheme/FluentThemeData,FluentApp, the light / dark / teamsDark / highContrast variants, and a Dart port of the Theme Designer brand-ramp generator. - Use the open-source Selawik family from
fluent_2_fontsfor the web and Windows typography ramp instead of selecting Segoe UI. - Select distinct Web, Windows, macOS, iOS, and Android typography metrics and
expose
fontPlatformfor explicit previews. - Preload the build-selected dynamic font before
FluentApppaints.
