2023-12-27 15:45:55 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
2024-01-01 16:11:05 +00:00
|
|
|
import '../../utils/responsive.dart';
|
|
|
|
import '../../screens/dashboard_screen.dart';
|
2023-12-30 15:46:13 +00:00
|
|
|
import 'side_menu.dart';
|
2023-12-27 15:45:55 +00:00
|
|
|
|
2023-12-30 15:46:13 +00:00
|
|
|
class MenuShell extends StatelessWidget {
|
|
|
|
const MenuShell({super.key, required this.child});
|
|
|
|
final Widget child;
|
2023-12-27 15:45:55 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
drawer: const SideMenu(),
|
|
|
|
body: SafeArea(
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// We want this side menu only for large screen
|
|
|
|
if (Responsive.isDesktop(context))
|
|
|
|
const Expanded(
|
|
|
|
// default flex = 1
|
|
|
|
// and it takes 1/6 part of the screen
|
|
|
|
child: SideMenu(),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
// It takes 5/6 part of the screen
|
|
|
|
flex: 5,
|
2023-12-30 15:46:13 +00:00
|
|
|
child: child,
|
2023-12-27 15:45:55 +00:00
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|