Skip to main content

liquid_morph_ui 1.0.1 copy "liquid_morph_ui: ^1.0.1" to clipboard
liquid_morph_ui: ^1.0.1 copied to clipboard

A high-performance Flutter UI kit for Glassmorphism and behavior-driven Liquid Glass bottom navigation bars.

๐Ÿ”ฎ Liquid Morph UI - Flutter Glassmorphism & Liquid Glass Kit #

Flutter Dart License Platform

A modern, high-performance Flutter showcase and reusable library demonstrating two cutting-edge glass UI paradigms: Classic Glassmorphism and Behavior-Driven Liquid Glass, engineered with enterprise-grade Clean Architecture and OOP Design Patterns.


๐ŸŒŸ Interface Design Paradigms #

1. โ„๏ธ Classic Glassmorphism UI #

  • Static Depth & Frosted Blur: Fixed backdrop blur (sigma 15), translucent container fill (12% opacity), and subtle specular borders.
  • Floating Glass AppBar: Custom floating frosted glass app bar with back navigation.
  • Smooth Tab Selection: Linear position interpolation and tab switching.

2. ๐Ÿ’ง Dynamic Liquid Glass UI #

  • Behavior-Driven Material: Dynamically refracts light and responds to user drag coordinates and velocity in real time.
  • 120 FPS GPU Canvas Painter: Renders light sheen, cyan liquid glow (0x4038BDF8), and radial specular highlights directly on Canvas with zero-rebuild backdrop filtering.
  • Viscous Shape Deformation: Capsule indicator deforms (stretches up to 20% horizontally and compresses vertically) during fast movements, simulating fluid surface tension.
  • Spring Physics: Bouncing spring response (Cubic(0.25, 1.15, 0.3, 1.0)) on tab arrival.
  • Hardware-Accelerated Page Transitions: Integrated PageView for native GPU compositor layer sliding.

๐Ÿงฉ Reusable Library, AppBars & Extensions (glass_ui_kit.dart) #

Developers can easily customize and use standalone Glass AppBars, Glass Containers, or Widget Extensions:

1. Standalone Customizable GlassAppBar #

Pass title, leftButtons, rightButtons, backgroundColor, and blur effortlessly:

import 'package:liquid_morph_ui/glass_ui_kit.dart';

// Classic Glassmorphism AppBar
GlassAppBar(
  title: 'Dashboard',
  leftButtons: [
    IconButton(icon: const Icon(Icons.menu, color: Colors.white), onPressed: () {}),
  ],
  rightButtons: [
    IconButton(icon: const Icon(Icons.search, color: Colors.white), onPressed: () {}),
    IconButton(icon: const Icon(Icons.notifications, color: Colors.white), onPressed: () {}),
  ],
);

// Liquid Glass Styled AppBar
GlassAppBar.liquid(
  title: 'Fluid Dashboard',
  rightButtons: [
    IconButton(icon: const Icon(Icons.settings, color: Colors.white), onPressed: () {}),
  ],
);

2. Extension Methods on Widget #

import 'package:liquid_morph_ui/glass_ui_kit.dart';

// Turn ANY widget into Frosted Glass in 1 line
const Text('Frosted Card').asGlass(blur: 15.0);

// Turn ANY widget into Liquid Glass in 1 line
const Text('Liquid Card').asLiquidGlass(glowColor: Color(0x3038BDF8));

3. Reusable Glass Container Wrappers #

import 'package:liquid_morph_ui/glass_ui_kit.dart';

// Reusable Glassmorphism Container
GlassContainer(
  blur: 15.0,
  borderRadius: BorderRadius.circular(20.0),
  child: MyWidget(),
);

// Reusable Liquid Glass Container
LiquidGlassContainer(
  blur: 18.0,
  glowColor: const Color(0x3038BDF8),
  child: MyWidget(),
);

4. Customizable Full Navigation Views #

Customize title text, actions, and left buttons directly from LiquidGlassUI or GlassmorphismUI:

import 'package:liquid_morph_ui/glass_ui_kit.dart';

LiquidGlassUI(
  title: 'My Custom App',
  actions: [
    IconButton(
      icon: const Icon(Icons.settings, color: Colors.white),
      onPressed: () {},
    ),
  ],
  pages: myPages,
  items: myItems,
)

๐Ÿ—๏ธ Senior Developer Architecture & OOP Design Patterns #

This codebase is structured around production-grade Clean Architecture and classic Gof Design Patterns:

  1. Clean Architecture (Controller / BLoC vs Presentation):
    • Business logic, touch gestures, and physics state are encapsulated in GlassNavigationController, leaving UI widgets as pure presentation layers.
  2. Immutable Value State (GlassNavigationState):
    • Encapsulates active tab indices, drag coordinates, animation progress, and interaction flags into an immutable value object featuring copyWith(), value equality (==), and hashCode.
  3. Command Pattern (GlassNavigationCommand):
    • Encapsulates user interactions as executable commands: SelectTabCommand, DragUpdateCommand, and DragEndCommand.
  4. Observer Pattern & Scoped Dependency Injection (GlassScope):
    • Uses an InheritedNotifier scope providing scoped dependency injection of the state controller down the widget tree with reactive frame notifications.
  5. Strategy Pattern (GlassNavigationEngine):
    • Abstract engine strategy interface allowing dynamic swapping of tab physics and rendering strategies.
  6. Optimized LOC & Beginner-Friendly Comments:
    • Reduced overall lines of code by 40โ€“60% while adding clear, educational inline comments explaining every widget, state variable, and calculation.

โšก Performance Highlights #

  • RepaintBoundary Isolation: The computationally heavy BackdropFilter layer is cached and isolated from rebuilds during animations.
  • Jump-Free Gesture Continuity: Drag release captures current frame position (_startCenterX) so the capsule smoothly interpolates to the target tab without teleporting or snapping back.
  • static const Optimization: All layout dimensions, colors, edge insets, text styles, and border decorations are compile-time constants.
  • Swift Package Manager (SPM): Native iOS dependency management configured via Swift Package Manager.

๐Ÿ“ Project Architecture #

lib/
โ”œโ”€โ”€ glass_ui_kit.dart                  # Single Package Export Module for Developers
โ”œโ”€โ”€ main.dart                          # Application Entry Point (main())
โ”œโ”€โ”€ app.dart                           # Root MaterialApp Configuration (MyApp)
โ”œโ”€โ”€ main_home_screen.dart              # Showcase Home Screen & Reusable Navigation Glass Card
โ”œโ”€โ”€ glass_morphism_ui.dart             # Glassmorphism UI Component & Floating AppBar
โ”œโ”€โ”€ liquid_glass_ui.dart              # Liquid Glass UI Component & GPU Canvas Painter
โ”œโ”€โ”€ src/                               # Reusable Glass Library Modules
โ”‚   โ”œโ”€โ”€ glass_app_bar.dart             # GlassAppBar & GlassAppBar.liquid Standalone Widgets
โ”‚   โ”œโ”€โ”€ glass_container.dart           # GlassContainer & LiquidGlassContainer Widgets
โ”‚   โ”œโ”€โ”€ glass_ui_style.dart            # GlassUIStyle Enum
โ”‚   โ””โ”€โ”€ glass_widget_extension.dart    # Widget.asGlass() & Widget.asLiquidGlass() Extensions
โ””โ”€โ”€ core/                              # Core Architecture & OOP Modules
    โ”œโ”€โ”€ glass_navigation_controller.dart # Reactive Controller, Immutable State & Commands
    โ”œโ”€โ”€ glass_scope.dart                 # Scoped InheritedWidget Dependency Injection
    โ””โ”€โ”€ glass_ui_contracts.dart          # Abstractions, Interfaces & Strategy Engines

test/                                  # Unit & Widget Test Suite
โ”œโ”€โ”€ main_screen_test.dart              # Main HomeScreen Navigation Tests
โ”œโ”€โ”€ glass_morphism_ui_test.dart        # GlassmorphismUI Widget Tests
โ”œโ”€โ”€ liquid_glass_ui_test.dart          # LiquidGlassUI Widget Tests
โ”œโ”€โ”€ glass_ui_kit_test.dart             # GlassUIKit Extension, Container & AppBar Tests
โ”œโ”€โ”€ unit_and_painter_test.dart         # Data Model & CustomPainter Unit Tests
โ””โ”€โ”€ widget_test.dart                   # Master Unit/Widget Test Suite Runner

integration_test/                      # End-to-End Integration Test Suite
โ”œโ”€โ”€ app_test.dart                      # Complete User Journey & Navigation Tests
โ”œโ”€โ”€ gesture_and_stress_test.dart        # Advanced Gesture, Clamping & Viewport Adaptation
โ””โ”€โ”€ all_tests.dart                     # Master Integration Test Suite Entry Point

๐Ÿ’ป Getting Started #

Prerequisites #

  • Flutter SDK >=3.0.0 <4.0.0
  • Dart SDK >=3.0.0 <4.0.0

Installation #

flutter pub add liquid_morph_ui

Or add to pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  liquid_morph_ui: ^1.0.0

๐Ÿงช Running Tests #

1. Run All Unit & Widget Tests #

flutter test
# or
fvm flutter test

2. Run All Integration Tests #

Ensure an emulator or connected device is available (flutter devices):

# Run Master Integration Test Suite
flutter test integration_test/all_tests.dart -d <device_id>

# Run Specific E2E Suite
flutter test integration_test/app_test.dart -d <device_id>

๐Ÿ“œ License #

This project is open source and available under the MIT License.

1
likes
0
points
369
downloads

Publisher

unverified uploader

Weekly Downloads

A high-performance Flutter UI kit for Glassmorphism and behavior-driven Liquid Glass bottom navigation bars.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

cupertino_icons, flutter, gap

More

Packages that depend on liquid_morph_ui