movie and tvshow list

This commit is contained in:
2024-04-19 12:03:57 +02:00
parent 5ab3a2a4a2
commit 76d2ffc771
7 changed files with 361 additions and 129 deletions
+222 -49
View File
@@ -20,6 +20,227 @@ class TVShowDetailsScreen extends StatelessWidget {
final TVShow tvShow; final TVShow tvShow;
String firstAiredYear = '?'; String firstAiredYear = '?';
Widget generateLists(BuildContext context) {
double width = MediaQuery.of(context).size.width;
if (width < 750) {
return Table(
children: [
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 10.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCastBox(
cast: tvShow.cast,
),
),
],
),
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCrewBox(
crew: tvShow.crew,
),
),
],
),
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsGenreBox(
genre: tvShow.genre,
),
),
],
),
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCompaniesBox(
companies: tvShow.productionCompanies,
),
),
],
),
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 10.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCountriesBox(
countries: tvShow.originCountries,
),
),
],
),
],
);
}
if (width < 1000) {
return Table(
children: [
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 10.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCastBox(
cast: tvShow.cast,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCrewBox(
crew: tvShow.crew,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsGenreBox(
genre: tvShow.genre,
),
),
],
),
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCompaniesBox(
companies: tvShow.productionCompanies,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 10.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCountriesBox(
countries: tvShow.originCountries,
),
),
const Text(''),
],
),
],
);
}
return Table(
children: [
TableRow(
children: [
Padding(
padding: const EdgeInsets.only(
left: 10.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCastBox(
cast: tvShow.cast,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCrewBox(
crew: tvShow.crew,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsGenreBox(
genre: tvShow.genre,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCompaniesBox(
companies: tvShow.productionCompanies,
),
),
Padding(
padding: const EdgeInsets.only(
left: 5.0,
right: 10.0,
top: 5.0,
bottom: 5.0,
),
child: TVShowDetailsCountriesBox(
countries: tvShow.originCountries,
),
),
],
),
],
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String url = 'http://image.tmdb.org/t/p/original${tvShow.backdropPath}'; String url = 'http://image.tmdb.org/t/p/original${tvShow.backdropPath}';
@@ -52,55 +273,7 @@ class TVShowDetailsScreen extends StatelessWidget {
overview: tvShow.overview, overview: tvShow.overview,
), ),
), ),
Padding( generateLists(context),
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(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 10.0, left: 10.0,
+12 -3
View File
@@ -166,6 +166,9 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
color: BoxColor.titleBackgroundColor, color: BoxColor.titleBackgroundColor,
borderRadius: BorderRadius.circular(17)), borderRadius: BorderRadius.circular(17)),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor:
BoxColor.titleBackgroundColor),
onPressed: initClicked, onPressed: initClicked,
child: Text( child: Text(
'init', 'init',
@@ -179,7 +182,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
TableCell( TableCell(
child: Checkbox( child: Checkbox(
side: MaterialStateBorderSide.resolveWith( side: MaterialStateBorderSide.resolveWith(
(states) => const BorderSide( (states) => const BorderSide(
width: 1.0, color: Colors.grey), width: 1.0, color: Colors.grey),
), ),
value: s.split('|')[1] == '1', value: s.split('|')[1] == '1',
@@ -208,6 +211,9 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
color: BoxColor.titleBackgroundColor, color: BoxColor.titleBackgroundColor,
borderRadius: BorderRadius.circular(17)), borderRadius: BorderRadius.circular(17)),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor:
BoxColor.titleBackgroundColor),
onPressed: progClicked, onPressed: progClicked,
child: Text( child: Text(
'prog', 'prog',
@@ -221,7 +227,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
TableCell( TableCell(
child: Checkbox( child: Checkbox(
side: MaterialStateBorderSide.resolveWith( side: MaterialStateBorderSide.resolveWith(
(states) => const BorderSide( (states) => const BorderSide(
width: 1.0, color: Colors.grey), width: 1.0, color: Colors.grey),
), ),
value: s.split('|')[1] == '2', value: s.split('|')[1] == '2',
@@ -250,6 +256,9 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
color: BoxColor.titleBackgroundColor, color: BoxColor.titleBackgroundColor,
borderRadius: BorderRadius.circular(17)), borderRadius: BorderRadius.circular(17)),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor:
BoxColor.titleBackgroundColor),
onPressed: doneClicked, onPressed: doneClicked,
child: Text( child: Text(
'done', 'done',
@@ -263,7 +272,7 @@ class _TVShowDetailsSeasonBoxState extends State<TVShowDetailsSeasonBox> {
TableCell( TableCell(
child: Checkbox( child: Checkbox(
side: MaterialStateBorderSide.resolveWith( side: MaterialStateBorderSide.resolveWith(
(states) => const BorderSide( (states) => const BorderSide(
width: 1.0, color: Colors.grey), width: 1.0, color: Colors.grey),
), ),
value: s.split('|')[1] == '3', value: s.split('|')[1] == '3',
+65 -27
View File
@@ -20,32 +20,66 @@ class TVShowDetailsSettingsBox extends StatelessWidget {
final String resolution; final String resolution;
final int cliffhanger; final int cliffhanger;
List<Widget> generateInputs(BuildContext context) { Widget generateInputs(BuildContext context) {
// double width = MediaQuery.of(context).size.width; double width = MediaQuery.of(context).size.width;
return [ if (width < 1000) {
TVShowDetailsSettingsBoxDownloadLink( return Table(
downloadLink: downloadLink, columnWidths: const {
), 0: IntrinsicColumnWidth(),
const SizedBox( 1: IntrinsicColumnWidth(),
width: 5, },
), children: [
TVShowDetailsSettingsBoxLocalPath( TableRow(
localPath: localPath, children: [
), TVShowDetailsSettingsBoxDownloadLink(
const SizedBox( downloadLink: downloadLink,
width: 5, ),
), TVShowDetailsSettingsBoxResolution(
TVShowDetailsSettingsBoxResolution( resolution: resolution,
resolution: resolution, ),
), ],
const SizedBox( ),
width: 5, TableRow(
), children: [
TVShowDetailsSettingsBoxCliffhanger( TVShowDetailsSettingsBoxLocalPath(
cliffhanger: cliffhanger, localPath: localPath,
), ),
]; TVShowDetailsSettingsBoxCliffhanger(
cliffhanger: cliffhanger,
),
],
),
],
);
}
return Table(
columnWidths: const {
0: IntrinsicColumnWidth(),
1: IntrinsicColumnWidth(),
2: IntrinsicColumnWidth(),
3: IntrinsicColumnWidth(),
},
children: [
TableRow(
children: [
TVShowDetailsSettingsBoxDownloadLink(
downloadLink: downloadLink,
),
TVShowDetailsSettingsBoxLocalPath(
localPath: localPath,
),
TVShowDetailsSettingsBoxResolution(
resolution: resolution,
),
TVShowDetailsSettingsBoxCliffhanger(
cliffhanger: cliffhanger,
),
],
),
],
);
} }
@override @override
@@ -88,8 +122,12 @@ class TVShowDetailsSettingsBox extends StatelessWidget {
), ),
), ),
), ),
Row( Container(
children: generateInputs(context), alignment: Alignment.centerLeft,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: generateInputs(context),
),
), ),
], ],
), ),
@@ -25,8 +25,13 @@ class _TVShowDetailsSettingsBoxCliffhangerState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Padding(
flex: 1, padding: const EdgeInsets.only(
left: 5.0,
right: 5.0,
top: 5.0,
bottom: 5.0,
),
child: Column( child: Column(
children: [ children: [
const Text( const Text(
@@ -40,7 +45,7 @@ class _TVShowDetailsSettingsBoxCliffhangerState
), ),
Checkbox( Checkbox(
side: MaterialStateBorderSide.resolveWith( side: MaterialStateBorderSide.resolveWith(
(states) => BorderSide(width: 1.0, color: Colors.grey), (states) => BorderSide(width: 1.0, color: Colors.grey),
), ),
value: (_curCliffhanger == 1), value: (_curCliffhanger == 1),
onChanged: (bool? value) { onChanged: (bool? value) {
@@ -10,9 +10,7 @@ class TVShowDetailsSettingsBoxDownloadLink extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Padding(
flex: 10,
child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 5.0, left: 5.0,
right: 5.0, right: 5.0,
@@ -36,7 +34,6 @@ class TVShowDetailsSettingsBoxDownloadLink extends StatelessWidget {
), ),
], ],
), ),
),
); );
} }
} }
@@ -10,25 +10,30 @@ class TVShowDetailsSettingsBoxLocalPath extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Padding(
flex: 10, padding: const EdgeInsets.only(
child: Column( left: 5.0,
children: [ right: 5.0,
const Text( top: 5.0,
'Local Path', bottom: 5.0,
style: TextStyle( ),
fontWeight: FontWeight.bold, child: Column(
children: [
const Text(
'Local Path',
style: TextStyle(
fontWeight: FontWeight.bold,
),
), ),
), TextFormField(
TextFormField( decoration: const InputDecoration(
decoration: const InputDecoration( border: OutlineInputBorder(),
border: OutlineInputBorder(), labelText: 'Local Path',
labelText: 'Local Path', ),
initialValue: localPath,
), ),
initialValue: localPath, ],
), ),
],
),
); );
} }
} }
@@ -41,34 +41,39 @@ class _TVShowDetailsSettingsBoxResolutionState
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Expanded( return Padding(
flex: 2, padding: const EdgeInsets.only(
child: Column( left: 5.0,
children: [ right: 5.0,
const Text( top: 5.0,
'Resolution', bottom: 5.0,
style: TextStyle( ),
fontWeight: FontWeight.bold, child: Column(
children: [
const Text(
'Resolution',
style: TextStyle(
fontWeight: FontWeight.bold,
),
), ),
), DropdownButtonFormField(
DropdownButtonFormField( decoration: const InputDecoration(
decoration: const InputDecoration( border: OutlineInputBorder(),
border: OutlineInputBorder(), labelText: 'Resolution',
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!;
});
},
), ),
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!;
});
},
),
],
),
); );
} }
} }