mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-11 17:30:00 +02:00
78 lines
1.9 KiB
Dart
78 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
import '../../../core/models/playlist_config.dart';
|
|
import '../widgets/live_tv_tab.dart';
|
|
import '../widgets/movies_tab.dart';
|
|
import '../widgets/series_tab.dart';
|
|
import '../widgets/settings_tab.dart';
|
|
|
|
class DashboardScreen extends ConsumerStatefulWidget {
|
|
final PlaylistConfig playlist;
|
|
|
|
const DashboardScreen({
|
|
super.key,
|
|
required this.playlist,
|
|
});
|
|
|
|
@override
|
|
ConsumerState<DashboardScreen> createState() => _DashboardScreenState();
|
|
}
|
|
|
|
class _DashboardScreenState extends ConsumerState<DashboardScreen> {
|
|
int _selectedIndex = 0;
|
|
|
|
late final List<Widget> _tabs;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
_tabs = [
|
|
const LiveTVTab(),
|
|
MoviesTab(playlist: widget.playlist),
|
|
SeriesTab(playlist: widget.playlist),
|
|
const SettingsTab(),
|
|
];
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(
|
|
widget.playlist.name,
|
|
style: GoogleFonts.roboto(fontWeight: FontWeight.w600),
|
|
),
|
|
centerTitle: false,
|
|
),
|
|
body: _tabs[_selectedIndex],
|
|
bottomNavigationBar: NavigationBar(
|
|
selectedIndex: _selectedIndex,
|
|
onDestinationSelected: (index) {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
});
|
|
},
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.live_tv),
|
|
label: 'Live TV',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.movie),
|
|
label: 'Movies',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.tv),
|
|
label: 'Series',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.settings),
|
|
label: 'Settings',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|