123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- import 'package:fitness_dashboard_ui/util/responsive.dart';
- import 'package:fitness_dashboard_ui/widgets/dashboard_widget.dart';
- import 'package:fitness_dashboard_ui/widgets/side_menu_widget.dart';
- import 'package:fitness_dashboard_ui/widgets/summary_widget.dart';
- import 'package:flutter/material.dart';
- class MainScreen extends StatelessWidget {
- const MainScreen({super.key});
- @override
- Widget build(BuildContext context) {
- final isDesktop = Responsive.isDesktop(context);
- return Scaffold(
- drawer: !isDesktop
- ? const SizedBox(
- width: 250,
- child: SideMenuWidget(),
- )
- : null,
- endDrawer: Responsive.isMobile(context)
- ? SizedBox(
- width: MediaQuery.of(context).size.width * 0.8,
- child: const SummaryWidget(),
- )
- : null,
- body: SafeArea(
- child: Row(
- children: [
- if (isDesktop)
- Expanded(
- flex: 2,
- child: SizedBox(
- child: SideMenuWidget(),
- ),
- ),
- Expanded(
- flex: 7,
- child: DashboardWidget(),
- ),
- if (isDesktop)
- Expanded(
- flex: 3,
- child: SummaryWidget(),
- ),
- ],
- ),
- ),
- );
- }
- }
|