dialog_dock 0.1.3
dialog_dock: ^0.1.3 copied to clipboard
Minimize Flutter dialogs into a floating holder instead of closing them, then restore them with their state intact. A drop-in for showDialog.
0.1.3 #
- Fix: a
FloatingDialogHolderinside another one (for example around a single page) now reuses the outer holder. Before, both holders showed a bar, and windows minimized on that page disappeared when leaving it. - Fix: restoring a window after changing the theme or language showed the old theme or language during the restore animation. The animation now pictures the window as it looks at that moment.
0.1.2 #
- The holder bar can be dragged anywhere on the screen. The spot is kept in
memory while the app runs and resets to the corner on restart. Turn it off
with
FloatingDialogConfig(holderDraggable: false).
0.1.1 #
- Screenshots on pub.flutter-io.cn and in the README (desktop, mobile, dark mode, RTL, customization).
0.1.0 #
First public release.
FloatingDialogHolder: wrap the app once (MaterialApp.builder); no controller or provider setup.showFloatingDialog<T>: drop-in forshowDialogthat returns theNavigator.popresult. Falls back toshowDialogwithout a holder.- Each window has its own navigator: existing dialogs work unchanged, and dialogs opened from a window stay above it.
- Back (Android, browser) and Esc dismiss the window, never the page below; Ctrl+M minimizes. Both shortcuts are configurable.
- Focus is trapped in the open window and restored afterwards; screen readers can't reach the app behind it.
- Memory:
maxMountedWindowsevicts the least recently minimized window;FloatingDialogStateKeepersaves content across eviction. - Customization:
FloatingDialogColors(config or theme extension),iconBuilderfor SVG/image icons,headerActions,windowButtons,frameBuilder/windowFrameBuilder,headerTextStyle,frameShape. Every value inFloatingDialogConfigis overridable. - macOS-style animations: Genie (or Scale / fade) minimize into the bubble
and back, zoom-in open, and a close that drops towards the bottom center
(
closeEffect, or fade). Tapping outside a pinned window sends it to the pinned dock instead of closing it.originKeymakes a window grow out of, and shrink back into, the widget it was opened from (like a Hero). Respects reduce motion. - The pinned dock collapses to a thin indicator on every device (expands on
hover or tap), scrolls instead of overflowing and stays clear of the
holder bar.
dockAlwaysExpanded: truekeeps it open. - Window design:
liquidGlass(macOS-style frosted glass windows, holder bar and dock);windowButtonStyle(macOS traffic lights by default, with Dock-style hover magnification, or tonal / plain);windowButtonsPlacement,windowButtonSize,windowButtonHoverScale,windowButtonDecoration,windowButtonIcons(replace any built-in button) andheaderHeight. Header actions take adecoration. - Storage:
KeyValueFloatingDialogStorageworks with SharedPreferences or any key-value store; no plugin dependency.
Migrating from the internal version #
BlocProvider(create: FloatingDialogHolderCubit(...))+FloatingDialogLayer→FloatingDialogHolder(...)inMaterialApp.builder.cubit.open(action)returns aFloatingDialogHandle(status + result) instead ofbool;restorereturns aFloatingDialogStatus.syncActions→registerActions.closeHostDialog(context)→Navigator.pop(context);isHostDialogActive→isFloatingDialogActive;dialogHostContextis no longer needed.FloatingDialogConfigis now an instance; pass the old values (e.g.holderBottomOffset: 72) toFloatingDialogHolder(config: ...).FloatingDialogAction.isRestorablenow defaults tofalse.SharedPreferencesFloatingDialogStorage→KeyValueFloatingDialogStorage(readString: prefs.getString, writeString: prefs.setString). The lifetime is now stored as a string, so a previously saved lifetime falls back to the default once.
