native_liquid_glass 0.2.0
native_liquid_glass: ^0.2.0 copied to clipboard
Liquid Glass iOS platform views for Flutter using native UIKit components.
Changelog #
0.2.0 #
SVG Path Utility #
- Add
SvgPathExtensiononStringfor converting SVG path data into FlutterPathorLiquidGlassConfig.customPathops. toPath()/toPathScaled({viewBox, target})— parse SVG path data into a FlutterPath, with optional scaling.toLiquidGlassPath()— parse directly intoList<LiquidGlassPathOp>forLiquidGlassConfig.customPath.toLiquidGlassPathScaled({viewBox, target})— handles non-zero-origin viewBoxes (e.g."1 0 24 226") by translating then scaling every coordinate.- Accepts paths with leading whitespace, newlines, comments, or stray characters (everything before the first
M/mis stripped). - Quadratic Béziers are normalized to cubic Béziers to match the native iOS path rendering.
- Add
path_parsing: ^1.1.0as a direct dependency.
LiquidGlassContainer #
- Wrap SwiftUI glass content in
GlassEffectContainersoGlass.clearrenders with its proper translucent appearance in light mode instead of falling back to a frosted white panel, and soglassEffectUnionId/glassEffectIdmodifiers work as documented. - Press feedback on
interactive: truenow scales up to 1.04 (was: down to 0.96) so it visually mirrors the "spring out" aesthetic of Apple's nativeGlass.interactive()used byLiquidGlassButtonandLiquidGlassToolbar. The container can't use native.interactive()directly (itsUiKitViewisIgnorePointer-wrapped so Flutter child widgets inside can still receive taps), so this keeps the press-response visually consistent across the plugin. SameLiquidGlassSpring.interactive()preset as before.
LiquidGlassButton #
LiquidGlassButton.iconnow wraps its content whensizeis not provided, matching Flutter button semantics. The default forsizechanged from50tonull; when null, the button is sized fromiconSizeplus a minimum 44pt touch target, then refined to the native intrinsic size reported by the platform view. Breaking for callers that relied on the implicitsize: 50default — passsize: 50explicitly to preserve the old behavior.- The native
getIntrinsicSizeround-trip now runs for icon-only buttons too (previously only text buttons requested it), so icon buttons with nullsizesettle to the exact size Apple's Liquid Glass rendering prefers.
LiquidGlassTabBar #
- Fix: per-tab
selectedItemColor(fromLiquidGlassTabItem.selectedItemColor) no longer reverts to the globalselectedItemColorafter a Flutter navigation push/pop. The tab bar'sUITabBarAppearance.selectedcolors are now kept in sync with the currently-applied per-tab tint, and the tint is re-applied when the view re-attaches to a window.
LiquidGlassToolbar #
- On iOS 26+ the toolbar is now rendered as a SwiftUI
HStackwith.glassEffect(.regular, in: Capsule())(hosted viaUIHostingController).heightnow actually resizes the visible Liquid Glass bar — previously the underlyingUIToolbarlocked its glass rendering to the system-intrinsic 44pt and any extra height became transparent padding. - Each run of items between flexible
LiquidGlassToolbarSpacers is now rendered as its own independent glass capsule, matching the iOS 26 split-toolbar pattern (multiple floating pill bars side-by-side). Fixed spacers stay inside their group as internal gaps. - Press feedback now uses Apple's native
Glass.regular.interactive()on each capsule — the same mechanismLiquidGlassButtonuses. iOS 26's system handles the spring-out + tint response internally, so behavior (timing, scale, damping) is identical acrossLiquidGlassButton,LiquidGlassButtonGroup, andLiquidGlassToolbar. Sibling capsules in a split toolbar are unaffected when one is pressed. - Fix:
LiquidGlassToolbarItem.tintColornow actually colors the item's icon/text. Previously.tint(...)was applied to the item'sButton, but our customButtonStyleonly re-emitsconfiguration.label, so the tint never reached theImage/Text. Tint is now applied directly via.foregroundStyle(color)on the visible element. - Breaking: removed
LiquidGlassToolbarItem.styleand theLiquidGlassToolbarItemStyleenum. Text items now render withLiquidGlassToolbar.labelTextStyle's weight (or.regularif none supplied) — there's no longer a.donebold variant. If you need bold text for a specific item, pass alabelTextStyleon the whole toolbar. - The widget now reserves vertical overflow padding so the capsule's drop shadow and spring scale-down are not clipped. The visible bar still honors the supplied
height; only the outer widget footprint grows to accommodate the overflow. - Item spacing tightened to match UIToolbar's visual rhythm (minimum 44pt hit targets with 4pt inter-item padding instead of the previous 12pt HStack gap).
- Add optional
widthparameter. When null (default), the toolbar wraps its content — width is estimated from item sizes (TextPainterfor labels,iconSizefor icons, fixed spacer widths, plus glass overflow padding). Passdouble.infinityor wrap inExpandedfor full-parent-width behavior. Flexible spacers only expand when an explicit ordouble.infinitywidth is provided; in wrap-content mode they collapse to 0. - On iOS 15–25 the existing
UIToolbarpath is kept as a fallback (still constrained to 44pt, which matches the non-Liquid-Glass system behavior).
0.1.0 #
Spring Animation System #
- Add
LiquidGlassSpringwith four presets:bouncy,snappy,smooth,interactive. - Add
SingleSpringControllerandOffsetSpringControllerfor imperative spring-driven values. - Add
SpringBuilder,VelocitySpringBuilder, andOffsetSpringBuilderdeclarative widgets. - All builders respect
MediaQuery.disableAnimationsOffor accessibility (reduce motion).
Custom Shape Support for LiquidGlassContainer #
- Add
LiquidGlassEffectShape.customfor arbitrary glass container shapes. - Add
LiquidGlassPathOpsealed class (moveTo,lineTo,cubicTo,quadTo,close) for defining custom paths. - Add
customPathandcustomPathSizetoLiquidGlassConfig— coordinates are in your SVG/design space, the native side scales automatically. - Native
CustomPathShape(SwiftUIShape) renders the custom path on iOS 26+.
Animated Config Transitions #
- Add
animateChangesproperty toLiquidGlassContainer. - When enabled, shape/effect/tint/cornerRadius changes animate with a native SwiftUI spring transition.
- Refactored native side from view recreation to
ObservableObjectViewModel — the SwiftUI view stays alive across config updates. - Built-in shape transitions (rect/capsule/circle) use
Animatablecorner radius interpolation. - Custom shape transitions use
AnimatableCustomPathShapewith control point morphing viaVectorArithmetic. - Built-in to/from custom transitions use opacity crossfade.
Interactive Container #
LiquidGlassContainernow shows a spring press animation (scale down/bounce back) whenconfig.interactiveis true, matchingLiquidGlassButtonbehavior.- Add
onTapcallback toLiquidGlassContainer— uses Flutter's gesture system so child widgets receive touches normally. - Native
UiKitViewis wrapped inIgnorePointer; all gesture handling is Flutter-side.
Container Sizing #
LiquidGlassContainernow wraps its child size whenwidth/heightare omitted, matching FlutterContainerbehavior.- Native glass view uses
Positioned.fillto match the child-determined size.
0.0.3 #
- Add Swift Package Manager (SPM) support for iOS.
0.0.2 #
- Switch iOS tab bar implementation from custom SwiftUI rendering to system
UITabBarController. - Rely on iOS system Liquid Glass appearance on iOS 26+ instead of custom
.glassEffect()drawing. - Remove unsupported action-button and custom-shape parameters from
LiquidGlassTabBarAPI. - Add supported native customization: selected color and item positioning/spacing/width.
- Remove
backgroundColorandshadowColor; tab bar background and shadow visuals are now system-driven. - Remove
unselectedItemColorparameter so unselected item appearance is system-driven by iOS Liquid Glass behavior. - Add iOS tab badge support per item (
iosBadgeValue). - Remove
iosBadgeColorandiosBadgeTextColor; badge styling is now system-driven. - Add three icon source options for
LiquidGlassTabItem:sfSymbolName,iconData, andassetIconPath(plus selected variants). - Rename icon parameters to meaningful source-based names while keeping deprecated aliases (
icon,activeIcon,iosSystemImage,iosActiveSystemImage). - Add reusable static synchronous utility
NativeLiquidGlassUtils.isDeviceQualifiedForLiquidGlassWidget()for iOS 26+ qualification checks before rendering native widgets (noawaitrequired). - Add native customization for tab icon size via
LiquidGlassTabBar.iconSize. - Add per-item icon size override via
LiquidGlassTabItem.iconSize. - Add native label typography customization via
LiquidGlassTabBar.labelTextStyle(font size/weight/family/letter spacing). - Add per-item selected color override via
LiquidGlassTabItem.selectedItemColor. - Add SVG decoding support for
assetIconPathandselectedAssetIconPathon iOS. - Add optional iOS action button support via
iosActionButtonandonActionButtonPressed. - Remove iOS search feature and related callbacks (
iosShowSearchButton,onSearchButtonPressed,onSearchQueryChanged,onSearchSubmitted,onSearchDismissed). - Add
LiquidGlassButtonwith iOS native platform-view rendering and Flutter fallback. - Add
LiquidGlassIconButtonwith iOS native platform-view rendering and Flutter fallback. - Add three icon source options for buttons (
sfSymbolName,iconData,assetIconPath) with iOS native source-priority resolution. - Add native button visual parameters:
iconColor,foregroundColor,glassTintColor,imagePadding, andglassInteractive. - Use default UIKit button configuration APIs for button rendering; on iOS/iPadOS 26+ use
UIButton.Configuration.prominentGlass()with interactiveUIGlassEffect. - Performance:
LiquidGlassButtonGroupicon payload resolution is now gated by an icon signature — payloads are not re-resolved unless icons actually change between widget rebuilds. - Performance:
LiquidGlassButtonGroupresolves icon payloads for all buttons concurrently withFuture.waitinstead of sequentially. - Performance:
LiquidGlassButtonskipsTextPainterlayout cost duringbuildwhen both explicitwidthandheightare provided. - Fix:
LiquidGlassNavigationBarnow correctly syncs changes toleadingItems,trailingItems, andtitleTextStyleto the native bar after initial creation; a matchingsetItemschannel method was added on the Swift side.
0.0.1 #
- Convert package template to Flutter iOS plugin scaffolding.
- Add native Liquid Glass-style tab bar behavior for iOS.
- Add runtime fallback rendering for non-iOS platforms.
- Expose
LiquidGlassTabBarFlutter widget API. - Add interactive example app showcasing the tab bar.
- Remove standalone
LiquidGlassViewitem from the package API.