2026-05-28 19:10:08 -04:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
2026-06-04 08:39:37 -04:00
|
|
|
import '../theme/dimens.dart';
|
2026-05-28 19:23:27 -04:00
|
|
|
import '../widgets/device_summary_card.dart';
|
2026-05-29 10:19:50 -04:00
|
|
|
import '../widgets/scanners_status_card.dart';
|
2026-05-29 08:06:30 -04:00
|
|
|
import 'notifications_list.dart';
|
2026-05-28 19:10:08 -04:00
|
|
|
|
2026-05-29 08:06:30 -04:00
|
|
|
class HomeScreen extends StatelessWidget {
|
2026-05-28 19:10:08 -04:00
|
|
|
const HomeScreen({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return LayoutBuilder(
|
|
|
|
|
builder: (context, constraints) {
|
2026-06-04 08:39:37 -04:00
|
|
|
final isTwoColumn = constraints.maxWidth >= Breakpoints.twoColumn;
|
2026-05-29 08:06:30 -04:00
|
|
|
return isTwoColumn ? _buildTwoColumn() : _buildSingleColumn();
|
2026-05-28 19:10:08 -04:00
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-29 08:06:30 -04:00
|
|
|
Widget _buildTwoColumn() {
|
|
|
|
|
return const Row(
|
2026-05-28 19:10:08 -04:00
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
2026-05-29 08:06:30 -04:00
|
|
|
Expanded(flex: 3, child: NotificationsList()),
|
2026-06-04 08:39:37 -04:00
|
|
|
VerticalDivider(width: Insets.xxxl),
|
2026-05-29 08:06:30 -04:00
|
|
|
SizedBox(
|
2026-05-28 19:10:08 -04:00
|
|
|
width: 300,
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
|
|
|
children: [
|
2026-05-28 19:23:27 -04:00
|
|
|
DeviceSummaryCard(),
|
2026-06-04 08:39:37 -04:00
|
|
|
SizedBox(height: Insets.lg),
|
2026-05-29 10:19:50 -04:00
|
|
|
ScannersStatusCard(),
|
2026-05-28 19:10:08 -04:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-29 08:06:30 -04:00
|
|
|
Widget _buildSingleColumn() {
|
|
|
|
|
return const NotificationsList(
|
|
|
|
|
trailingSlivers: [
|
|
|
|
|
SliverToBoxAdapter(
|
2026-05-28 19:10:08 -04:00
|
|
|
child: Padding(
|
2026-06-04 08:39:37 -04:00
|
|
|
padding: EdgeInsets.only(top: Insets.xxl),
|
2026-05-28 19:23:27 -04:00
|
|
|
child: DeviceSummaryCard(),
|
2026-05-28 19:10:08 -04:00
|
|
|
),
|
|
|
|
|
),
|
2026-05-29 08:06:30 -04:00
|
|
|
SliverToBoxAdapter(
|
2026-05-28 19:10:08 -04:00
|
|
|
child: Padding(
|
2026-06-04 08:39:37 -04:00
|
|
|
padding: EdgeInsets.only(top: Insets.lg, bottom: Insets.xl),
|
2026-05-29 10:19:50 -04:00
|
|
|
child: ScannersStatusCard(),
|
2026-05-28 19:10:08 -04:00
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|