flexi_ui 1.2.1 copy "flexi_ui: ^1.2.1" to clipboard
flexi_ui: ^1.2.1 copied to clipboard

A high-performance Flutter responsive UI framework with type-safe breakpoints, fluid scaling, and component-level adaptive layouts.

Flexi UI πŸš€ #

A High-Performance, Type-Safe Flutter Responsive & Adaptive UI Framework

Pub Version
License
Flutter

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.


✨ Why Flexi UI? #

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


πŸ“š Table of Contents #

  • 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

πŸš€ Getting Started #

1️⃣ Install #

dependencies:
  flexi_ui: ^1.2.1

2️⃣ Wrap Your App #

void 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()),
    );
  }
}

3️⃣ Use Anywhere #

@override
Widget build(BuildContext context) {
  final flexi = context.flexi;

  return Scaffold(
    appBar: AppBar(title: Text(flexi.breakpoint.name)),
    body: flexi.isDesktop ? DesktopLayout() : MobileLayout(),
  );
}

🧾 API Quick Reference #

Extensions on num #

  • .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 scaling
  • Tuple2(a, b).d(context) β€” diagonal scaling

Helpers #

  • FlexiFluid3 β€” tiered fluid scaling
  • BreakpointValue<T> β€” discrete breakpoint values
  • context.flexi β€” semantic responsive helper

πŸ“ Scaling System #

πŸ–₯ Screen-Based Scaling #

Method Description
.rw(context) Responsive width (design β†’ screen)
.rh(context) Responsive height
.w(context) % of screen width
.h(context) % of screen height

🌊 Fluid Interpolation #

fontSize: 18.aw(32, context)

🎚 Tiered Scaling #

const FlexiFluid3(mobile: 14, tablet: 16, desktop: 20).resolve(context);

πŸŽ› Visual Scaling #

Method Purpose
.fr(context) Fluid radius scaling
.fStroke(context) Fluid border width
.fs(context) Safe uniform scaling

🧱 Component-Level Responsiveness #

ResponsiveCard(
  targetWidth: 300,
  targetHeight: 400,
  child: Padding(
    padding: EdgeInsets.all(16.fw(context)),
  ),
)

FlexiCircle #

FlexiCircle(size: 48, child: Icon(Icons.person))

🧩 Layout & Adaptive Components #

  • FlexiLayout β€” breakpoint-based layouts
  • FlexiAdaptiveNav β€” adaptive navigation
  • FlexiGrid β€” responsive grid
  • FlexiMaxWidth β€” max-width constraint
  • FlexiVisibility β€” breakpoint visibility

🎨 Design Tokens #

Typography #

FlexiTextStyles.h1(context)

Spacing #

FlexiSpacing.m(context)

Icons #

FlexiIconSize.m(context)

🎞 Motion & Accessibility #

Motion #

FlexiMotion.durationMedium(context)

Accessibility #

  • FlexiMinTapTarget
  • FlexiTextClamp

πŸ“Š Breakpoints #

Breakpoint Meaning
mobilePortrait Phone portrait
mobileLandscape Phone landscape
tablet Tablet layouts
desktop Desktop layouts

βš™ Configuration #

FlexiConfig(
  designMinWidth: 360,
  designMaxWidth: 1440,
  mobilePortraitBreakpoint: 600,
  tabletLandscapeBreakpoint: 1100,
  spacing: FlexiSpacingConfig.defaultConfig,
  typography: FlexiTypographyConfig.defaultConfig,
  icons: FlexiIconConfig.defaultConfig,
)

Advanced Flags #

Flag Purpose
useParentConstraints Use parent layout instead of MediaQuery
allowImplicitRebuilds Allow rebuilds without aspect (not recommended)

βœ… Best Practices #

  • Use context.flexi.breakpoint for layout switching
  • Prefer design tokens over hardcoded sizes
  • Use .fs() for circles/icons
  • Keep allowImplicitRebuilds disabled

⚑ Performance Model #

Flexi UI uses InheritedModel aspect scoping for minimal rebuilds.
You get performance benefits automatically.


❗ Troubleshooting #

FlexiConfig not found β†’ Wrap your app root with FlexiConfig.
Circles distorted β†’ Use .fs(context).
Unbounded constraints β†’ Use FlexiMaxWidth or constrained parent.


πŸ” Debug Overlay #

FlexiConfig(showDebugOverlay: true)

Shows screen metrics & breakpoints in debug mode.


πŸ“± Example App #

See /example for dashboard, grids, forms, and scaling showcase.


🀝 Support & Contributions #

Made with ❀️ for the Flutter community

9
likes
0
points
42
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

A high-performance Flutter responsive UI framework with type-safe breakpoints, fluid scaling, and component-level adaptive layouts.

Repository (GitHub)
View/report issues

Topics

#responsive #adaptive-ui #flutter-layout #design-system #breakpoints

License

unknown (license)

Dependencies

flutter, tuple

More

Packages that depend on flexi_ui