fabrik_layout 1.2.0
fabrik_layout: ^1.2.0 copied to clipboard
A lightweight, opinionated layout and responsiveness foundation for Flutter applications.
Changelog #
All notable changes to this package are documented in this file.
The format is based on Keep a Changelog, and this project adheres to semantic versioning.
1.2.0 #
Fixes #
-
Fix: Layout is no longer misclassified under an unbounded-width ancestor. Inside a horizontal
ListViewor an unconstrainedRow,constraints.maxWidthis infinite, and sinceInfinity < mobileis false every device fell through to the widest category — a 375 px phone reportedisDesktop == truewhilescreenSizecorrectly reported 375.FabrikLayoutnow falls back to theMediaQuerywidth whenever the incoming width is unbounded, sotypeandscreenSizecan no longer contradict each other. -
Fix:
FabrikBreakpoints.desktopnow affects classification. It was documented as "reserved for future use" and had no effect at all — setting it to1,1440or9999produced identical results — while still appearing in the public constructor as though it meant something.
Breaking #
-
Changed:
FabrikLayoutTypegains a fourth value,largeDesktop, for widths at or aboveFabrikBreakpoints.desktop(1440 by default). Widths fromtabletup todesktopremaindesktop.This breaks exhaustive
switchstatements overFabrikLayoutType; the analyzer will point at each one. Code that only usesisMobile/isTablet/value<T>()is unaffected.Note that
isDesktopis now the narrow 1024–1439 band only. Use the newisDesktopOrWiderwhere you previously meant "desktop and above":// before — true for everything >= 1024 if (context.layout.isDesktop) { ... } // after — same meaning if (context.layout.isDesktopOrWider) { ... } -
Changed:
FabrikBreakpointsnow assertstablet < desktop, alongside the existingmobile < tabletcheck.
New #
- New:
FabrikLayoutData.isLargeDesktopandisDesktopOrWider. - New:
FabrikLayoutData.value<T>()accepts an optionallargeDesktopargument. Omitting it falls back todesktop, thentablet, thenmobile, so existing call sites keep working unchanged. - New:
FabrikTextScaleConfig.largeDesktop, defaulting tonullso it reuses thedesktopfloor.effectiveLargeDesktopresolves the value actually applied.
Docs #
FabrikBreakpointsnow documents that each value is the upper bound of the category below it, since the field names read like lower bounds.
Tests #
- Test suite grown from 58 to 80 tests, covering the unbounded-width fallback, the four-band classification, custom desktop thresholds, and the
value<T>fallback chain.
1.1.0 #
- Added:
FabrikLayoutData.orientation— exposes the device orientation derived fromMediaQuery; access viacontext.layout.isPortraitandcontext.layout.isLandscape - Added:
FabrikTextScaleConfig— configuration class for overriding default text scale floors per device category; pass toFabrikLayout(textScaleConfig: ...)whenenableTextScalingistrue - Added:
FabrikLayoutData.copyWith()— returns a modified copy of the layout snapshot - Fix:
context.layoutnow throws aStateErrorin both debug and release mode whenFabrikLayoutis missing — previously theassertwas stripped in release builds, leaving a force-unwrap!that could crash silently - Fix:
FabrikLayoutDatanow implements==andhashCode— without value equality,FabrikLayoutScope.updateShouldNotifyalways returnedtrue(reference comparison on freshly-created instances), causing unnecessary rebuilds on every layout change - Fix:
FabrikBreakpointsnow assertsmobile < tabletat construction time to catch invalid configurations early - Added
==andhashCodetoFabrikBreakpoints
1.0.0 #
This is the first stable release of fabrik_layout and defines the long-term public API and boundaries of the package.
The package is intentionally minimal and focuses exclusively on layout context and optional text scaling.
Added #
FabrikLayoutwidget for providing layout context to the app- Width-based device classification:
- Mobile
- Tablet
- Desktop
- Default, opinionated breakpoint definitions via
FabrikBreakpoints FabrikLayoutDataimmutable snapshot exposed viaBuildContextBuildContextextension:context.layout
- Optional, opt-in global text scaling using Flutter’s
TextScaler - Safe
MediaQueryintegration without theme mutation