movie and tvshow list
This commit is contained in:
+4
-2
@@ -24,10 +24,12 @@ void main() async {
|
||||
String? dbPassword = prefs.getString('dbPassword');
|
||||
|
||||
// if (dbProtocol == null) {
|
||||
prefs.setString('dbProtocol', 'http');
|
||||
//prefs.setString('dbProtocol', 'http');
|
||||
prefs.setString('dbProtocol', 'https');
|
||||
// }
|
||||
// if (dbHost == null) {
|
||||
prefs.setString('dbHost', '192.168.0.70');
|
||||
//prefs.setString('dbHost', '192.168.0.70');
|
||||
prefs.setString('dbHost', 'api.windesign.at');
|
||||
// }
|
||||
// if (dbProtocol == null) {
|
||||
// prefs.setString('dbProtocol', 'https');
|
||||
|
||||
@@ -53,7 +53,7 @@ class _MoviesScreenState extends State<MoviesScreen> {
|
||||
var list = movies['data'];
|
||||
|
||||
List<Movie> _movies =
|
||||
await list.map<Movie>((json) => Movie.fromJson(json)).toList();
|
||||
await list.map<Movie>((json) => Movie.fromJson(json)).toList();
|
||||
movieDataSource = MovieDataSource(_movies);
|
||||
return _movies;
|
||||
}
|
||||
@@ -121,24 +121,24 @@ class _MoviesScreenState extends State<MoviesScreen> {
|
||||
builder: (context, data) {
|
||||
return data.hasData
|
||||
? SfDataGridTheme(
|
||||
data: const SfDataGridThemeData(
|
||||
headerColor: Color(0xff009889),
|
||||
),
|
||||
child: SfDataGrid(
|
||||
source: movieDataSource,
|
||||
selectionMode: SelectionMode.single,
|
||||
navigationMode: GridNavigationMode.row,
|
||||
columns: _columns,
|
||||
controller: _dataGridController,
|
||||
columnWidthMode: ColumnWidthMode.fill,
|
||||
),
|
||||
)
|
||||
data: const SfDataGridThemeData(
|
||||
headerColor: Color(0xff009889),
|
||||
),
|
||||
child: SfDataGrid(
|
||||
source: movieDataSource,
|
||||
selectionMode: SelectionMode.single,
|
||||
navigationMode: GridNavigationMode.row,
|
||||
columns: _columns,
|
||||
controller: _dataGridController,
|
||||
columnWidthMode: ColumnWidthMode.fill,
|
||||
),
|
||||
)
|
||||
: const Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
value: 0.8,
|
||||
),
|
||||
);
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
value: 0.8,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -154,17 +154,17 @@ class MovieDataSource extends DataGridSource {
|
||||
void buildDataGridRow() {
|
||||
_movieDataGridRows = movies
|
||||
.map<DataGridRow>((e) => DataGridRow(cells: [
|
||||
DataGridCell<int>(columnName: 'movieID', value: e.movieID),
|
||||
DataGridCell<int>(columnName: 'state', value: e.state),
|
||||
DataGridCell<String>(
|
||||
columnName: 'movieTitle', value: e.movieTitle),
|
||||
DataGridCell<String>(
|
||||
columnName: 'releaseDate',
|
||||
value: DateFormat('yyyy-MM-dd').format(e.releaseDate)),
|
||||
DataGridCell<String>(
|
||||
columnName: 'resolution', value: e.resolution),
|
||||
DataGridCell<String>(columnName: 'overview', value: e.overview),
|
||||
]))
|
||||
DataGridCell<int>(columnName: 'movieID', value: e.movieID),
|
||||
DataGridCell<int>(columnName: 'state', value: e.state),
|
||||
DataGridCell<String>(
|
||||
columnName: 'movieTitle', value: e.movieTitle),
|
||||
DataGridCell<String>(
|
||||
columnName: 'releaseDate',
|
||||
value: DateFormat('yyyy-MM-dd').format(e.releaseDate)),
|
||||
DataGridCell<String>(
|
||||
columnName: 'resolution', value: e.resolution),
|
||||
DataGridCell<String>(columnName: 'overview', value: e.overview),
|
||||
]))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@@ -179,32 +179,32 @@ class MovieDataSource extends DataGridSource {
|
||||
DataGridRowAdapter buildRow(DataGridRow row) {
|
||||
return DataGridRowAdapter(
|
||||
cells: row.getCells().map<Widget>((e) {
|
||||
Color colorBG = Colors.white;
|
||||
Color colorFG = Colors.black;
|
||||
Color colorBG = Colors.white;
|
||||
Color colorFG = Colors.black;
|
||||
|
||||
if (e.columnName == 'movieTitle') {
|
||||
int state = row.getCells().toList()[1].value;
|
||||
if (e.columnName == 'movieTitle') {
|
||||
int state = row.getCells().toList()[1].value;
|
||||
|
||||
if (state == 1) {
|
||||
colorBG = StateColor.init;
|
||||
} else if (state == 2) {
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
}
|
||||
if (state == 1) {
|
||||
colorBG = StateColor.init;
|
||||
} else if (state == 2) {
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
}
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
color: colorBG,
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(color: colorFG),
|
||||
),
|
||||
);
|
||||
}).toList());
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
color: colorBG,
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(color: colorFG),
|
||||
),
|
||||
);
|
||||
}).toList());
|
||||
}
|
||||
|
||||
void updateDataGrid() {
|
||||
@@ -1,8 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tvshowsScreen.dart';
|
||||
import 'package:multimedia/widgets/moviesScreen.dart';
|
||||
|
||||
import 'package:multimedia/widgets/tvshows/listScreen.dart';
|
||||
import 'package:multimedia/widgets/movies/listScreen.dart';
|
||||
|
||||
class TabsScreen extends StatefulWidget {
|
||||
const TabsScreen({super.key});
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsCompaniesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsCountriesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsCrewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsCastBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsGenreBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsOverviewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsSeasons.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsSettingsBox.dart';
|
||||
import 'package:transparent_image/transparent_image.dart';
|
||||
|
||||
import '../data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsScreen extends StatelessWidget {
|
||||
TVShowDetailsScreen({
|
||||
super.key,
|
||||
required this.tvShow,
|
||||
});
|
||||
|
||||
final TVShow tvShow;
|
||||
String firstAiredYear = '?';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String url = 'http://image.tmdb.org/t/p/original${tvShow.backdropPath}';
|
||||
|
||||
firstAiredYear = tvShow.firstAired.toString().substring(0, 4);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("${tvShow.seriesName} ($firstAiredYear)"),
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(url),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: TVShowDetailsOverviewBox(
|
||||
overview: tvShow.overview,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TVShowDetailsCastBox(
|
||||
cast: tvShow.cast,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCrewBox(
|
||||
crew: tvShow.crew,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsGenreBox(
|
||||
genre: tvShow.genre,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCompaniesBox(
|
||||
companies: tvShow.productionCompanies,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCountriesBox(
|
||||
countries: tvShow.originCountries,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: TVShowDetailsSettingsBox(
|
||||
downloadLink: tvShow.download,
|
||||
localPath: tvShow.localPath,
|
||||
resolution: tvShow.resolution,
|
||||
cliffhanger: tvShow.cliffhanger,
|
||||
),
|
||||
),
|
||||
TVShowDetailsSeasons(
|
||||
seasonStatus: tvShow.seasonStatus,
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
import '../data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsSeasonBox extends StatelessWidget {
|
||||
TVShowDetailsSeasonBox({super.key, required this.season});
|
||||
|
||||
Season season;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Season ${season.seasonNumber}',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 10),
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
'aaa',
|
||||
style: const TextStyle(fontSize: 14.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:multimedia/widgets/tvshowDetailsSeasonBox.dart';
|
||||
|
||||
import '../constants.dart';
|
||||
import '../data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsSeasons extends StatefulWidget {
|
||||
TVShowDetailsSeasons({
|
||||
super.key,
|
||||
required this.seasonStatus,
|
||||
});
|
||||
|
||||
List<Season> seasonStatus;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSeasons> createState() => _TVShowDetailsSeasonsState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSeasonsState extends State<TVShowDetailsSeasons> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
TVShowDetailsSeasonBox(
|
||||
season: widget.seasonStatus[0],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,210 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsSettingsBox extends StatefulWidget {
|
||||
TVShowDetailsSettingsBox({
|
||||
super.key,
|
||||
required this.downloadLink,
|
||||
required this.localPath,
|
||||
required this.resolution,
|
||||
required this.cliffhanger,
|
||||
});
|
||||
|
||||
String downloadLink;
|
||||
String localPath;
|
||||
String resolution;
|
||||
int cliffhanger;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSettingsBox> createState() =>
|
||||
_TVShowDetailsSettingsBoxState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSettingsBoxState extends State<TVShowDetailsSettingsBox> {
|
||||
var resolutions = [
|
||||
'360p',
|
||||
'480i',
|
||||
'480p',
|
||||
'576i',
|
||||
'576p',
|
||||
'720i',
|
||||
'720p',
|
||||
'1080i',
|
||||
'1080p',
|
||||
'1440i',
|
||||
'1440p',
|
||||
'2160p',
|
||||
];
|
||||
|
||||
var _curResolution = '';
|
||||
var _curCliffhanger = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_curResolution = widget.resolution;
|
||||
_curCliffhanger = widget.cliffhanger;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Settings',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 10,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Download Link',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Download Link',
|
||||
),
|
||||
initialValue: widget.downloadLink,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 10,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Local Path',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Local Path',
|
||||
),
|
||||
initialValue: widget.localPath,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Resolution',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Resolution',
|
||||
),
|
||||
dropdownColor: const Color.fromARGB(255, 127, 127, 127),
|
||||
value: _curResolution,
|
||||
items: resolutions.map((String res) {
|
||||
return DropdownMenuItem(value: res, child: Text(res));
|
||||
}).toList(),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
_curResolution = newValue!;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Cliffhanger',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: (_curCliffhanger == 1),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
_curCliffhanger = value == true ? 1 : 0;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -34,20 +34,18 @@ class TVShowDetailsCastBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Cast',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Cast',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
+12
-14
@@ -34,20 +34,18 @@ class TVShowDetailsCompaniesBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Production Companies',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Production Companies',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
+12
-14
@@ -34,20 +34,18 @@ class TVShowDetailsCountriesBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Production Countries',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Production Countries',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -34,20 +34,18 @@ class TVShowDetailsCrewBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Crew',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Crew',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -0,0 +1,135 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/companiesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/countriesBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/crewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/castBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/genreBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/overviewBox.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/seasons.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBox.dart';
|
||||
import 'package:transparent_image/transparent_image.dart';
|
||||
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsScreen extends StatelessWidget {
|
||||
TVShowDetailsScreen({
|
||||
super.key,
|
||||
required this.tvShow,
|
||||
});
|
||||
|
||||
final TVShow tvShow;
|
||||
String firstAiredYear = '?';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String url = 'http://image.tmdb.org/t/p/original${tvShow.backdropPath}';
|
||||
|
||||
firstAiredYear = tvShow.firstAired.toString().substring(0, 4);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("${tvShow.seriesName} ($firstAiredYear)"),
|
||||
),
|
||||
body: Stack(children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(url),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: TVShowDetailsOverviewBox(
|
||||
overview: tvShow.overview,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TVShowDetailsCastBox(
|
||||
cast: tvShow.cast,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCrewBox(
|
||||
crew: tvShow.crew,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsGenreBox(
|
||||
genre: tvShow.genre,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCompaniesBox(
|
||||
companies: tvShow.productionCompanies,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
child: TVShowDetailsCountriesBox(
|
||||
countries: tvShow.originCountries,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: TVShowDetailsSettingsBox(
|
||||
downloadLink: tvShow.download,
|
||||
localPath: tvShow.localPath,
|
||||
resolution: tvShow.resolution,
|
||||
cliffhanger: tvShow.cliffhanger,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: TVShowDetailsSeasons(
|
||||
seasonStatus: tvShow.seasonStatus,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
+12
-14
@@ -34,20 +34,18 @@ class TVShowDetailsGenreBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Genre',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Genre',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
+13
-17
@@ -9,7 +9,6 @@ class TVShowDetailsOverviewBox extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
@@ -33,27 +32,24 @@ class TVShowDetailsOverviewBox extends StatelessWidget {
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Expanded(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Overview',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Overview',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 10, horizontal: 10),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
@@ -0,0 +1,293 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
enum SingingCharacter { init, prog, done }
|
||||
|
||||
class TVShowDetailsSeasonBox extends StatefulWidget {
|
||||
TVShowDetailsSeasonBox({super.key, required this.season});
|
||||
|
||||
Season season;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSeasonBox> createState() => _TVShowDetailsSeasonBoxState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
|
||||
void initClicked() {
|
||||
final exp = RegExp(r'([|][0-9])');
|
||||
|
||||
setState(() {
|
||||
widget.season.state =
|
||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|1");
|
||||
});
|
||||
}
|
||||
|
||||
void progClicked() {
|
||||
final exp = RegExp(r'([|][0-9])');
|
||||
|
||||
setState(() {
|
||||
widget.season.state =
|
||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|2");
|
||||
});
|
||||
}
|
||||
|
||||
void doneClicked() {
|
||||
final exp = RegExp(r'([|][0-9])');
|
||||
|
||||
setState(() {
|
||||
widget.season.state =
|
||||
widget.season.state.replaceAllMapped(exp, (Match m) => "|3");
|
||||
});
|
||||
}
|
||||
|
||||
void setEpisodeState(String episode, int state) {
|
||||
List<String> stateList = widget.season.state.split(',');
|
||||
|
||||
for (var x = 0; x < stateList.length; x++) {
|
||||
if (stateList[x].split('|')[0] == episode) {
|
||||
stateList[x] = '${stateList[x].split('|')[0]}|$state';
|
||||
break;
|
||||
}
|
||||
}
|
||||
widget.season.state = stateList.join(',');
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> stateList = widget.season.state.split(',');
|
||||
int maxEpisode = 0;
|
||||
Map stateListMap = {};
|
||||
|
||||
for (var x = 0; x < stateList.length; x++) {
|
||||
List<String> tmp = stateList[x].split('|');
|
||||
stateListMap[tmp[0]] = tmp[1];
|
||||
|
||||
int episode = int.parse(tmp[0]);
|
||||
if (episode > maxEpisode) {
|
||||
maxEpisode = episode;
|
||||
}
|
||||
}
|
||||
|
||||
String stateString = "";
|
||||
|
||||
for (int x = 0; x < maxEpisode; x++) {
|
||||
String s = '0';
|
||||
int key = x + 1;
|
||||
|
||||
if (stateListMap.containsKey('$key')) {
|
||||
s = stateListMap['$key'];
|
||||
}
|
||||
|
||||
stateString = stateString + s;
|
||||
}
|
||||
|
||||
Map<int, TableColumnWidth> colWidths = {};
|
||||
|
||||
for (int i = 0; i <= maxEpisode; i++) {
|
||||
colWidths.addEntries({i: IntrinsicColumnWidth()}.entries);
|
||||
}
|
||||
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Season ${widget.season.seasonNumber}',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||
child: Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child: Table(
|
||||
columnWidths: colWidths,
|
||||
children: [
|
||||
TableRow(children: [
|
||||
const TableCell(
|
||||
child: Center(
|
||||
child: Text(''),
|
||||
),
|
||||
),
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Center(
|
||||
child: Text(s.split('|')[0].toString()),
|
||||
),
|
||||
),
|
||||
const TableCell(
|
||||
child: Text(''),
|
||||
),
|
||||
]),
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 2,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(17)),
|
||||
child: ElevatedButton(
|
||||
onPressed: initClicked,
|
||||
child: Text(
|
||||
'init',
|
||||
style: TextStyle(color: BoxColor.titleColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: s.split('|')[1] == '1',
|
||||
onChanged: (bool? value) {
|
||||
if (value == true) {
|
||||
setState(() {
|
||||
setEpisodeState(s.split('|')[0], 1);
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const TableCell(
|
||||
child: Text(''),
|
||||
),
|
||||
]),
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 2,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(17)),
|
||||
child: ElevatedButton(
|
||||
onPressed: progClicked,
|
||||
child: Text(
|
||||
'prog',
|
||||
style: TextStyle(color: BoxColor.titleColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: s.split('|')[1] == '2',
|
||||
onChanged: (bool? value) {
|
||||
if (value == true) {
|
||||
setState(() {
|
||||
setEpisodeState(s.split('|')[0], 2);
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const TableCell(
|
||||
child: Text(''),
|
||||
),
|
||||
]),
|
||||
TableRow(children: [
|
||||
TableCell(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 2,
|
||||
horizontal: 2,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(17)),
|
||||
child: ElevatedButton(
|
||||
onPressed: doneClicked,
|
||||
child: Text(
|
||||
'done',
|
||||
style: TextStyle(color: BoxColor.titleColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
for (var s in stateList)
|
||||
TableCell(
|
||||
child: Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => const BorderSide(
|
||||
width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: s.split('|')[1] == '3',
|
||||
onChanged: (bool? value) {
|
||||
if (value == true) {
|
||||
setState(() {
|
||||
setEpisodeState(s.split('|')[0], 3);
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
const TableCell(
|
||||
child: Text(''),
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/seasonBox.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
class TVShowDetailsSeasons extends StatefulWidget {
|
||||
TVShowDetailsSeasons({
|
||||
super.key,
|
||||
required this.seasonStatus,
|
||||
});
|
||||
|
||||
List<Season> seasonStatus;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSeasons> createState() => _TVShowDetailsSeasonsState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSeasonsState extends State<TVShowDetailsSeasons> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
for (var s in widget.seasonStatus)
|
||||
Column(
|
||||
children: [
|
||||
TVShowDetailsSeasonBox(
|
||||
season: s,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxDownloadLink.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxLocalPath.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxResolution.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/settingsBoxCliffhanger.dart';
|
||||
|
||||
class TVShowDetailsSettingsBox extends StatelessWidget {
|
||||
const TVShowDetailsSettingsBox({
|
||||
super.key,
|
||||
required this.downloadLink,
|
||||
required this.localPath,
|
||||
required this.resolution,
|
||||
required this.cliffhanger,
|
||||
});
|
||||
|
||||
final String downloadLink;
|
||||
final String localPath;
|
||||
final String resolution;
|
||||
final int cliffhanger;
|
||||
|
||||
List<Widget> generateInputs(BuildContext context) {
|
||||
// double width = MediaQuery.of(context).size.width;
|
||||
|
||||
return [
|
||||
TVShowDetailsSettingsBoxDownloadLink(
|
||||
downloadLink: downloadLink,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
TVShowDetailsSettingsBoxLocalPath(
|
||||
localPath: localPath,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
TVShowDetailsSettingsBoxResolution(
|
||||
resolution: resolution,
|
||||
),
|
||||
const SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
TVShowDetailsSettingsBoxCliffhanger(
|
||||
cliffhanger: cliffhanger,
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.backgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 10.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: BoxColor.titleBackgroundColor,
|
||||
borderRadius: const BorderRadius.all(
|
||||
Radius.circular(10.0),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
'Settings',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: generateInputs(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TVShowDetailsSettingsBoxCliffhanger extends StatefulWidget {
|
||||
TVShowDetailsSettingsBoxCliffhanger({
|
||||
super.key,
|
||||
required this.cliffhanger,
|
||||
});
|
||||
|
||||
int cliffhanger;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSettingsBoxCliffhanger> createState() =>
|
||||
_TVShowDetailsSettingsBoxCliffhangerState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSettingsBoxCliffhangerState
|
||||
extends State<TVShowDetailsSettingsBoxCliffhanger> {
|
||||
@override
|
||||
void initState() {
|
||||
_curCliffhanger = widget.cliffhanger;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
var _curCliffhanger = 0;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
flex: 1,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Cliffhanger',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Checkbox(
|
||||
side: MaterialStateBorderSide.resolveWith(
|
||||
(states) => BorderSide(width: 1.0, color: Colors.grey),
|
||||
),
|
||||
value: (_curCliffhanger == 1),
|
||||
onChanged: (bool? value) {
|
||||
setState(() {
|
||||
_curCliffhanger = value == true ? 1 : 0;
|
||||
});
|
||||
},
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TVShowDetailsSettingsBoxDownloadLink extends StatelessWidget {
|
||||
const TVShowDetailsSettingsBoxDownloadLink({
|
||||
super.key,
|
||||
required this.downloadLink,
|
||||
});
|
||||
|
||||
final String downloadLink;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
flex: 10,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 5.0,
|
||||
right: 5.0,
|
||||
top: 5.0,
|
||||
bottom: 5.0,
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Download Link',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Download Link',
|
||||
),
|
||||
initialValue: downloadLink,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TVShowDetailsSettingsBoxLocalPath extends StatelessWidget {
|
||||
const TVShowDetailsSettingsBoxLocalPath({
|
||||
super.key,
|
||||
required this.localPath,
|
||||
});
|
||||
|
||||
final String localPath;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
flex: 10,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Local Path',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Local Path',
|
||||
),
|
||||
initialValue: localPath,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class TVShowDetailsSettingsBoxResolution extends StatefulWidget {
|
||||
TVShowDetailsSettingsBoxResolution({
|
||||
super.key,
|
||||
required this.resolution,
|
||||
});
|
||||
|
||||
String resolution;
|
||||
|
||||
@override
|
||||
State<TVShowDetailsSettingsBoxResolution> createState() =>
|
||||
_TVShowDetailsSettingsBoxResolutionState();
|
||||
}
|
||||
|
||||
class _TVShowDetailsSettingsBoxResolutionState
|
||||
extends State<TVShowDetailsSettingsBoxResolution> {
|
||||
var resolutions = [
|
||||
'',
|
||||
'360p',
|
||||
'480i',
|
||||
'480p',
|
||||
'576i',
|
||||
'576p',
|
||||
'720i',
|
||||
'720p',
|
||||
'1080i',
|
||||
'1080p',
|
||||
'1440i',
|
||||
'1440p',
|
||||
'2160p',
|
||||
];
|
||||
|
||||
var _curResolution = '';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
_curResolution = widget.resolution;
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
children: [
|
||||
const Text(
|
||||
'Resolution',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
DropdownButtonFormField(
|
||||
decoration: const InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Resolution',
|
||||
),
|
||||
dropdownColor: const Color.fromARGB(255, 127, 127, 127),
|
||||
value: _curResolution,
|
||||
items: resolutions.map((String res) {
|
||||
return DropdownMenuItem(value: res, child: Text(res));
|
||||
}).toList(),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
_curResolution = newValue!;
|
||||
});
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:multimedia/widgets/tvshowDetailsScreen.dart';
|
||||
import 'package:multimedia/widgets/tvshows/details/detailsScreen.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -70,7 +70,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
}
|
||||
|
||||
List<TVShow> _tvshows =
|
||||
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
||||
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
||||
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
||||
|
||||
List<EpisodeCount> _episodecount = await episodeList
|
||||
@@ -186,7 +186,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
|
||||
void showTVShowDetails(int index) {
|
||||
List<DataGridCell<dynamic>> cells =
|
||||
tvshowDataSource.effectiveRows.elementAt(index).getCells();
|
||||
tvshowDataSource.effectiveRows.elementAt(index).getCells();
|
||||
|
||||
String seriesID = cells[TVShowColumn.seriesID].value.toString();
|
||||
bool found = false;
|
||||
@@ -203,7 +203,8 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (ctx) => TVShowDetailsScreen(tvShow: _tvshowsList[tvShowIndex])));
|
||||
builder: (ctx) =>
|
||||
TVShowDetailsScreen(tvShow: _tvshowsList[tvShowIndex])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,39 +216,42 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
builder: (context, data) {
|
||||
return data.hasData
|
||||
? SfDataGridTheme(
|
||||
data: const SfDataGridThemeData(
|
||||
headerColor: Color(0xff009889),
|
||||
),
|
||||
child: SfDataGrid(
|
||||
source: tvshowDataSource,
|
||||
selectionMode: SelectionMode.single,
|
||||
navigationMode: GridNavigationMode.row,
|
||||
columns: _columns,
|
||||
controller: _dataGridController,
|
||||
columnWidthMode: ColumnWidthMode.auto,
|
||||
columnWidthCalculationRange:
|
||||
ColumnWidthCalculationRange.allRows,
|
||||
onCellDoubleTap: (DataGridCellDoubleTapDetails details) {
|
||||
int index = details.rowColumnIndex.rowIndex - 1;
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
showTVShowDetails(index);
|
||||
},
|
||||
onCellLongPress: (DataGridCellLongPressDetails details) {
|
||||
print(details.rowColumnIndex);
|
||||
},
|
||||
onCellSecondaryTap: (DataGridCellTapDetails details) {
|
||||
print(details.rowColumnIndex);
|
||||
},
|
||||
),
|
||||
)
|
||||
data: const SfDataGridThemeData(
|
||||
headerColor: Color(0xff009889),
|
||||
),
|
||||
child: SfDataGrid(
|
||||
source: tvshowDataSource,
|
||||
selectionMode: SelectionMode.single,
|
||||
navigationMode: GridNavigationMode.row,
|
||||
columns: _columns,
|
||||
controller: _dataGridController,
|
||||
columnWidthMode: ColumnWidthMode.auto,
|
||||
columnWidthCalculationRange:
|
||||
ColumnWidthCalculationRange.allRows,
|
||||
onCellTap: (DataGridCellTapDetails details) {
|
||||
int index = details.rowColumnIndex.rowIndex - 1;
|
||||
if (index < 0) {
|
||||
return;
|
||||
}
|
||||
showTVShowDetails(index);
|
||||
},
|
||||
onCellDoubleTap: (DataGridCellDoubleTapDetails details) {
|
||||
print(details.rowColumnIndex);
|
||||
},
|
||||
onCellLongPress: (DataGridCellLongPressDetails details) {
|
||||
print(details.rowColumnIndex);
|
||||
},
|
||||
onCellSecondaryTap: (DataGridCellTapDetails details) {
|
||||
print(details.rowColumnIndex);
|
||||
},
|
||||
),
|
||||
)
|
||||
: const Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
value: 0.8,
|
||||
),
|
||||
);
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
value: 0.8,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -310,24 +314,24 @@ class TVShowDataSource extends DataGridSource {
|
||||
void buildDataGridRow() {
|
||||
_tvshowDataGridRows = tvshows
|
||||
.map<DataGridRow>((e) => DataGridRow(cells: [
|
||||
DataGridCell<int>(columnName: 'seriesID', value: e.seriesID),
|
||||
DataGridCell<int>(
|
||||
columnName: 'seriesState', value: e.seriesState),
|
||||
DataGridCell<String>(columnName: 'status', value: e.status),
|
||||
DataGridCell<int>(
|
||||
columnName: 'cliffhanger', value: e.cliffhanger),
|
||||
DataGridCell<String>(
|
||||
columnName: 'backdropPath', value: e.backdropPath),
|
||||
DataGridCell<String>(columnName: 'overview', value: e.overview),
|
||||
DataGridCell<String>(
|
||||
columnName: 'seriesName', value: e.seriesName),
|
||||
DataGridCell<String>(
|
||||
columnName: 'firstAired',
|
||||
value: DateFormat('yyyy-MM-dd').format(e.firstAired)),
|
||||
DataGridCell<String>(
|
||||
columnName: 'resolution', value: e.resolution),
|
||||
...setSeasonData(maxSeason, e.seasonStatus),
|
||||
]))
|
||||
DataGridCell<int>(columnName: 'seriesID', value: e.seriesID),
|
||||
DataGridCell<int>(
|
||||
columnName: 'seriesState', value: e.seriesState),
|
||||
DataGridCell<String>(columnName: 'status', value: e.status),
|
||||
DataGridCell<int>(
|
||||
columnName: 'cliffhanger', value: e.cliffhanger),
|
||||
DataGridCell<String>(
|
||||
columnName: 'backdropPath', value: e.backdropPath),
|
||||
DataGridCell<String>(columnName: 'overview', value: e.overview),
|
||||
DataGridCell<String>(
|
||||
columnName: 'seriesName', value: e.seriesName),
|
||||
DataGridCell<String>(
|
||||
columnName: 'firstAired',
|
||||
value: DateFormat('yyyy-MM-dd').format(e.firstAired)),
|
||||
DataGridCell<String>(
|
||||
columnName: 'resolution', value: e.resolution),
|
||||
...setSeasonData(maxSeason, e.seasonStatus),
|
||||
]))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@@ -364,13 +368,13 @@ class TVShowDataSource extends DataGridSource {
|
||||
|
||||
return Row(children: <Widget>[
|
||||
...stateColor.map((col) => Text(
|
||||
'1',
|
||||
style: TextStyle(
|
||||
fontFamily: 'geometric',
|
||||
fontSize: 30,
|
||||
color: col,
|
||||
),
|
||||
)),
|
||||
'1',
|
||||
style: TextStyle(
|
||||
fontFamily: 'geometric',
|
||||
fontSize: 30,
|
||||
color: col,
|
||||
),
|
||||
)),
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -378,72 +382,74 @@ class TVShowDataSource extends DataGridSource {
|
||||
DataGridRowAdapter buildRow(DataGridRow row) {
|
||||
return DataGridRowAdapter(
|
||||
cells: row.getCells().map<Widget>((e) {
|
||||
Color colorBG = Colors.white;
|
||||
Color colorFG = Colors.black;
|
||||
FontWeight fontWeight = FontWeight.normal;
|
||||
FontStyle fontStyle = FontStyle.normal;
|
||||
Color colorBG = Colors.white;
|
||||
Color colorFG = Colors.black;
|
||||
FontWeight fontWeight = FontWeight.normal;
|
||||
FontStyle fontStyle = FontStyle.normal;
|
||||
|
||||
if (e.columnName == 'seriesName') {
|
||||
int seriesState = row.getCells().toList()[TVShowColumn.seriesState].value;
|
||||
String status = row.getCells().toList()[TVShowColumn.state].value;
|
||||
int cliffhanger = row.getCells().toList()[TVShowColumn.cliffhanger].value;
|
||||
if (e.columnName == 'seriesName') {
|
||||
int seriesState =
|
||||
row.getCells().toList()[TVShowColumn.seriesState].value;
|
||||
String status = row.getCells().toList()[TVShowColumn.state].value;
|
||||
int cliffhanger =
|
||||
row.getCells().toList()[TVShowColumn.cliffhanger].value;
|
||||
|
||||
if (seriesState == 1) {
|
||||
colorBG = StateColor.init;
|
||||
} else if (seriesState == 2) {
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
if (seriesState == 1) {
|
||||
colorBG = StateColor.init;
|
||||
} else if (seriesState == 2) {
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
|
||||
if (cliffhanger == 1) {
|
||||
fontStyle = FontStyle.italic;
|
||||
}
|
||||
if (cliffhanger == 1) {
|
||||
fontStyle = FontStyle.italic;
|
||||
}
|
||||
|
||||
if (status == 'In Production' || status == 'Returning Series') {
|
||||
fontWeight = FontWeight.bold;
|
||||
}
|
||||
}
|
||||
if (status == 'In Production' || status == 'Returning Series') {
|
||||
fontWeight = FontWeight.bold;
|
||||
}
|
||||
}
|
||||
|
||||
if (e.columnName.startsWith('season')) {
|
||||
Row row = generateSeasonState(e.value.toString());
|
||||
if (e.columnName.startsWith('season')) {
|
||||
Row row = generateSeasonState(e.value.toString());
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: row,
|
||||
);
|
||||
}
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
child: row,
|
||||
);
|
||||
}
|
||||
|
||||
if (e.columnName.startsWith('seriesName')) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
color: colorBG,
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(
|
||||
color: colorFG,
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: fontStyle,
|
||||
if (e.columnName.startsWith('seriesName')) {
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
color: colorBG,
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(
|
||||
color: colorFG,
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: fontStyle,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: fontStyle,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.centerLeft,
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
e.value.toString(),
|
||||
style: TextStyle(
|
||||
fontWeight: fontWeight,
|
||||
fontStyle: fontStyle,
|
||||
),
|
||||
),
|
||||
);
|
||||
}).toList());
|
||||
);
|
||||
}).toList());
|
||||
}
|
||||
|
||||
void updateDataGrid() {
|
||||
Reference in New Issue
Block a user