Skip to main content

liquid_glass_widgets 1.25.1 copy "liquid_glass_widgets: ^1.25.1" to clipboard
liquid_glass_widgets: ^1.25.1 copied to clipboard

iOS 26/27-style liquid glass widgets for Flutter. Built on a custom fragment shader for real blur, liquid interactions, specular highlights, and chromatic aberration.

Liquid Glass Widgets #

Bring Apple's iOS 27 & iOS 26 Liquid Glass design system to Flutter — with authentic optical refraction, lifted touch lenses, fluid spring morphing, and zero third-party dependencies.

pub package pub points likes CI codecov License: MIT

Quick Start · iOS 27 Comparison · Widget Catalog · Performance · AI Skill · Docs

iOS 27 Liquid Glass showcase — Light Mode lifted controls (segmented control, switch, slider, tab bar), Dark Mode Apple Mail liquid sheet morphs and pinned chrome, and Dark Mode Apple Music tab bar refraction and scroll-to-minimize

Captured on iOS 27.0 Simulator (GlassStyle.ios27) · Left: lifted control lenses · Center: Apple Mail liquid morphs & pinned chrome · Right: Apple Music refraction & scroll-to-minimize.


Why liquid_glass_widgets? #

  • Authentic iOS 27 & iOS 26 Look (GlassStyle.ios27 / ios26) — Calibrated directly against native iOS 27 & iOS 26 SwiftUI/UIKit: realistic glass refraction, frosted depth, soft rim highlights, and lifted magnifying lenses on GlassTabBar, GlassSegmentedControl, GlassSwitch, and GlassSlider.
  • Smooth 120 Hz Performance — Built for ProMotion displays: ~2.0 ms raster on GlassScaffold chrome and 2.5–2.7 ms (0 missed frames, 120 Hz locked) on grouped scrolling glass lists on iPhone 16 Pro, with resting switches, sliders, and segmented controls using 0 active shaders.
  • 60+ Drop-In Cupertino Widgets — Complete navigation, form, list, picker, menu, sheet, and dialog library including GlassScaffold, GlassTabBar (.bottom, .inline, .searchable, .minimizable), GlassAppBar.pinned, GlassModalSheet, GlassMenu, GlassDatePicker, and GlassSurfaceStyle.solid for opaque scrolling cards.
  • Fluid Liquid Morphing — Continuous spring-based teardrop and droplet morphs from any trigger button into GlassMenu, GlassPullDownButton, GlassPopover, showGlassConfirmationDialog, and GlassModalSheet.
  • Cross-Platform & Zero Dependencies — Pure Flutter SDK (flutter: sdk: flutter). Automatically uses full Impeller glass on iOS, Android, and macOS, with lightweight glass and frosted fallbacks on Web, Windows, and Linux.
  • Accessibility, Keyboard & RTL Built In — Respects Reduce Motion, Increase Contrast, and iOS On/Off switch labels, with 44 pt tap targets, VoiceOver/TalkBack semantics, full keyboard navigation, and RTL support out of the box.

Native iOS 27 Comparison #

Interactive controls are iteratively tuned side-by-side against native iOS 27.0 across two visual tiers: GlassQuality.premium (default for floating chrome, overlays, and lifted lenses on Impeller) and GlassQuality.standard (lightweight shader for Web, Desktop, Skia, and dense body surfaces).

Light Mode — Lifted Lenses (Native iOS 27.0 vs. Flutter Premium vs. Flutter Standard)

iOS 27 Light Mode side-by-side comparison — Native iOS 27.0 SwiftUI/UIKit vs Flutter Premium vs Flutter Standard



Dark Mode — Lifted Lenses (Native iOS 27.0 vs. Flutter Premium vs. Flutter Standard)

iOS 27 Dark Mode side-by-side comparison — Native iOS 27.0 SwiftUI/UIKit vs Flutter Premium vs Flutter Standard

Side-by-side iOS 27.0 Simulator captures with all four interactive lenses lifted simultaneously (top bar hosts the harness controls).


Quick Start #

1. Install #

flutter pub add liquid_glass_widgets

Requires Flutter ≥ 3.41.0 (Dart ≥ 3.5.0). Keep cupertino_icons: ^1.0.8 in your pubspec.yaml for Cupertino icons:

dependencies:
  liquid_glass_widgets: ^1.25.1
  cupertino_icons: ^1.0.8

2. Initialize & Wrap #

Preload shaders in main() and wrap your app with LiquidGlassWidgets.wrap():

import 'package:flutter/cupertino.dart';
import 'package:liquid_glass_widgets/liquid_glass_widgets.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await LiquidGlassWidgets.initialize();
  runApp(LiquidGlassWidgets.wrap(child: const MyApp()));
}

3. Build Your First iOS 27 Screen #

Use GlassScaffold for each screen — it handles floating glass bars, backdrop sharing, safe areas, and scroll edges automatically:

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _tab = 0;
  int _range = 0;
  bool _notifications = true;

  @override
  Widget build(BuildContext context) {
    return GlassScaffold(
      appBar: GlassAppBar(title: const Text('Settings')),
      bottomBar: GlassTabBar.bottom(
        selectedIndex: _tab,
        onTabSelected: (i) => setState(() => _tab = i),
        tabs: const [
          GlassTab(icon: Icon(CupertinoIcons.slider_horizontal_3), label: 'Controls'),
          GlassTab(icon: Icon(CupertinoIcons.layers_alt_fill), label: 'Surfaces'),
          GlassTab(icon: Icon(CupertinoIcons.sparkles), label: 'Lenses'),
        ],
      ),
      body: ListView(
        padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
        children: [
          // Keep scrolling cards opaque (GlassSurfaceStyle.solid) — zero shader cost,
          // while interactive controls inside keep their lifted iOS 27 glass lenses.
          GlassGroupedSection(
            surfaceStyle: GlassSurfaceStyle.solid,
            header: const Text('PREFERENCES'),
            children: [
              Padding(
                padding: const EdgeInsets.all(12),
                child: GlassSegmentedControl(
                  segments: const [
                    GlassSegment(label: 'Day'),
                    GlassSegment(label: 'Week'),
                    GlassSegment(label: 'Month'),
                  ],
                  selectedIndex: _range,
                  onSegmentSelected: (i) => setState(() => _range = i),
                ),
              ),
              MergeSemantics(
                child: GlassListTile(
                  title: const Text('Notifications'),
                  trailing: GlassSwitch(
                    value: _notifications,
                    onChanged: (v) => setState(() => _notifications = v),
                  ),
                ),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
Using MaterialApp or Flutter 3.50+ package:cupertino_ui?
  • MaterialApp: Pass brightnessResolver: Theme.maybeBrightnessOf so glass widgets follow your ThemeMode, and wrap MaterialApp.builder in a transparent Material if you don't mount a Material Scaffold:
    runApp(LiquidGlassWidgets.wrap(
      brightnessResolver: Theme.maybeBrightnessOf,
      child: MaterialApp(
        builder: (context, child) =>
            Material(type: MaterialType.transparency, child: child!),
        home: const MyHomePage(),
      ),
    ));
    
  • Flutter 3.50+ package:cupertino_ui: Add Flutter's bridge to CupertinoApp.builder so CupertinoTheme and localizations propagate cleanly:
    builder: (context, child) => CupertinoUiCompatibilityBridge(child: child!),
    

Glass vs. Content — Design Philosophy #

On iOS 26 and iOS 27, glass belongs on floating navigation and controls, while scrolling cards and content rows stay opaque:

Use Glass For Keep Opaque (GlassSurfaceStyle.solid)
Navigation bars (GlassAppBar), tab bars (GlassTabBar), toolbars (GlassToolbar) Inset-grouped list cards (GlassGroupedSection, GlassContainer.card)
Floating buttons (GlassButton, GlassIconButton, GlassPullDownButton) List rows (GlassListTile), feed items, media cells
Overlays (GlassModalSheet, GlassDialog, GlassMenu, GlassPopover) Buttons, toggles & text fields inside solid cards (auto-inherited)
Active lifted lenses (GlassSwitch, GlassSlider, GlassSegmentedControl) Full-screen backgrounds

Tip: Avoid nesting refractive glass buttons inside a glass-mode container (they automatically fall back to vibrancy fills to prevent double-refraction). Pass surfaceStyle: GlassSurfaceStyle.solid to scrolling cards and sections — nested buttons, inputs, and pickers inherit solid automatically while switches, sliders, and segmented controls keep their lifted glass lenses on touch.


Signature Interactions & Navigation #

iOS 27 Dark Mode interactions — lifted smoked-glass control lenses and Apple Messages frosted teardrop GlassMenu popovers

Left: Dark Mode lifted lenses on GlassSegmentedControl, GlassSwitch, GlassSlider, and GlassTabBar · Right: GlassMenu teardrop spring physics in Apple Messages.

Liquid Morph Sheets & Menus #

Wrap any trigger in GlassMorphTrigger and pass its anchor to GlassModalSheet.show(morphFrom:) (or showGlassConfirmationDialog(morphFrom:)) for a continuous droplet morph:

GlassMorphTrigger(
  builder: (context, anchor) => GlassIconButton(
    icon: const Icon(CupertinoIcons.square_pencil),
    onPressed: () => GlassModalSheet.show<void>(
      context: context,
      morphFrom: anchor,
      detents: const {GlassSheetDetent.fitted},
      builder: (context) => const ComposeSheetBody(),
    ),
  ),
)

Guides: docs/LIQUID_MORPH_ENGINE.md · docs/GLASS_MODAL_SHEETS_GUIDE.md

Scroll-to-Minimize Tab Bar (GlassTabBar.minimizable) #

Mirrors SwiftUI's .tabBarMinimizeBehavior(_:), collapsing the tab bar into the active tab circle on scroll (just like Apple Music):

final _scroll = ScrollController();
final _minimize = GlassTabBarMinimizeController(
  behavior: GlassBarMinimizeBehavior.onScrollDown,
);

GlassScaffold(
  body: ListView.builder(controller: _scroll, itemBuilder: ...),
  bottomBar: GlassTabBar.minimizable(
    tabs: _tabs,
    selectedIndex: _index,
    onTabSelected: (i) => setState(() => _index = i),
    minimizeController: _minimize,
    scrollController: _scroll,
    onMinimizedTabTap: _minimize.expand,
  ),
)
  • Pinned Navigation Chrome (GlassNavigationShell + GlassAppBar.pinned): Keeps bars pinned across route pushes with matching item morphs and bezel-clipped transitions. See docs/GLASS_NAVIGATION_TRANSITION.md.
  • Content-Aware Brightness: Enable contentAwareBrightness: true on GlassScaffold and adaptiveBrightness: true on GlassTabBar.bottom to flip bar foregrounds automatically over light and dark scrolling content.

Widget Catalog #

All 60+ widgets and scopes are exported from package:liquid_glass_widgets/liquid_glass_widgets.dart:

Category Exported Widgets & Primitives
Containers & Lists GlassContainer · GlassContainer.card · GlassGroupedSection · GlassListTile · GlassDivider · GlassDisclosureGroup · GlassReorderableList · GlassStepper · GlassSwipeActions · GlassSwipeActionScope
Interactive Controls GlassButton · GlassIconButton · GlassToggle.button · GlassSwitch · GlassSlider · GlassSegmentedControl (.scrollable) · GlassPullDownButton · GlassButtonGroup · GlassBadge · GlassPageControl · GlassEditButton · GlassEditScope
Inputs & Pickers GlassTextField · GlassTextArea · GlassPasswordField · GlassSearchBar · GlassPicker · GlassFormField · GlassDatePicker (.compact / .graphical / .wheel) · GlassMultiDatePicker
Surfaces & Navigation GlassScaffold · GlassPage · GlassPageRoute · GlassPageTransitionsBuilder · GlassAppBar (.pinned) · GlassBarItem · GlassLargeTitle · GlassTabBar (.bottom / .inline / .searchable / .minimizable) · GlassTabBarExtraButton · GlassTabBarTrailingButton · GlassToolbar · GlassNavigationShell · GlassNavigationStack · GlassNavigationLink · GlassPinnedBarChrome · GlassVerticalBar · GlassScrollEdgeEffect
Overlays & Modals GlassModalSheet · GlassModalSheetScaffold · GlassMorphTrigger · GlassDialog · showGlassConfirmationDialog · GlassMenu (GlassMenuItem, GlassMenuDivider, GlassMenuLabel) · GlassPopover · GlassContextMenu · GlassFullScreenCover
Feedback & Effects GlassProgressIndicator · GlassToast · GlassMaterialize · GlassMaterializeTransition · ProgressiveBlur · GlassGlow
Theming & Scopes GlassTheme · GlassBackdropGroup (.hoisted) · AdaptiveGlass · AdaptiveLiquidGlassLayer · LiquidGlassLayer · LiquidGlassBlendGroup · LiquidGlassScope · GlassBackgroundSource · GlassContentAwareScope · GlassIsolationScope · GlassAccessibilityScope · GlassAdaptiveScope · GlassMotionScope · GlassInteractionSilence · IndicatorLensOptics · IndicatorJellyPhysics

Theming & Styles #

All widgets default to GlassStyle.ios27. Switch styles or customize themes app-wide via LiquidGlassWidgets.wrap():

runApp(LiquidGlassWidgets.wrap(
  child: const MyApp(),
  theme: const GlassThemeData.ios27(),     // default — iOS 27 look
  // theme: const GlassThemeData.ios26(),  // iOS 26 look
  // theme: const GlassThemeData.minimal(), // shader-free frosted fallback
));
  • Use LiquidGlassSettings.clear(context) for Apple's clear glass look over rich photos or video.
  • Quality tiers: GlassQuality.premium (default for floating chrome, overlays & active lenses on Impeller), GlassQuality.standard (default for body glass, Web & Desktop), GlassQuality.minimal (shader-free BackdropFilter), and GlassSurfaceStyle.solid (opaque native cards).
  • Override priority: Widget settings: / quality: → local GlassTheme / GlassPage(themeOverride:) → LiquidGlassWidgets.wrap(theme:).
Optional Wallpaper Refraction on Skia and Web (LiquidGlassScope)

On Skia and Web (GlassQuality.standard), indicator lenses can refract a wallpaper image without Impeller's backdrop texture capture. Passing background: to GlassScaffold or GlassPage wires this up automatically; for custom stacks, wrap with LiquidGlassScope and GlassBackgroundSource:

LiquidGlassScope(
  child: Stack(
    children: [
      Positioned.fill(
        child: GlassBackgroundSource(child: Image.asset('assets/wallpaper.jpg')),
      ),
      Center(
        child: GlassSegmentedControl(
          segments: const [GlassSegment(label: 'Day'), GlassSegment(label: 'Week')],
          selectedIndex: 0,
          onSegmentSelected: (_) {},
          quality: GlassQuality.standard,
        ),
      ),
    ],
  ),
)

Performance #

Measured on physical iPhone 16 Pro (120 Hz ProMotion): ~2.0 ms raster on GlassScaffold chrome and 2.5–2.7 ms raster (0 missed frames, 120 Hz locked) on grouped scrolling glass lists (GlassBackdropGroup.hoisted) across Light and Dark modes, with up to 51% lower Light-mode GPU memory on scrolling glass lists.

  • Use GlassScaffold so floating bars automatically share backdrop reads.
  • Use GlassSurfaceStyle.solid for dense scrolling feed cards.
  • Wrap scrolling refractive glass lists in GlassBackdropGroup.hoisted to keep scrolling locked at 120 Hz.
  • Enable adaptiveQuality: true (experimental) on LiquidGlassWidgets.wrap() to step quality down automatically under thermal throttling.

Full iPhone 16 Pro Light + Dark benchmark tables, reproduction commands, and engine architecture: docs/PERFORMANCE.md


Platform Support & Accessibility #

  • Platforms: Full Impeller glass on iOS, Android, and macOS; lightweight glass on Web (CanvasKit/Wasm), Windows, and Linux. Automatically uses Flutter 3.50+ hardware bilinear backdrop sampling when available while remaining compatible with Flutter >=3.41.0.
  • Maps, WebViews & Video (PlatformView): Pass platformViewBackdrop: true on GlassModalSheet, GlassMenu, or GlassPopover, or set platformViewMode: PlatformViewGlassMode.passthrough on floating bars. See docs/PLATFORM_SUPPORT.md.
  • Accessibility, Keyboard & RTL: Honours system Reduce Motion, Increase Contrast / Reduce Transparency, and iOS On/Off switch labels automatically, with ≥ 44 pt touch/semantic targets, VoiceOver/TalkBack roles & heading levels, full keyboard navigation, and RTL layouts.

AI Coding Agent Skill #

Building with Antigravity, Cursor, Claude Code, or GitHub Copilot? Install the official skill so your assistant generates idiomatic liquid_glass_widgets code:

  • Antigravity / Gemini CLI:
    mkdir -p .agents/skills/liquid-glass-widgets
    curl -sSL https://raw.githubusercontent.com/sdegenaar/liquid_glass_widgets/main/skills/liquid-glass-widgets/SKILL.md \
      -o .agents/skills/liquid-glass-widgets/SKILL.md
    
  • Claude Code: Save skills/liquid-glass-widgets/SKILL.md to .claude/skills/liquid-glass-widgets/SKILL.md.
  • Cursor: Copy skills/liquid-glass-widgets/SKILL.md to .cursor/rules/liquid-glass.mdc.
  • Other IDEs: See skills/README.md.

Showcase Apps & Demos #

Explore full iOS 27 reference apps and isolated component demos inside example/:

Showcase App Run Command
Widget Catalog (iOS 27 / iOS 26) cd example && flutter run
Apple Mail (Pinned Chrome & Morphs) cd example && flutter run -t lib/apple_mail/apple_mail_demo.dart
Apple Music (Searchable & Minimizable Bar) cd example && flutter run -t lib/apple_music/apple_music_demo.dart
Apple Podcasts cd example && flutter run -t lib/apple_podcasts/apple_podcasts_demo.dart
Apple Messages (Teardrop Menus) cd example && flutter run -t lib/apple_messages/apple_messages_demo.dart
Apple News cd example && flutter run -t lib/apple_news/apple_news_demo.dart
Apple Lock Screen cd example && flutter run -t lib/apple_lockscreen/keypad_lock_screen_demo.dart
Wanderlust (Travel Showcase) cd example/showcase && flutter pub get && flutter run
15 Focused Component Demos (example/lib/demos/)
Demo Run Command (from example/)
indicator_parity_demo.dart — all 4 lifted lens controls side-by-side flutter run -t lib/demos/indicator_parity_demo.dart
glass_modal_sheet_demo.dart — peek / half / full / fitted + droplet morph flutter run -t lib/demos/glass_modal_sheet_demo.dart
glass_menu_demo.dart — all 9 teardrop menu alignments flutter run -t lib/demos/glass_menu_demo.dart
minimizable_bar_demo.dart — scroll-to-minimize & bottomAccessory flutter run -t lib/demos/minimizable_bar_demo.dart
searchable_bar_demo.dart — morphing searchable bottom bar flutter run -t lib/demos/searchable_bar_demo.dart
tab_bar_menu_demo.dart — native pull-down menus on tab bars flutter run -t lib/demos/tab_bar_menu_demo.dart
glass_tab_bar_bottom_demo.dart — lifted tab bar lens masking flutter run -t lib/demos/glass_tab_bar_bottom_demo.dart
glass_tab_bar_scrollable_demo.dart — scrollable inline tab bar flutter run -t lib/demos/glass_tab_bar_scrollable_demo.dart
bottom_bar_tab_width_demo.dart — tabWidth layout patterns flutter run -t lib/demos/bottom_bar_tab_width_demo.dart
nav_bar_patterns_demo.dart — GlassAppBar.pinned & nested nav morphs flutter run -t lib/demos/nav_bar_patterns_demo.dart
content_aware_brightness_demo.dart — light/dark bar adaptation flutter run -t lib/demos/content_aware_brightness_demo.dart
color_fidelity_demo.dart — LiquidGlassSettings.clear vs regular glass flutter run -t lib/demos/color_fidelity_demo.dart
quality_comparison_demo.dart — Premium vs Standard vs Minimal flutter run -t lib/demos/quality_comparison_demo.dart
lists_pickers_and_nav_demo.dart — swipe actions, reorder, pickers, nav stack flutter run -t lib/demos/lists_pickers_and_nav_demo.dart
shape_debug_demo.dart — superellipse & custom GlassButton shapes flutter run -t lib/demos/shape_debug_demo.dart

Documentation #

Guide What It Covers
Performance & Benchmarks iPhone 16 Pro Light/Dark benchmarks, 120 Hz tuning & GPU architecture
Architecture & Engineering Design 5-layer architecture, GPU shaders, and provenance standards
iOS 26 & 27 Optics Spec CoreAnimation glassFace optical laws, GPU invariants & calibration briefs
Platform Support Matrix Renderer tiers, PlatformViews, and cross-platform shader compatibility
Liquid Morph Engine Spring physics & custom teardrop/droplet morph integration
Modal Sheets Guide Full GlassModalSheet API, fitted detents, solid style & scroll sync
Navigation & Pinned Chrome GlassNavigationShell, GlassAppBar.pinned, bezel clips & iPhone Duo bars
Adaptive Quality Calibration GlassAdaptiveScope benchmarks, cold-start persistence & diagnostics
Progressive Blur & Popover Blur Ramp Variable blur overlays and popover ramp optics
Roadmap Planned milestones and 2.0.0 roadmap
Migration Guide (0.x → 1.0) Breaking changes and upgrade path from 0.x
AI Agent Skill & Contributor Guide Consumer AI skill & repository contribution/shader guidelines

Credits & License #

Zero third-party pubspec.yaml dependencies. Built exclusively on the Flutter SDK (flutter: sdk: flutter).

Special thanks to Tim Lehmann (whynotmake.it) and the whynotmake-it team:

See THIRD_PARTY_NOTICES and lib/src/engine/ATTRIBUTION.md for complete notices. Contributions are welcome — see AGENTS.md. Licensed under MIT (LICENSE).

397
likes
160
points
176k
downloads
screenshot

Documentation

API reference

Publisher

verified publisherpixel-innovations.com

Weekly Downloads

iOS 26/27-style liquid glass widgets for Flutter. Built on a custom fragment shader for real blur, liquid interactions, specular highlights, and chromatic aberration.

Repository (GitHub)
View/report issues

Topics

#liquid-glass #widget #glassmorphism #flutter #apple

License

MIT (license)

Dependencies

flutter

More

Packages that depend on liquid_glass_widgets

Packages that implement liquid_glass_widgets