mirror of
https://github.com/rzuasti/oott.git
synced 2026-07-08 19:21:54 +02:00
Add an mDNS Scanner status card to the Status screen mirroring the ARP card, and replace the ARP card on the Home screen with a combined Status card that summarizes both scanners in one line each. Extract the shared duration formatting helper into utils/duration_formatter.dart. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
1.6 KiB
Dart
64 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
import '../widgets/device_summary_card.dart';
|
|
import '../widgets/scanners_status_card.dart';
|
|
import 'notifications_list.dart';
|
|
|
|
const _twoColumnBreakpoint = 700.0;
|
|
|
|
class HomeScreen extends StatelessWidget {
|
|
const HomeScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return LayoutBuilder(
|
|
builder: (context, constraints) {
|
|
final isTwoColumn = constraints.maxWidth >= _twoColumnBreakpoint;
|
|
return isTwoColumn ? _buildTwoColumn() : _buildSingleColumn();
|
|
},
|
|
);
|
|
}
|
|
|
|
Widget _buildTwoColumn() {
|
|
return const Row(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Expanded(flex: 3, child: NotificationsList()),
|
|
VerticalDivider(width: 32),
|
|
SizedBox(
|
|
width: 300,
|
|
child: SingleChildScrollView(
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
DeviceSummaryCard(),
|
|
SizedBox(height: 16),
|
|
ScannersStatusCard(),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildSingleColumn() {
|
|
return const NotificationsList(
|
|
trailingSlivers: [
|
|
SliverToBoxAdapter(
|
|
child: Padding(
|
|
padding: EdgeInsets.only(top: 24),
|
|
child: DeviceSummaryCard(),
|
|
),
|
|
),
|
|
SliverToBoxAdapter(
|
|
child: Padding(
|
|
padding: EdgeInsets.only(top: 16, bottom: 20),
|
|
child: ScannersStatusCard(),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|