A drop-in replacement for Flutter's Scaffold that adapts automatically to mobile, tablet, and desktop layouts.
Build responsive apps that switch layouts, navigation, and content based on screen size.
- Adaptive body (mobile / tablet / desktop)
- Adaptive navigation (BottomNavigationBar → NavigationRail → Drawer)
AdaptiveBuilderAPI for flexible custom layoutscontext.isMobile / context.isTablet / context.isDesktopextensions- Configurable breakpoints
- Drop-in replacement for Scaffold with all original functionality
Add this to your pubspec.yaml:
dependencies:
adapto_scaffold: ^0.2.2Then run:
flutter pub getimport 'package:flutter/material.dart';
import 'package:adapto_scaffold/adapto_scaffold.dart';
AdaptoScaffold(
appBar: AppBar(title: Text("Adapto Scaffold")),
mobileBody: Center(child: Text("📱 Mobile Layout")),
tabletBody: Center(child: Text("📟 Tablet Layout")),
desktopBody: Center(child: Text("🖥 Desktop Layout")),
floatingActionButton: FloatingActionButton(
onPressed: () {},
child: Icon(Icons.add),
),
);AdaptiveNavigationBar(
destinations: [
AdaptiveDestination(icon: Icons.home, label: "Home", body: HomePage()),
AdaptiveDestination(icon: Icons.settings, label: "Settings", body: SettingsPage()),
],
);Use AdaptiveBuilder to create custom layouts based on screen size:
AdaptiveBuilder(
builder: (context, layout) {
switch (layout) {
case AdaptiveLayoutType.mobile:
return Text("📱 Mobile View");
case AdaptiveLayoutType.tablet:
return Text("📟 Tablet View");
case AdaptiveLayoutType.desktop:
return Text("🖥 Desktop View");
}
},
);- Save time writing responsive layouts
- Keep original Scaffold behavior intact
- Switch between layouts automatically without boilerplate
- Compatible with Flutter mobile, tablet, and web/desktop apps
MIT License © 2025 Dev-Arnab-Flutter