smart_layout_switcher 1.0.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

A Flutter package that automatically switches between list, grid, masonry, and staggered layouts with smooth animations based on screen size.

Smart Layout Switcher for Flutter

Pub Version License: MIT

A revolutionary Flutter package that automatically switches between list, grid, masonry, and staggered layouts with smooth animations based on screen size.

Features

  • 🚀 Automatic layout switching based on screen size
  • 🎨 Smooth animated transitions between layouts
  • ⚙️ Fully customizable breakpoints
  • 📱 Responsive design made simple
  • 🏗 Zero-boilerplate implementation

Installation

Add to your pubspec.yaml:

dependencies:
  smart_layout_switcher: ^1.0.0

Usage

Basic implementation:

void main() {
  SmartLayoutSwitcher(
    children: List.generate(
      20,
          (index) => Card(child: Text('Item $index')),
    ),
  );
}

Custom configuration:

void main() {
  SmartLayoutSwitcher(
    children: myWidgets,
    listThreshold: 500,
    gridThreshold: 800,
    masonryThreshold: 1100,
    animationDuration: Duration(milliseconds: 500),
    gridCrossAxisCount: 3,
  );
}

Layout Thresholds

LayoutDefault ThresholdDescription
List<600pxSingle column layout
Grid600-900pxUniform grid layout
Masonry900-1200pxPinterest-style masonry layout
Staggered>1200pxStaggered grid with large items

License

MIT