responsive_layout_thrive 1.0.2+1 responsive_layout_thrive: ^1.0.2+1 copied to clipboard
A package to use responsive design in flutter.
example/example.dart
import 'package:flutter/material.dart';
import 'package:responsive_layout_thrive/responsive.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Responsive(mobileBody: const MobileBody(), tabletBody: const TabletBody(), desktopBody: const DesktopBody()),
),
);
}
}
class DesktopBody extends StatelessWidget {
const DesktopBody({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.blue,
);
}
}
class MobileBody extends StatelessWidget {
const MobileBody({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.red,
);
}
}
class TabletBody extends StatelessWidget {
const TabletBody({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.green,
);
}
}