Skip to content

4.18.0

Latest

Choose a tag to compare

@bdlukaa bdlukaa released this 12 Nov 14:01
e183ad9

What's Changed

  • feat: Add TabView.automaticallyKeepAlive (defaults to true). Set it to false to let each tab body use AutomaticKeepAliveClientMixin to control its own lifetime.

  • BREAKING perf: Tree-shake FluentIcons and WindowsIcons glyphs (#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 WindowsIcon without fallbackIcon now renders the specified WindowsIcons glyph. It no longer looks up a same-named FluentIcons glyph, 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;
  • feat: Display icons in DevTools (#1365).

  • fix: Use Fluent icons in InfoBar instead of Material icons (#1366).

  • fix: Avoid Material localizations in TabView (#1367).

  • fix: Keep PaneItem titles visible in open navigation panes narrower than approximately 226 px (#1370).

  • feat/fix: Add CommandBarThemeData, ButtonThemeData.smallIconButtonStyle, and RadioButton.toggleable; fix TextBox selection-control recreation, CommandBar overflow-menu padding and sizing, Tooltip.useMousePosition in nested overlays, and compact NavigationPane spacing (#1374).

    • CommandBarThemeData, configured through FluentThemeData.commandBarTheme or CommandBarTheme, controls the padding and open/closed decorations of the frame around CommandBar items.
    • smallIconButtonStyle styles small and tiny IconButtons, including buttons in TextBox and PasswordBox, and falls back to iconButtonStyle.
    • When RadioButton.toggleable is true, selecting the selected radio button again calls RadioGroup.onChanged with null. It defaults to false.
    • TextBox and 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 include AutoSuggestBox, EditableComboBox, NumberBox, PasswordBox, and TextFormBox.
    • The CommandBar overflow menu now matches MenuFlyout padding 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.useMousePosition now positions the tooltip correctly when the nearest overlay is offset from the window origin, such as in a nested Navigator.
    • Opening a compact NavigationPane no longer shifts its toggle and footer items or adds a second 6 px gap below the toggle.
  • fix: Correctly render Acrylic in flyouts and overlays (#1376; #719).

  • BREAKING TabView now requires a TabViewController, 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.initState and dispose of it in State.dispose.
    • Replace selection state updates with controller.select(index). The optional onChanged callback runs after the controller updates its selection.
    • Tab.onClosed still only requests a close. Remove the tab in that callback with controller.removeAt(controller.tabs.indexOf(tab)).
    • Replace onReorder list mutations with controller.move(oldIndex, newIndex). Drag reordering updates the controller automatically.
    • Add tabs from onNewPressed with controller.add(tab); the callback does not add a tab automatically.
  • fix: Pressing a TreeViewItem with a detached FocusNode no longer throws before selection or invocation, and the item can still be selected later through keyboard focus (#1378).

  • fix: Correctly merge the TextBox semantics node (#1379).

  • fix: Prevent StickyNavigationIndicator from drawing on the pane toggle, search button, or PaneItemActions when no navigation item is selected (#1380).

New Contributors

Full Changelog: v4.16.1...v4.18.0