Skip to content

Commit 64ea30d

Browse files
authored
feat Add bottom navigation on dashboard home; update flutter_config.env HLS URL (#24)
* feat: Add Flutter client for Random Video Streamer - Introduced a new Flutter client application for controlling and monitoring the Random Video Clips Streaming Server. - Implemented API endpoints for admin context, stats, and audio file retrieval. - Enhanced the dashboard with navigation and improved UI for better user experience. - Added support for audio file management and chunk generation controls. - Included necessary configuration files and dependencies for Flutter development. * feat: Implement route-based navigation and enhance admin and stats screens - Added `go_router` dependency for improved routing capabilities. - Introduced separate pages for Dashboard, Admin, and Stats with a unified header for navigation. - Enhanced Admin screen to display live status and system usage metrics. - Updated Stats screen to include pagination for model and audio statistics. - Refactored Home screen to streamline data loading and improve UI consistency. * feat: Update dependencies and enhance UI components - Added `google_fonts` and `url_launcher` dependencies for improved typography and link handling. - Introduced `video_player_web_hls` for enhanced HLS streaming support on web platforms. - Refactored the theme and UI components for better consistency and user experience across screens. - Updated README with detailed instructions for enabling live streaming and platform-specific notes. * feat: Enhance stats screen with new `StatCard`, `GlassCard` widgets, and introduce model filtering, sorting, and pagination. * feat: introduce initial Flutter frontend application with admin, home, and stats screens, and update build/deployment scripts. * refactor: Remove old Flutter client and HTML frontend, update backend configuration, and add new Flutter build scripts. * ci: Update Docker build contexts and Dockerfile paths to the `backend` directory. * feat: Introduce bottom navigation for dashboard, video, and audio sections, and update HLS streaming URL.
1 parent c431021 commit 64ea30d

2 files changed

Lines changed: 102 additions & 27 deletions

File tree

frontend-flutter/lib/src/screens/home_screen.dart

Lines changed: 101 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -328,41 +328,107 @@ class _HomeScreenState extends State<HomeScreen> {
328328

329329
// ── BUILD ──
330330

331+
int _navIndex = 0;
332+
331333
@override
332334
Widget build(BuildContext context) {
333-
return Scaffold(
334-
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
335-
body: _loading && _streamStatus == null
336-
? const Center(child: CircularProgressIndicator())
337-
: RefreshIndicator(
338-
onRefresh: _refreshData,
339-
child: SelectionArea(
340-
child: ListView(
341-
padding: const EdgeInsets.fromLTRB(16, 12, 16, 24),
342-
children: [
343-
_buildHeader(context),
335+
Widget? body;
336+
if (_loading && _streamStatus == null) {
337+
body = const Center(child: CircularProgressIndicator());
338+
} else {
339+
switch (_navIndex) {
340+
case 0:
341+
body = RefreshIndicator(
342+
onRefresh: _refreshData,
343+
child: SelectionArea(
344+
child: ListView(
345+
padding: const EdgeInsets.fromLTRB(16, 12, 16, 24),
346+
children: [
347+
_buildHeader(context),
348+
const SizedBox(height: 16),
349+
_buildOverviewStrip(context),
350+
const SizedBox(height: 16),
351+
_buildPlayerCard(context),
352+
if (_error != null) ...[
344353
const SizedBox(height: 16),
345-
_buildOverviewStrip(context),
354+
_buildErrorCard(context, _error!),
355+
],
356+
],
357+
),
358+
),
359+
);
360+
break;
361+
case 1:
362+
body = RefreshIndicator(
363+
onRefresh: _refreshData,
364+
child: SelectionArea(
365+
child: ListView(
366+
padding: const EdgeInsets.fromLTRB(16, 12, 16, 24),
367+
children: [
368+
_buildHeader(context, title: 'Video Chunks'),
369+
const SizedBox(height: 16),
370+
_buildChunksSection(context),
371+
if (_error != null) ...[
346372
const SizedBox(height: 16),
347-
_buildPlayerCard(context),
348-
const SizedBox(height: 20),
349-
_buildChunksSection(context),
350-
const SizedBox(height: 20),
351-
_buildAudioSection(context),
352-
if (_error != null) ...[
353-
const SizedBox(height: 16),
354-
_buildErrorCard(context, _error!),
355-
],
373+
_buildErrorCard(context, _error!),
356374
],
357-
),
375+
],
376+
),
377+
),
378+
);
379+
break;
380+
case 2:
381+
body = RefreshIndicator(
382+
onRefresh: _refreshData,
383+
child: SelectionArea(
384+
child: ListView(
385+
padding: const EdgeInsets.fromLTRB(16, 12, 16, 24),
386+
children: [
387+
_buildHeader(context, title: 'Audio Library'),
388+
const SizedBox(height: 16),
389+
_buildAudioSection(context),
390+
if (_error != null) ...[
391+
const SizedBox(height: 16),
392+
_buildErrorCard(context, _error!),
393+
],
394+
],
358395
),
359396
),
397+
);
398+
break;
399+
}
400+
}
401+
402+
return Scaffold(
403+
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
404+
body: SafeArea(child: body!),
405+
bottomNavigationBar: NavigationBar(
406+
selectedIndex: _navIndex,
407+
onDestinationSelected: (v) => setState(() => _navIndex = v),
408+
destinations: const [
409+
NavigationDestination(
410+
icon: Icon(Icons.dashboard_outlined),
411+
selectedIcon: Icon(Icons.dashboard_rounded),
412+
label: 'Dashboard',
413+
),
414+
NavigationDestination(
415+
icon: Icon(Icons.video_library_outlined),
416+
selectedIcon: Icon(Icons.video_library_rounded),
417+
label: 'Videos',
418+
),
419+
NavigationDestination(
420+
icon: Icon(Icons.library_music_outlined),
421+
selectedIcon: Icon(Icons.library_music_rounded),
422+
label: 'Audio',
423+
),
424+
],
425+
),
360426
);
361427
}
362428

363429
// ── Header ──
364430

365-
Widget _buildHeader(BuildContext context) {
431+
Widget _buildHeader(BuildContext context, {String title = 'Streaming Dashboard'}) {
366432
final cs = Theme.of(context).colorScheme;
367433
final tt = Theme.of(context).textTheme;
368434
return Row(
@@ -381,7 +447,7 @@ class _HomeScreenState extends State<HomeScreen> {
381447
),
382448
const SizedBox(width: 12),
383449
Expanded(
384-
child: Text('Streaming Dashboard',
450+
child: Text(title,
385451
style: tt.titleLarge
386452
?.copyWith(fontWeight: FontWeight.w800, letterSpacing: -0.5)),
387453
),
@@ -557,7 +623,15 @@ class _HomeScreenState extends State<HomeScreen> {
557623
aspectRatio: controller!.value.aspectRatio == 0
558624
? 16 / 9
559625
: controller.value.aspectRatio,
560-
child: VideoPlayer(controller),
626+
child: Stack(
627+
fit: StackFit.expand,
628+
children: [
629+
VideoPlayer(controller),
630+
Positioned.fill(
631+
child: Container(color: Colors.transparent),
632+
),
633+
],
634+
),
561635
),
562636
)
563637
else if (_videoError == null)
@@ -597,7 +671,8 @@ class _HomeScreenState extends State<HomeScreen> {
597671
),
598672
iconSize: 20,
599673
),
600-
Expanded(
674+
SizedBox(
675+
width: 120,
601676
child: SliderTheme(
602677
data: SliderThemeData(
603678
trackHeight: 3,

scripts/flutter_config.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LOCAL_PREVIEW_PORT=8090
1818
# Deployed to your Proxmox server
1919
# ----------------------------------------
2020
PROXMOX_API_BASE_URL="http://192.168.0.11:8081"
21-
PROXMOX_HLS_URL="http://192.168.0.11:8082/hls/stream.m3u8"
21+
PROXMOX_HLS_URL="http://192.168.0.11:8080/hls/stream.m3u8"
2222
PROXMOX_ENABLE_LIVE_STREAM="true"
2323
PROXMOX_REFRESH_SECONDS=5
2424
PROXMOX_PREVIEW_PORT=8090

0 commit comments

Comments
 (0)