Demo creata per il Meetup CounterApp & Flutter Forward Extended Modena incentrata sull'uso del LayoutBuilder
:
File: home_screen.dart
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return LayoutBuilder(builder: (context, constraints) {
if (constraints.maxWidth >= 1024) {
return const DesktopHomeScreen();
}
if (constraints.maxWidth >= 600) {
return const TabletHomeScreen();
}
return const MobileHomeScreen();
});
}
}
Made with ❤️ by Dario Varriale.