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

8
likes
0
points
615
downloads

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

Documentation

Documentation

License

unknown (license)

Dependencies

flutter, tuple

More

Packages that depend on flexi_ui