mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 14:47:23 +00:00
21 lines
511 B
Dart
21 lines
511 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ResponsiveLayout extends StatelessWidget {
|
|
final Widget desktopBody;
|
|
final Widget mobileBody;
|
|
const ResponsiveLayout(
|
|
{super.key, required this.desktopBody, required this.mobileBody});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
if (constraints.maxWidth < 600) {
|
|
return mobileBody;
|
|
} else {
|
|
return desktopBody;
|
|
}
|
|
},
|
|
);
|
|
}
|
|
}
|