d_zero_ui 0.1.3
d_zero_ui: ^0.1.3 copied to clipboard
Zero-allocation GPU glyph-atlas terminal and high-frequency UI controls (sliders, gauges, progress, marquee, joystick, knob) for Flutter.
⚡️ d_zero_ui #
Zero-allocation, zero-rebuild high-frequency UI controls (cards, badges, buttons, switches, sliders, gauges, progress bars, marquee, typewriter, joystick, rotary knob) for Flutter and Impeller.
📦 Distributed Z Widgets (14 Widgets + 9 Active Aliases) #
| Widget | Active Z Alias |
Key Zero-Allocation Mechanism |
|---|---|---|
ZTerminal |
ZLogStream |
Single-pass GPU glyph atlas (Canvas.drawRawAtlas) monospace terminal / log viewer backed by a circular Uint16List ring buffer (0 String / TextPainter allocations per frame). |
ZCard |
ZSurfaceCard |
Single-RenderBox surface container with pre-baked elevation bands, border, and pointer highlight (0 saveLayer). |
ZBadge |
ZNotificationBadge |
Renders 1..99 and 99+ notification counts via ZeroNumberPainter with 0 String allocations. |
ZButton |
ZActionButton |
Direct pointer hit-testing and ZeroFrameScheduler splash animation with reactive enabledListenable. |
ZSwitch |
ZToggle |
Pre-allocated 16-step track/thumb Paint palette interpolation with 0 widget rebuilds. |
ZSlider |
- | Direct RenderBox pointer drag with optional ZeroNumberPainter.paintDouble readout. |
ZRangeSlider |
- | Dual-thumb range slider driven by ZeroRangeValuesController with zero rebuilds. |
ZLinearProgress |
- | Direct track/bar renderer with optional ZeroNumberPainter.paintPercent readout. |
ZCircularProgress |
- | Radial arc progress indicator with centered ZeroNumberPainter.paintPercent label. |
ZGauge |
ZSpeedometer |
Caches dial tick marks in a GPU ui.Picture and draws active needle + ZeroNumberPainter readout. |
ZJoystick |
ZVirtualPad |
Virtual 2D analog stick backed by ZeroJoystickController (Float32List(2) vector, 0 Offset heap allocations). |
ZKnob |
ZRotaryDial |
DAW-style vertical drag rotary dial with ZeroNumberPainter center value. |
ZMarquee |
ZRollingText |
Infinite smooth-scrolling banner using a single cached TextPainter tiled horizontally (0 allocations/frame). |
ZTypewriterText |
- | Progressive character reveal using TextPainter.getOffsetForCaret + Canvas.clipRect (0 substring() allocations). |
🚀 Installation & Usage #
dependencies:
d_zero_ui: ^0.1.0
import 'package:flutter/material.dart';
import 'package:d_zero_core/d_zero_core.dart';
import 'package:d_zero_ui/d_zero_ui.dart';
final badgeCount = ZeroIntNotifier(5);
final toggleState = ValueNotifier<bool>(true);
final sliderValue = ValueNotifier<double>(0.65);
final rangeCtrl = ZeroRangeValuesController(0.2, 0.8);
final speedValue = ZeroDoubleNotifier(78.5);
final joystickCtrl = ZeroJoystickController();
ZCard(
padding: const EdgeInsets.all(16),
child: Column(
children: [
const SizedBox(height: 24, child: ZMarquee(text: '⚡️ Zero-Rebuild UI Controls ')),
const SizedBox(height: 24, child: ZTypewriterText(text: 'Revealed without substring()!')),
Row(
children: [
ZBadge(
countListenable: badgeCount,
child: ZButton(label: 'Increment', onPressed: () => badgeCount.add(1)),
),
ZSwitch(controller: toggleState),
],
),
SizedBox(height: 28, child: ZSlider(controller: sliderValue)),
SizedBox(height: 28, child: ZRangeSlider(controller: rangeCtrl)),
SizedBox(height: 16, child: ZLinearProgress(valueListenable: sliderValue, showPercentage: true)),
Row(
children: [
SizedBox(width: 96, height: 96, child: ZGauge(valueListenable: speedValue, min: 0, max: 100)),
ZKnob(controller: sliderValue, min: 0, max: 1),
ZJoystick(controller: joystickCtrl),
],
),
],
),
);
📱 High-Load Comparison Benchmark App (example/) #
The example/ app modulates 20+ progress bars, gauges, knobs, sliders, badges, and text animations at 120Hz, comparing d_zero_ui against Material widgets with live FPS, UI CPU Load (%), RSS Memory (MB), Rebuilds, and Allocations.
cd packages/d_zero_ui/example
flutter run
📄 License #
MIT License © 2026 fexcy