mk_sizer 1.2.0
mk_sizer: ^1.2.0 copied to clipboard
Adaptive Size helper created using concept of responsive_sizer and flutter_screen_util package.
1.2.0 #
minScaleFactor/maxScaleFactornow clamp.w/.h/.reven whenrespectAspectRatiois false (previously silently ignored), so tablets/foldables can be capped.- Added
MKSizer.heightMode(MKHeightMode.screendefault,safeArea,width) to stop tall Android phones inflating.hrelative to.w.safeAreasubtracts the notch/cutout, status bar and navigation bar (and landscape side cutouts from the width) whenMKSizerspans the window, and re-measures when they change;.ph/.pwthen refer to the usable area. - Added
MKSizer.designPadding: the system UI (status bar/notch/home indicator) included indesignSize, subtracted alongside the device's bars insafeAreamode. - Added
MKSizer.minSystemTextScale/maxSystemTextScaleto clamp the OS font-size setting for all descendant text, for consistent fonts across Android and iOS. - Added Android device-matrix tests.
1.1.0 #
- Added
MKSizer.respectAspectRatio(defaultfalse): blends the width/height scales toward their mean as the device's aspect ratio diverges fromdesignSize's, so layouts stretch less on very differently shaped screens (e.g. tablets vs. a phone mockup). No-op when the aspect ratios match. - Added
MKSizer.minScaleFactor/maxScaleFactorto clamp the.w/.h/.rscales (only whenrespectAspectRatiois true). - Added
MKSizer.minTextScaleFactor/maxTextScaleFactorto clamp the.spscale independently of layout scales (applies regardless ofrespectAspectRatio).context.spuses the same clamped scale. - Added
MKResponsiveBuilder,MKDeviceType,context.deviceTypeandcontext.resValue(...)for per-device-tier widgets/values (breakpoints 360 / 600 / 1024 by default). MKHelper.changed/MKHelper.initaccept the new options;MKSizerModelnotifies dependents correctly when they change.- Added tests.
1.0.2 #
- Added
MKSizedBox, aconst-capableSizedBoxthat scales width with.wand height with.h. - Added
MKPadding, aconst-capablePaddingthat scales horizontal insets with.wand vertical insets with.h, and updates on size change.
1.0.1 #
- Added
10.gap: a responsive, axis-aware gap widget (MKGap) that scales with.winside aRowand.hinside aColumn, matching the main-axis detection used bypackage:gapbut without depending on it.
1.0.0 #
- Renamed the package to
mk_sizer(importpackage:mk_sizer/mk_sizer.dart). - Responsive sizing extensions:
.w,.h,.r,.sp,.pw,.ph, spacing widgets andEdgeInsetshelpers. - Added
MKEdgeInsetsandMKEdgeInsetsDirectional; the directional variant scales horizontal values with.wand vertical with.h. MKSizer.builderis now aWidgetBuilder.- Extensions no longer throw before
MKSizerhas built; they scale 1:1. - Added
MKSizerModel(anInheritedModel) andcontext.w/h/r/sp/pw/ph, which rebuild a widget only when the axis it uses changes and work insideconstsubtrees. MKSizer.rebuildOnChange(defaulttrue) rebuilds the subtree on size change so10.wis correct insideconstwidgets.- Added tests.