A High-Performance, Type-Safe Flutter Responsive & Adaptive UI Framework
Flexi UI is a production-ready Flutter responsive framework for building scalable, adaptive apps across mobile, tablet, and desktop.
It combines fluid scaling, breakpoint-based layouts, design tokens, and a granular performance model powered by InheritedModel.
Most responsive solutions only scale sizes. Flexi UI provides a complete adaptive system:
✔ Screen-based scaling
✔ Parent-based component scaling
✔ Discrete breakpoint logic
✔ Fluid multi-stage interpolation
✔ Responsive design tokens (spacing, typography, icons)
✔ Built-in accessibility & motion helpers
✔ Granular rebuild performance
- Getting Started
- API Quick Reference
- Scaling System
- Component-Level Responsiveness
- Layout & Adaptive Components
- Design Tokens
- Motion & Accessibility
- Breakpoints & Device Model
- Configuration
- Best Practices
- Performance Model
- Troubleshooting
- Debug Overlay
- Example App
- Support
dependencies:
flexi_ui: ^1.2.1void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return FlexiConfig(
designMinWidth: 360,
designMaxWidth: 1440,
showDebugOverlay: true,
child: const MaterialApp(home: DashboardScreen()),
);
}
}@override
Widget build(BuildContext context) {
final flexi = context.flexi;
return Scaffold(
appBar: AppBar(title: Text(flexi.breakpoint.name)),
body: flexi.isDesktop ? DesktopLayout() : MobileLayout(),
);
}.w(context)— % of screen width.h(context)— % of screen height.rw(context)— responsive width.rh(context)— responsive height.fw(context)— parent-based width.fh(context)— parent-based height.aw(max, context)— fluid width interpolation.ah(max, context)— fluid height interpolation.fr(context)— fluid radius scaling.fStroke(context)— dampened border scaling.fs(context)— safe uniform scalingTuple2(a, b).d(context)— diagonal scaling
FlexiFluid3— tiered fluid scalingBreakpointValue<T>— discrete breakpoint valuescontext.flexi— semantic responsive helper
| Method | Description |
|---|---|
.rw(context) |
Responsive width (design → screen) |
.rh(context) |
Responsive height |
.w(context) |
% of screen width |
.h(context) |
% of screen height |
fontSize: 18.aw(32, context)const FlexiFluid3(mobile: 14, tablet: 16, desktop: 20).resolve(context);| Method | Purpose |
|---|---|
.fr(context) |
Fluid radius scaling |
.fStroke(context) |
Fluid border width |
.fs(context) |
Safe uniform scaling |
ResponsiveCard(
targetWidth: 300,
targetHeight: 400,
child: Padding(
padding: EdgeInsets.all(16.fw(context)),
),
)FlexiCircle(size: 48, child: Icon(Icons.person))- FlexiLayout — breakpoint-based layouts
- FlexiAdaptiveNav — adaptive navigation
- FlexiGrid — responsive grid
- FlexiMaxWidth — max-width constraint
- FlexiVisibility — breakpoint visibility
FlexiTextStyles.h1(context)FlexiSpacing.m(context)FlexiIconSize.m(context)FlexiMotion.durationMedium(context)FlexiMinTapTargetFlexiTextClamp
| Breakpoint | Meaning |
|---|---|
| mobilePortrait | Phone portrait |
| mobileLandscape | Phone landscape |
| tablet | Tablet layouts |
| desktop | Desktop layouts |
FlexiConfig(
designMinWidth: 360,
designMaxWidth: 1440,
mobilePortraitBreakpoint: 600,
tabletLandscapeBreakpoint: 1100,
spacing: FlexiSpacingConfig.defaultConfig,
typography: FlexiTypographyConfig.defaultConfig,
icons: FlexiIconConfig.defaultConfig,
)| Flag | Purpose |
|---|---|
useParentConstraints |
Use parent layout instead of MediaQuery |
allowImplicitRebuilds |
Allow rebuilds without aspect (not recommended) |
- Use
context.flexi.breakpointfor layout switching - Prefer design tokens over hardcoded sizes
- Use
.fs()for circles/icons - Keep
allowImplicitRebuildsdisabled
Flexi UI uses InheritedModel aspect scoping for minimal rebuilds.
You get performance benefits automatically.
FlexiConfig not found → Wrap your app root with FlexiConfig.
Circles distorted → Use .fs(context).
Unbounded constraints → Use FlexiMaxWidth or constrained parent.
FlexiConfig(showDebugOverlay: true)Shows screen metrics & breakpoints in debug mode.
See /example for dashboard, grids, forms, and scaling showcase.
- Issues: https://github.com/akshaySavanoor/flutter_flexi/issues
- PRs welcome
Made with ❤️ for the Flutter community