Repository navigation
What's Changed
-
feat: Add
TabView.automaticallyKeepAlive(defaults totrue). Set it tofalseto let each tab body useAutomaticKeepAliveClientMixinto control its own lifetime. -
BREAKING perf: Tree-shake
FluentIconsandWindowsIconsglyphs (#1375). Both classes are annotated with@staticIconProvider, so release builds include only the glyphs an app uses instead of the entire fonts.- On non-Windows platforms, a
WindowsIconwithoutfallbackIconnow renders the specifiedWindowsIconsglyph. It no longer looks up a same-namedFluentIconsglyph, since that lookup retained every glyph from both fonts. Controls in this package provide their fallbacks explicitly and are unchanged. - Name-based fallback lookup is available from
package:fluent_ui/windows_icon_fallback.dart. Importing it retains both fonts in full.
Migration:
// Before const WindowsIcon(WindowsIcons.add) // After const WindowsIcon(WindowsIcons.add, fallbackIcon: FluentIcons.add) // Or restore name-based fallback for every WindowsIcon before runApp import 'package:fluent_ui/windows_icon_fallback.dart'; WindowsIcon.fallbackResolver = fluentIconFallback;
- On non-Windows platforms, a
-
feat: Display icons in DevTools (#1365).
-
fix: Use Fluent icons in
InfoBarinstead of Material icons (#1366). -
fix: Avoid Material localizations in
TabView(#1367). -
fix: Keep
PaneItemtitles visible in open navigation panes narrower than approximately 226 px (#1370). -
feat/fix: Add
CommandBarThemeData,ButtonThemeData.smallIconButtonStyle, andRadioButton.toggleable; fixTextBoxselection-control recreation,CommandBaroverflow-menu padding and sizing,Tooltip.useMousePositionin nested overlays, and compactNavigationPanespacing (#1374).CommandBarThemeData, configured throughFluentThemeData.commandBarThemeorCommandBarTheme, controls the padding and open/closed decorations of the frame aroundCommandBaritems.smallIconButtonStylestyles small and tinyIconButtons, including buttons inTextBoxandPasswordBox, and falls back toiconButtonStyle.- When
RadioButton.toggleableis true, selecting the selected radio button again callsRadioGroup.onChangedwithnull. It defaults tofalse. TextBoxand controls built on it no longer recreate default selection controls on each build, avoiding disposal of visible selection handles while their overlay is building. Affected controls includeAutoSuggestBox,EditableComboBox,NumberBox,PasswordBox, andTextFormBox.- The
CommandBaroverflow menu now matchesMenuFlyoutpadding and item margins, and sizes to its content between 160 and 480 px. Long items can expand the menu beyond its previous 320 px limit. Tooltip.useMousePositionnow positions the tooltip correctly when the nearest overlay is offset from the window origin, such as in a nestedNavigator.- Opening a compact
NavigationPaneno longer shifts its toggle and footer items or adds a second 6 px gap below the toggle.
-
fix: Correctly render
Acrylicin flyouts and overlays (#1376; #719). -
BREAKING
TabViewnow requires aTabViewController, which owns its tabs and selected index (#1377; #1349).Migration:
// Before TabView( tabs: [ ... ], currentIndex: currentIndex, onChanged: (index) => setState(() => currentIndex = index), onReorder: (oldIndex, newIndex) { final tab = tabs.removeAt(oldIndex); tabs.insert(newIndex, tab); }, ) // After final controller = TabViewController( initialTabs: [ ... ], ); TabView( controller: controller, onChanged: (index) { // The controller has already selected index. }, )
- Create the controller in
State.initStateand dispose of it inState.dispose. - Replace selection state updates with
controller.select(index). The optionalonChangedcallback runs after the controller updates its selection. Tab.onClosedstill only requests a close. Remove the tab in that callback withcontroller.removeAt(controller.tabs.indexOf(tab)).- Replace
onReorderlist mutations withcontroller.move(oldIndex, newIndex). Drag reordering updates the controller automatically. - Add tabs from
onNewPressedwithcontroller.add(tab); the callback does not add a tab automatically.
- Create the controller in
-
fix: Pressing a
TreeViewItemwith a detachedFocusNodeno longer throws before selection or invocation, and the item can still be selected later through keyboard focus (#1378). -
fix: Correctly merge the
TextBoxsemantics node (#1379). -
fix: Prevent
StickyNavigationIndicatorfrom drawing on the pane toggle, search button, orPaneItemActions when no navigation item is selected (#1380).
New Contributors
- @RmanAkbarzadeh made their first contribution in #1353
- @melo936 made their first contribution in #1354
- @madmak2005 made their first contribution in #1373
Full Changelog: v4.16.1...v4.18.0