Smart Layout Switcher for Flutter
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
| Layout | Default Threshold | Description |
|---|---|---|
| List | <600px | Single column layout |
| Grid | 600-900px | Uniform grid layout |
| Masonry | 900-1200px | Pinterest-style masonry layout |
| Staggered | >1200px | Staggered grid with large items |
License
MIT
Libraries
- smart_layout_switcher
- A Flutter package for responsive layout switching with smooth animations