shad 1.0.2
shad: ^1.0.2 copied to clipboard
A high-fidelity Flutter port of shadcn/ui: 40+ components, all eight shadcn styles and 16 color schemes, with no Material or Cupertino dependency.
1.0.2 #
Fixes #
- Only one submenu is open at a time. 1.0.0 added a 100ms grace
period (
showDelay) before a menu item with a submenu un-highlights and closes its submenu, and every pointer move restarted it, so items stayed highlighted and several submenus stayed open while the pointer moved. Now, when the pointer reaches another row of the same menu, the previous row un-highlights and its submenu (with any nested submenu) closes at once, without a fade-out. The grace period applies only when the pointer leaves the rows, for example to cross to the submenu, and it starts once. Submenus close without a fade-out by default; root menus still fade.ShadContextMenuTheme.popoverReverseDurationnow takes effect.
1.0.1 #
Breaking changes #
1.0.0 was available for less than an hour. This release fixes an API that would otherwise have stayed until 2.0.
- The core library no longer depends on Material or Cupertino. Flutter
is moving them out of the SDK into the
material_uiandcupertino_uipackages.package:shad/shad.dartnow imports only the widgets layer, so it is unaffected by that move. Interop is opt-in:ShadApp.themeModetakes the newShadThemeMode(system,light,dark). shad no longer re-exports Material'sThemeMode, so an app that imports bothshadandmaterial_uidoes not get an ambiguous import.ShadAppno longer installs a Material theme or the Material and Cupertino localizations. To use Material or Cupertino widgets, importpackage:shad/material.dartand wrap them in the newShadMaterial, usually throughShadApp(builder: (context, child) => ShadMaterial(child: child!)). It installs the derived Material theme, a transparentMaterialand the missing localizations.shadMaterialThemeFrommoves topackage:shad/material.dart.ShadApp.materialThemeBuildermoves toShadMaterial.themeBuilder. The never-calledShadApp.cupertinoThemeBuilderis removed.ShadThemeScope.applyMaterialThemeis removed. Put aShadMaterialinside the scope.ShadAppbuilds pages with the newShadPageRoute, a short fade, instead ofMaterialPageRoute. PasspageRouteBuilderto keep Material or Cupertino transitions.ShadScrollBehaviordraws aShadScrollbaron desktop and iOS instead of Material'sScrollbarandCupertinoScrollbar.
ShadApp and ShadThemeScope still set the icon theme (16, foreground)
and the text selection colours from the shad theme, which the Material
theme used to do. See MIGRATION.md.
Fixes #
- Tapping a tooltip's trigger works again. 1.0.0 put a non-opaque
MouseRegionaround the trigger so that tooltips show on disabled buttons. A non-opaqueMouseRegionalways reports a miss from its hit test, so aGestureDetectoraround aShadTooltipnever received taps on the trigger, and taps reached widgets behind it. The region now defers to its child. Tooltips on disabled buttons still show. - An expanding
ShadButtonaccepts aFlexibleorExpandedchild. Withexpands: truethe button wrapped its child inExpanded, so aFlexible(child: Text(..., overflow: TextOverflow.ellipsis))child threw "Incorrect use of ParentDataWidget". A child that is already flexible is now used as it is.
1.0.0 #
The first stable release. From here on shad follows semantic versioning:
breaking changes only in a major version, with the old API deprecated first
and migrated by dart fix. See MIGRATION.md.
Breaking changes #
- Fonts are no longer bundled. Inter, Geist and Geist Mono (about
1.2 MB) shipped in every app, and the web downloaded them at startup. Text
now uses the platform font until you choose one with
ShadTextTheme(family:)orShadTextTheme.fromGoogleFont. The README's "Fonts" section shows both.ShadInputOTPuses tabular figures instead of a monospace face. - Deprecations announced for 1.0 are removed: the old unprefixed
typedef names,
valueTransformer,ShadForm.onPopInvoked,ShadTextSelectionToolbar,ShadToolbarButtonandisSameDayOrGreatier.dart fix --applymigrates the renames. - slang is no longer re-exported. Its
AppLocaleUtilscollided with the one slang generates in an app. - About 30 internal classes, extensions and helpers are no longer exported. MIGRATION.md lists them.
ShadAvatardropsuniversal_image, and with itextended_image,path_providerand the discontinuedjspackage. It has two constructors:ShadAvatar(src)takes a URL or asset path (String?), andShadAvatar.image(image)takes anyImageProvider.IconDataand SVG strings are no longer accepted as a source; put an icon infallback.lucide_icons_fluttermoves to 4.x.flutter_svgandvector_graphicsare removed. shad did not use them.ShadContextMenuControlleris now a class (addingshowAt).controller:parameters accept anyShadPopoverController.
Fixes #
ShadThemeData.copyWithderives the component themes again, so a copy with a new radius, color scheme, text theme, style or spacing restyles every component. It now also acceptsstyle,spacingand the menu options.- Theme equality compares list fields (shadows, effects, snap sizes) by
value. A theme built with a non-const list no longer restarts
ShadAnimatedTheme's transition on every rebuild. ShadThemeDatatakes its brightness from the color scheme when none is given.- A closed tooltip, popover or select no longer swallows Escape, so the dialog around it closes.
- Each context menu has its own tap region: tapping another menu's trigger closes the open menu.
ShadButtonno longer notifies a shared states controller during build ("setState() called during build").- Open dialogs and sheets follow app theme changes, such as a light/dark switch, instead of keeping the theme they opened with.
- Dialogs:
- The close button has an accessible label, respects
PopScope, and takes anonClose. - Dialog and sheet barriers have a localized "Dismiss" label in all 82 locales.
- Long action labels on small screens are shortened with an ellipsis instead of overflowing.
- The close button has an accessible label, respects
- A tooltip on a disabled button shows on hover.
- Parameters that were accepted but did nothing now work:
ShadSlider.label,ShadCollapsible.curve/reverseCurve,ShadTab.selectedDecoration,ShadCalendar.weekNumbersTextAlign,ShadForm.skipDisabled,ShadContextMenuItem.showDelay,ShadContextMenuTheme.itemConstraints,ShadToastTheme.displayDurationandShadTheme.merge(key:). Those that cannot work are deprecated. ShadTabsController.selectedand theShadTimePickerControllerfields notify listeners when set.ShadInputFormField,ShadTextareaFormFieldandShadRadioGroupFormFieldfollow a swapped controller; the listener used to stay on the old one.ShadTimePickerFormFielddisposes its internal controller.ShadInputDecoratorno longer throws on a label whenfallbackToLabelStyleis off and no label style is set.ShadBuilderTextStyle.copyWith(Google fonts) keeps the weight or style it does not change, so an italic stays italic when its weight changes.ShadBreadcrumbTheme.ellipsisis used byShadBreadcrumbEllipsis.ShadDatePickerTheme.sizesThemenever had an effect and is deprecated.ShadRadioGroupmoves its listener to a swapped controller.ShadRestorableTabsControllerrestores the selected tab, not always the first.ShadSelectnotifies its controller wheninitialValue(s)change.ShadPosition.lerpinterpolates, so animated position changes no longer jump.ShadBreakpoints.lerpaccepts null ends.- Month steps in the calendar clamp the day (Jan 31 + 1 month is Feb 28, not Mar 3).
ShadProgressfills from the start edge in right-to-left layouts.ShadApp.customacceptsmaterialThemeBuilder.ShadMouseArea.cursornever had an effect and is deprecated.
Menus #
- Anchors take a chain of fallbacks, and the portal picks the one that overflows the screen least. Submenus flip to the other side of their parent instead of sliding over it.
- Menus are capped to the screen height and scroll.
- Keyboard: Home and End, type-ahead (repeating a letter cycles), and arrow keys straight after a pointer open.
ShadContextMenuController.showAt(offset)opens a menu at a point, with its corner there (ShadGlobalAnchor.followerAnchor), mirrored to stay on screen.ShadContextMenu.itemsBuilderbuilds the items only while the menu is open.ShadMenubar.stripShadows(and its theme field) controls the strip's own shadow.
New #
ShadScrollAreaandShadScrollbar, withShadScrollAreaTheme.ShadDropdownMenu.ShadSurfacepaints popover and menu chrome around any widget.showShadPopoveropens a popover anchored to a rectangle.ShadTabswhose tabs have no content renders only the tab list, a standalone segmented control.ShadAccordionItem.trailingfor a header action.- Style tokens
toggleIconSizeandbadgeIconSize. Toggles and badges pass their icon size down.
Renamed (old names deprecated, migrated by dart fix) #
Shadows→ShadShadowsGoogleFontBuilder→ShadFontBuilderGoogleFontTextStyle→ShadBuilderTextStyleShadFormBuilderField→ShadFormField, and theShadFormBuilder*Stateclasses →Shad*FormFieldStateShadToggleVariant.default_→primaryselectedDayButtonOusideMonthVariant→selectedDayButtonOutsideMonthVariantShadToast.duration→displayDurationvisibleToastsAmount→maxVisibleToastsShadAvatar.placeholder→fallbackonLineCountChange→onLineCountChanged- the paste-files functions →
ShadClipboard - the
kDefault*constants → statics on their widgets
Package #
- The published archive no longer carries test failure images or internal files.
- The pubspec has a corrected description, URLs, screenshot and dependency constraints.
- New
SECURITY.md,MIGRATION.md,example/example.mdandlib/fix_data.yaml(withtest_fixes/). - CI publishes on a version tag, and checks formatting, the publish dry run, the data-driven fixes and the minimum Flutter version.
- Every golden test now compares. 52 of 58 never did, because their matcher was not awaited.
0.99.4 #
- Fixes the whole app freezing — no repaints, no input, no response to a window
resize — when the pointer left and re-entered a
ShadSelect's scroll chevron within a fifth of a second. Two auto-scroll loops then ran against the same scroll controller and cancelled each other forever without yielding to the event loop. Only one loop can run now, and it always yields.ShadSelectState.animateToTop/animateToBottomand theshouldAnimateToTop/shouldAnimateToBottomflags are replaced bystartAutoScroll/stopAutoScroll. - Fixes
ShadSonnerleaking anAnimationController, and leaving a timer running, for every toast queued behindvisibleToastsAmountand later shown. - Fixes
ShadInputOTPnever dropping slots or groups that unmount, which grew its registry pastmaxLengthand could then write out of range. - Fixes an auto-anchored
ShadPortalqueueing an unbounded number of reposition callbacks while its overlay had no size yet. - Fixes right-clicking a
ShadContextMenuRegionon the web crashing any enclosingSelectionAreawithSelectableRegion'sassert(_selectable == null). The region toggled the globalBrowserContextMenuaround every click, andSelectionAreachanges its tree shape on that flag; it now cancels the browser's own menu per event with a DOM-levelpreventDefaultand leaves the global alone.
0.99.3 #
- Fixes the tooltip arrow pointing at nothing when the bubble is near a window edge. The bubble slides inward to stay on screen; the arrow now slides back with it and keeps pointing at the trigger, stopping short of the bubble's rounded corners.
0.99.2 #
- Fixes outer shadows being clipped to the wrong shape. Dialogs, sheets, cards,
popovers, toasts, menus, the sidebar and every decorated control lost the
shadow immediately around them and picked it up again a few pixels out with a
hard edge. Shadows now paint the way CSS paints
box-shadow: blurred, and clipped to outside the element itself.
0.99.1 #
- Fixes heights of components to comply with original Shadcn.
0.99.0 #
- First release under the
shadname, continuing flutter-shadcn-ui 0.57.
