aurcache/frontend/lib/components/routing/menu_shell.dart

36 lines
910 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import '../../utils/responsive.dart';
2023-12-30 15:46:13 +00:00
import 'side_menu.dart';
2023-12-30 15:46:13 +00:00
class MenuShell extends StatelessWidget {
const MenuShell({super.key, required this.child});
final Widget child;
@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,
),
],
),
),
);
}
}