Fluent2ThemeData class final

Fluent 2's theme: one preset in one appearance, as Material's ThemeData is Material's. Every colour is a Fluent alias in colors (ui_core's roles below are named views of them), the page's ground (background), the acrylic (acrylic), the elevations (shadows, brandShadows), the type ramp (caption2 to display, Fluent's own names), the component themes (components), and the density, typeface and solidAcrylic settings. Corners and strokes are Fluent's tokens (Fluent2Radius, Fluent2Stroke), and the acrylic's recipe and the elevations are Fluent's too; a component theme sets one part's shape.

Built from a preset (preset, or a named factory such as Fluent2ThemeData.lapis) and changed with copyWith; lerp blends two, as AnimatedFluent2Theme does. Fluent2Theme puts one in scope.

final theme = Fluent2ThemeData.lapis(Brightness.dark).copyWith(
  density: Fluent2Density.compact,
);
Mixed-in types
Annotations

Constructors

Fluent2ThemeData.berry([Brightness brightness = Brightness.light])
The berry preset: a vivid magenta brand ramp (#C239B3) from Fluent's theme designer.
factory
Fluent2ThemeData.clover([Brightness brightness = Brightness.light])
The clover preset: a green brand ramp (#107C10) from Fluent's theme designer.
factory
Fluent2ThemeData.flint([Brightness brightness = Brightness.light])
The flint preset: graphite (#394146), a neutral ramp with no accent.
factory
Fluent2ThemeData.from({required Color brand, Brightness brightness = Brightness.light, String id = 'custom', Fluent2Density? density, Fluent2Typeface? typeface, Fluent2ComponentThemes? components})
A Fluent 2 theme from one brand colour, as Fluent's theme designer makes one and as ColorScheme.fromSeed does for Material: a 16-shade ramp with brand at shade 80 (eased to black below it and to white above), every brand alias set from the shade Fluent's own lapis theme sets it from in brightness, the neutrals and statuses Fluent's own. Then the contrast bars hold, whatever brand is: each brand family steps along the ramp, hover and pressed with it, until
factory
Fluent2ThemeData.iris([Brightness brightness = Brightness.light])
The iris preset: Fluent's indigo light and dark (#5B5FC7).
factory
Fluent2ThemeData.juniper([Brightness brightness = Brightness.light])
The juniper preset: a teal brand ramp (#038387) from Fluent's theme designer.
factory
Fluent2ThemeData.lapis([Brightness brightness = Brightness.light])
The lapis preset: Fluent's own web light and dark, the familiar web blue (#0F6CBD).
factory
Fluent2ThemeData.pumpkin([Brightness brightness = Brightness.light])
The pumpkin preset: a warm orange brand ramp (#CA5010) from Fluent's theme designer.
factory

Properties

accent → Color
The brand fill: a primary button, a checked box: brandBackground.
no setter
accentSubtle → Color
The brand's tint: a selected row, an informative wash: brandBackground2.
no setter
accentText → Color
Brand words and glyphs on the surfaces: brandForeground1.
no setter
acrylic → Fluent2AcrylicRecipe
The acrylic of what floats over the page.
final
avatarTheme → Fluent2Style
An avatar's theme.
no setter
background → Color
The ground the page stands on: Fluent's quiet base layer, faintly tinted by the brand. Light: the brand's palest shade at 30% over neutralBackground3 (#F5F5F5); dark: its deepest shade but one at 30% over neutralBackground2 (#1F1F1F).
final
badgeTheme → Fluent2Style
A badge's theme.
no setter
body1 → TextStyle
body1, 14/20 regular: the running text of every control and row.
latefinal
body1Strong → TextStyle
body1Strong, 14/20 semibold: a button, a row's title, a label.
latefinal
body1Stronger → TextStyle
body1Stronger, 14/20 bold.
latefinal
body2 → TextStyle
body2, 16/22 regular: a large control, a reading paragraph.
latefinal
border → Color
A divider, a card's edge: neutralStroke2.
no setter
borderStrong → Color
A control's outline: neutralStroke1.
no setter
bottomSheetTheme → Fluent2Style
A bottom sheet's theme.
no setter
brandShadows → Fluent2Shadows
The brand elevations (shadow2Brand .. shadow64Brand): a primary button raised, a selected card.
final
brandVariants → List<Color>
The brand ramp, shades 10 to 160 (brand reads one by its number).
final
brightness → Brightness
Which appearance this theme is.
final
caption1 → TextStyle
caption1, 12/16 regular: a timestamp, a hint, a tab bar's label.
latefinal
caption1Strong → TextStyle
caption1Strong, 12/16 semibold: a badge, a small button.
latefinal
caption1Stronger → TextStyle
caption1Stronger, 12/16 bold.
latefinal
caption2 → TextStyle
Fluent's caption2, 10/14 regular.
latefinal
caption2Strong → TextStyle
caption2Strong, 10/14 semibold.
latefinal
cardTheme → Fluent2Style
A card's theme.
no setter
checkboxTheme → Fluent2Style
A check box's theme.
no setter
colors → Fluent2Colors
Every Fluent alias colour of this preset and appearance, by Fluent's name: t.colors.neutralBackground1, t.colors.brandBackgroundHover, t.colors.statusDangerForeground1.
final
components → Fluent2ComponentThemes
The component themes, one per part, each empty unless set; every part also reads its own through the getters below (primaryButtonTheme, checkboxTheme, ...).
final
danger → Color
Danger's ink (Fluent's error).
no setter
dangerSubtle → Color
Danger's tint.
no setter
density → Fluent2Density
How compact the controls stand; Fluent2Density.standard unless set.
final
dialogTheme → Fluent2Style
A dialog's theme.
no setter
display → TextStyle
display, 68/92 semibold: the one display figure of a page.
latefinal
edge → Color
The 3:1 edge of an input and a toggle: neutralStrokeAccessible.
no setter
focus → Color
The focus ring's outer stroke: strokeFocus2.
no setter
hashCode → int
The hash code for this object.
no setteroverride
iconButtonTheme → Fluent2Style
An icon button's theme.
no setter
id → String
Which preset this theme is (see presets).
final
isDark → bool
Whether this is the dark appearance.
no setter
largeTitle → TextStyle
largeTitle, 40/52 semibold: a lead figure.
latefinal
A link's ink: brandForegroundLink.
no setter
listItemTheme → Fluent2Style
A list row's theme.
no setter
A menu's theme.
no setter
onAccent → Color
Words on accent: neutralForegroundOnBrand.
no setter
onDanger → Color
Words on danger's solid.
no setter
onSuccess → Color
Words on success's solid.
no setter
outlineButtonTheme → Fluent2Style
An outline button's theme.
no setter
overlay → Color
The scrim under a dialog or a drawer: backgroundOverlay.
no setter
primaryButtonTheme → Fluent2Style
A primary button's theme.
no setter
radioTheme → Fluent2Style
A radio's theme.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secondaryButtonTheme → Fluent2Style
A secondary button's theme (the default appearance).
no setter
segmentedButtonTheme → Fluent2Style
The segmented strip's theme.
no setter
shadows → Fluent2Shadows
The neutral elevations (shadow2 .. shadow64).
final
sharedColors → Fluent2SharedColors
Fluent's shared palette in this appearance (the avatars', badges' and tags' named hues).
final
sliderTheme → Fluent2Style
A slider's theme.
no setter
solidAcrylic → bool
Whether what floats (the tab bar, a pinned top bar, the nav pane, a menu) stands on its acrylic's opaque fallback instead of blurring the page behind: Fluent's own reduce-transparency fallback, for a device that should not pay for the blur or a reader who needs a steady ground under the words. False unless set; the recipe itself stays Fluent's.
final
subtitle1 → TextStyle
subtitle1, 20/28 semibold: a dialog's title, a drawer's title, a phone page's title.
latefinal
subtitle2 → TextStyle
subtitle2, 16/22 semibold: a card's title, a dialog's section.
latefinal
subtitle2Stronger → TextStyle
subtitle2Stronger, 16/22 bold.
latefinal
subtleButtonTheme → Fluent2Style
A subtle button's theme.
no setter
success → Color
Success's ink.
no setter
successSubtle → Color
Success's tint.
no setter
surface → Color
A card's, a list's, a field's face: neutralBackground1.
no setter
surfaceAlt → Color
An inset ground (a filled field, a well, a code line): neutralBackground3.
no setter
surfaceInverse → Color
The inverted plane (a tooltip, an inverted toast): neutralBackgroundInverted.
no setter
switchTheme → Fluent2Style
A switch's theme.
no setter
tabListTheme → Fluent2Style
A tab bar's theme.
no setter
tagTheme → Fluent2Style
A tag's and an interaction tag's theme.
no setter
textDisabled → Color
The ink of a disabled control: neutralForegroundDisabled.
no setter
textFieldTheme → Fluent2Style
A field frame's theme.
no setter
textInverse → Color
Words on surfaceInverse: neutralForegroundInverted.
no setter
textPrimary → Color
The first ink: neutralForeground1.
no setter
textQuiet → Color
The fourth ink, the quietest word: neutralForeground4.
no setter
textSecondary → Color
The second ink: neutralForeground2.
no setter
textTertiary → Color
The third ink, a caption's: neutralForeground3.
no setter
title1 → TextStyle
title1, 32/40 semibold: a hero's title.
latefinal
title2 → TextStyle
title2, 28/36 semibold: a page's title on the desktop.
latefinal
title3 → TextStyle
title3, 24/32 semibold: a section's title on the desktop.
latefinal
toastTheme → Fluent2Style
A toast's theme.
no setter
tooltipTheme → Fluent2Style
A tooltip's theme.
no setter
transparentButtonTheme → Fluent2Style
A transparent button's theme.
no setter
typeface → Fluent2Typeface
The face and size scale of the type ramp; Selawik at Fluent's sizes unless set.
final
warning → Color
Warning's ink.
no setter
warningSubtle → Color
Warning's tint.
no setter

Methods

brand(int shade) → Color
The brand ramp's shade shade (10, 20, .. 160).
copyWith({Fluent2Colors? colors, Fluent2SharedColors? sharedColors, List<Color>? brandVariants, Color? background, Fluent2AcrylicRecipe? acrylic, Fluent2Shadows? shadows, Fluent2Shadows? brandShadows, Fluent2Density? density, Fluent2Typeface? typeface, bool? solidAcrylic, Fluent2ComponentThemes? components, Fluent2Style? primaryButtonTheme, Fluent2Style? secondaryButtonTheme, Fluent2Style? outlineButtonTheme, Fluent2Style? subtleButtonTheme, Fluent2Style? transparentButtonTheme, Fluent2Style? iconButtonTheme, Fluent2Style? checkboxTheme, Fluent2Style? radioTheme, Fluent2Style? switchTheme, Fluent2Style? textFieldTheme, Fluent2Style? tagTheme, Fluent2Style? sliderTheme, Fluent2Style? segmentedButtonTheme, Fluent2Style? tabListTheme, Fluent2Style? cardTheme, Fluent2Style? listItemTheme, Fluent2Style? dialogTheme, Fluent2Style? bottomSheetTheme, Fluent2Style? menuTheme, Fluent2Style? toastTheme, Fluent2Style? tooltipTheme, Fluent2Style? badgeTheme, Fluent2Style? avatarTheme}) → Fluent2ThemeData
This with the named parts changed: the colours (colors, sharedColors, brandVariants, background), the settings (density, typeface, solidAcrylic), and the component themes whole (components) or one by one. The type ramp follows the first ink of colors and typeface.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
lerp(Fluent2ThemeData? other, double t) → Fluent2ThemeData
Between this and other, as ThemeData.lerp: the colours, the ramp, the material, the elevations, the component themes and the density blend; the preset id, the appearance, the shared palette and solidAcrylic change at the middle. AnimatedFluent2Theme animates with it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
tone(Fluent2Tone tone) → Fluent2ToneColors
One tone's colours, from Fluent's status tokens (danger, success, warning), its severe palette (dark orange), its brand and its neutral informative. The ink is the status Foreground1, the solid its Background3, the tint its Background1 and the border its Border1; warning's solid carries the page ink, as Fluent's warning badge does (white on #F7630C reads 3.0:1).
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

contrast(Color ink, Color ground) → double
The WCAG contrast ratio of ink on ground, 1..21, as it is seen: a translucent ink is laid over the ground first. ground is opaque.
preset(String id, Brightness brightness) → Fluent2ThemeData
The theme for preset id in brightness; an unknown id throws.
type(double size, double line, int weight, Color color) → TextStyle
A Fluent type style in the bundled face: size on a line px line at weight, in color, set with even leading so a line centres in its box as CSS centres it.

Constants

face → const String
The bundled face: Selawik, the open stand-in for Fluent's system face (metric compatible), in its regular, semibold and bold files.
presets → const List<String>
The preset ids, the first the default.