Files
syncrow-web/lib/pages/analytics/modules/occupancy/views/analytics_occupancy_view.dart
2025-06-12 15:33:32 +03:00

60 lines
1.9 KiB
Dart

import 'package:flutter/material.dart';
import 'package:syncrow_web/pages/analytics/modules/occupancy/widgets/occupancy_chart_box.dart';
import 'package:syncrow_web/pages/analytics/modules/occupancy/widgets/occupancy_end_side_bar.dart';
import 'package:syncrow_web/pages/analytics/modules/occupancy/widgets/occupancy_heat_map_box.dart';
class AnalyticsOccupancyView extends StatelessWidget {
const AnalyticsOccupancyView({super.key});
static const _padding = EdgeInsetsDirectional.all(32);
@override
Widget build(BuildContext context) {
final height = MediaQuery.sizeOf(context).height;
return LayoutBuilder(
builder: (context, constraints) {
final isMediumOrLess = constraints.maxWidth <= 900;
if (isMediumOrLess) {
return SingleChildScrollView(
padding: _padding,
child: Column(
spacing: 32,
children: [
SizedBox(
height: height * 0.46, child: const OccupancyEndSideBar()),
SizedBox(
height: height * 0.5, child: const OccupancyChartBox()),
SizedBox(
height: height * 0.5, child: const OccupancyHeatMapBox()),
],
),
);
}
return SingleChildScrollView(
child: Container(
padding: _padding,
height: height * 0.9,
child: const Row(
spacing: 32,
children: [
Expanded(
flex: 5,
child: Column(
spacing: 20,
children: [
Expanded(child: OccupancyChartBox()),
Expanded(child: OccupancyHeatMapBox()),
],
),
),
Expanded(flex: 2, child: OccupancyEndSideBar()),
],
),
),
);
},
);
}
}