flutter_sfs library

A highly performant Flutter package for responsive UI layout across Mobile, Tablet, and Desktop.

Provides SfsInitBuilder for initialization and powerful Dart extensions like .s, .w, .p, and .v to seamlessly construct mathematical responsive layouts.

Classes

CardRange
A simple domain defining width and height restrictions.
DivideRange
Percentage-based divisions isolating font scales across different device types.
Range
A simple domain class representing a min / max restriction pair.
RebuildFactors
Defines caching strategies to avoid unnecessary widget tree rebuilds.
SFS
The core static execution layer mapping mathematical layout calculations. Avoid invoking methods directly; utilize the num extensions instead (e.g., 16.s).
SfsCal
Internal engine coordinating physical screen tracking and dimensional ratios.
SfsInitBuilder
A structural wrapper that initializes the flutter_sfs mathematical scaling engine.
SizeRange
======================================================================= Configuration parameters defining the boundaries for layout scaling.

Extensions

CardSizeExtension on num
Provides responsive scaling for standard layout dimensions like width, height, and radius.
DeviceValueExtension on num
FontSizeExtension on num
PaddingExtension on num
SliverSizeExtension on num

Properties

defaultFontSizeMax double
The default fallback maximum font size securely clamped if unconfigured.
getter/setter pair
defaultFontSizeMin double
The default fallback minimum font size securely clamped if unconfigured.
getter/setter pair
mq MediaQueryData?
Global reference to the current MediaQueryData tracked by SfsInitBuilder.
getter/setter pair
sfsHeight double
Quickly provides the current screen height. Returns 0.0 if SFS is uninitialized.
no setter
sfsWidth double
Quickly provides the current screen width. Returns 0.0 if SFS is uninitialized.
no setter

Typedefs

RebuildFactor = bool Function(MediaQueryData oldMediaQueryData, MediaQueryData newMediaQueryData)
SfsBuilder = Widget Function(BuildContext context, Widget? child)
A custom builder function exposing the BuildContext required for MaterialApp.