omni_pixel 0.3.1
omni_pixel: ^0.3.1 copied to clipboard
Figma-first responsive sizing for Flutter. Register the device frames your designers use, then write 48.opx to get pixel-perfect scaling on any screen.
0.3.1 #
- Add cover image to the README.
0.3.0 #
OmniDebugOverlay: a floating, draggable debug bubble that expands into a live readout of everything OmniPixel resolved — screen size, orientation, platform, selected design frame, device class, breakpoints,scale,multiplierand aspect ratio. Drag it anywhere; it springs to the nearest side edge on release, Messenger chat-head style. Its parked position is stored as a fraction of the available travel, so it stays glued to its edge across rotations and window resizes.- Enable it with
OmniBuilder(debugOverlay: true), tune it withdebugOverlayConfig: OmniDebugOverlayConfig(...)(corner, label, colors, opacity, sizes, snap curve). Works in bothOmniBuilderplacements — insideMaterialApp.builderand wrappingMaterialApp— and standalone in aPositioned.fillfor apps that driveOmniPixel.initby hand. - The overlay is hidden in release builds unless
OmniDebugOverlayConfig.showInReleaseModeis set; profile builds always show it. It sizes itself in raw logical pixels, never.opx, so the multiplier you are debugging cannot distort the instrument. OmniPixel.isInitialized: a static readiness probe that never throws, unlike every instance getter. The overlay uses it to report "not initialized" instead of blowing up.
0.2.1 #
- Fix:
.opx/.h/.w/.dh/.dwread directly in a descendant'sbuild()now re-render on window resize and orientation change. PreviouslyOmniBuilderupdated the singleton but returned the samechildinstance, so Flutter skipped rebuilding the subtree and stale values stayed on screen until something else rebuilt it (on web: until a page refresh).OmniBuilderandOmniPixel.update(context)now force-rebuild the subtree after re-reading the metrics. Widgets that subscribe toMediaQuerythemselves (OmniResponsiveBuilder,OmniOrientationBuilder) were unaffected.
0.2.0 #
OmniResponsiveBuilder: picks a widget per device class (watch / mobile / tablet / desktop) by screen width, with fallback cascade desktop → tablet → mobile and watch → mobile. Works with or without OmniPixel initialized.OmniOrientationBuilder: portrait / landscape builders based on the screen orientation (a square screen counts as portrait). Omni-prefixed so it never shadows Flutter'sOrientationBuilder.OmniDeviceTypeenum andOmniBreakpoints: customizable width thresholds (defaults 300 / 600 / 1024), min-inclusive / max-exclusive likeOmniMultiplier.- Global breakpoints via
OmniBuilder(breakpoints: ...)/OmniPixel.init/configure; a per-widgetbreakpointsonOmniResponsiveBuilderoverrides them. OmniPixeladditions:deviceType,breakpoints, staticmaybeBreakpoints,isWatch/isMobile/isTablet/isDesktop, publicsizeOf(context);reset()clears breakpoints;debugDescription()includes the device class.
0.1.0 #
- Initial release.
OmniDevicedesign frames with Figma presets (OmniDevices).OmniMultiplierrules: aspect-ratio ranges + platform, min-inclusive / max-exclusive.OmniPixelcore engine: longest-side.opxscaling, automatic design-device selection, multiplier resolution, context-freeconfigurefor tests.OmniBuilderwidget wired to orientation and window-size changes.numextensions:.opx,.h,.w,.dh,.dw,.ls,.ss.