movie and tvshow list
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StateColor {
|
||||
static const Color none = Colors.black;
|
||||
static const Color init = Color.fromARGB(255, 192, 192, 192);
|
||||
static const Color prog = Color.fromARGB(255, 0, 0, 192);
|
||||
static const Color done = Color.fromARGB(255, 0, 192, 0);
|
||||
}
|
||||
|
||||
class TVShowColumn {
|
||||
static int seriesID = 0;
|
||||
static int seriesState = 1;
|
||||
static int state = 2;
|
||||
static int cliffhanger = 3;
|
||||
static int backdropPath = 4;
|
||||
static int overview = 5;
|
||||
static int title = 6;
|
||||
static int firstAired = 7;
|
||||
}
|
||||
|
||||
class BoxColor {
|
||||
static Color backgroundColor = const Color.fromARGB(191, 255, 255, 255);
|
||||
static Color titleColor = Colors.white;
|
||||
static Color titleBackgroundColor = Colors.blue;
|
||||
}
|
||||
@@ -42,22 +42,49 @@ class Season {
|
||||
class TVShow {
|
||||
int seriesID;
|
||||
String seriesName;
|
||||
String overview;
|
||||
String backdropPath;
|
||||
DateTime firstAired;
|
||||
int seriesState;
|
||||
String resolution;
|
||||
int cliffhanger;
|
||||
String status;
|
||||
String languages;
|
||||
String networks;
|
||||
String originCountries;
|
||||
String productionCompanies;
|
||||
double voteAverage;
|
||||
int voteCount;
|
||||
String cast;
|
||||
String crew;
|
||||
String genre;
|
||||
String download;
|
||||
String localPath;
|
||||
|
||||
List<Season> seasonStatus;
|
||||
|
||||
TVShow({
|
||||
required this.seriesID,
|
||||
required this.seriesName,
|
||||
required this.overview,
|
||||
required this.backdropPath,
|
||||
required this.firstAired,
|
||||
required this.seriesState,
|
||||
required this.resolution,
|
||||
required this.cliffhanger,
|
||||
required this.status,
|
||||
required this.seasonStatus,
|
||||
required this.languages,
|
||||
required this.networks,
|
||||
required this.originCountries,
|
||||
required this.productionCompanies,
|
||||
required this.voteAverage,
|
||||
required this.voteCount,
|
||||
required this.cast,
|
||||
required this.crew,
|
||||
required this.genre,
|
||||
required this.download,
|
||||
required this.localPath,
|
||||
});
|
||||
|
||||
factory TVShow.fromJson(Map<String, dynamic> json) {
|
||||
@@ -89,6 +116,8 @@ class TVShow {
|
||||
return TVShow(
|
||||
seriesID: int.parse(json['seriesID']),
|
||||
seriesName: json['seriesName'],
|
||||
overview: json['overview'],
|
||||
backdropPath: json['backdropPath'],
|
||||
firstAired: DateTime.parse(json['firstAired']),
|
||||
seriesState: seriesState,
|
||||
resolution: json['resolution'],
|
||||
@@ -96,6 +125,17 @@ class TVShow {
|
||||
cliffhanger: int.parse(json['cliffhanger']),
|
||||
seasonStatus:
|
||||
json['seasons'].map<Season>((json) => Season.fromJson(json)).toList(),
|
||||
languages: json['languages'],
|
||||
networks: json['networks'],
|
||||
originCountries: json['originCountries'],
|
||||
productionCompanies: json['productionCompanies'],
|
||||
voteAverage: double.parse(json['voteAverage']),
|
||||
voteCount: int.parse(json['voteCount']),
|
||||
cast: json['cast'],
|
||||
crew: json['crew'],
|
||||
genre: json['genre'],
|
||||
download: json['download'],
|
||||
localPath: json['localPath'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
+8
-8
@@ -24,17 +24,17 @@ void main() async {
|
||||
String? dbPassword = prefs.getString('dbPassword');
|
||||
|
||||
// if (dbProtocol == null) {
|
||||
// prefs.setString('dbProtocol', 'http');
|
||||
prefs.setString('dbProtocol', 'http');
|
||||
// }
|
||||
// if (dbHost == null) {
|
||||
// prefs.setString('dbHost', '192.168.0.70');
|
||||
prefs.setString('dbHost', '192.168.0.70');
|
||||
// }
|
||||
// if (dbProtocol == null) {
|
||||
// prefs.setString('dbProtocol', 'https');
|
||||
// }
|
||||
// if (dbHost == null) {
|
||||
// prefs.setString('dbHost', 'api.windesign.at');
|
||||
// }
|
||||
if (dbProtocol == null) {
|
||||
prefs.setString('dbProtocol', 'https');
|
||||
}
|
||||
if (dbHost == null) {
|
||||
prefs.setString('dbHost', 'api.windesign.at');
|
||||
}
|
||||
if (dbPath == null) {
|
||||
prefs.setString('dbPath', '/multimedia.php');
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@ import 'package:syncfusion_flutter_core/theme.dart';
|
||||
|
||||
import 'package:multimedia/data/movies.dart';
|
||||
|
||||
Color _kColorInit = const Color.fromARGB(255, 192, 192, 192);
|
||||
Color _kColorProg = const Color.fromARGB(255, 0, 0, 192);
|
||||
Color _kColorDone = const Color.fromARGB(255, 0, 192, 0);
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class MoviesScreen extends StatefulWidget {
|
||||
const MoviesScreen({
|
||||
@@ -188,12 +186,12 @@ class MovieDataSource extends DataGridSource {
|
||||
int state = row.getCells().toList()[1].value;
|
||||
|
||||
if (state == 1) {
|
||||
colorBG = _kColorInit;
|
||||
colorBG = StateColor.init;
|
||||
} else if (state == 2) {
|
||||
colorBG = _kColorProg;
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = _kColorDone;
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsCastBox extends StatelessWidget {
|
||||
const TVShowDetailsCastBox({super.key, required this.cast});
|
||||
|
||||
final String cast;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> castList = cast.split('|');
|
||||
|
||||
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(
|
||||
'Cast',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Table(children: const [
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Actor',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Role',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
],),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 0.0,
|
||||
bottom: 10.0,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
children: [
|
||||
Table(
|
||||
children: [
|
||||
for (var c in castList)
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(c.split(',').first),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(c.split(',').last),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsCompaniesBox extends StatelessWidget {
|
||||
const TVShowDetailsCompaniesBox({super.key, required this.companies});
|
||||
|
||||
final String companies;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> companiesList = companies.split(',');
|
||||
|
||||
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(
|
||||
'Production Companies',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Table(children: const [
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Name',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 0.0,
|
||||
bottom: 10.0,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
children: [
|
||||
Table(
|
||||
children: [
|
||||
for (var c in companiesList)
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(c),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsCountriesBox extends StatelessWidget {
|
||||
const TVShowDetailsCountriesBox({super.key, required this.countries});
|
||||
|
||||
final String countries;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> countriesList = countries.split(',');
|
||||
|
||||
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(
|
||||
'Production Countries',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Table(children: const [
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Name',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 0.0,
|
||||
bottom: 10.0,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
children: [
|
||||
Table(
|
||||
children: [
|
||||
for (var c in countriesList)
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(c),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsCrewBox extends StatelessWidget {
|
||||
const TVShowDetailsCrewBox({super.key, required this.crew});
|
||||
|
||||
final String crew;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> crewList = crew.split('|');
|
||||
|
||||
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(
|
||||
'Crew',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Table(children: const [
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'Name',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Crew',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
],),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 0.0,
|
||||
bottom: 10.0,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
children: [
|
||||
Table(
|
||||
children: [
|
||||
for (var c in crewList)
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(c.split(',').first),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(c.split(',').last),
|
||||
],
|
||||
),
|
||||
)
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsGenreBox extends StatelessWidget {
|
||||
const TVShowDetailsGenreBox({super.key, required this.genre});
|
||||
|
||||
final String genre;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<String> genreList = genre.split(',');
|
||||
|
||||
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(
|
||||
'Genre',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: BoxColor.titleColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Table(children: const [
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Name',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 10.0,
|
||||
right: 10.0,
|
||||
top: 0.0,
|
||||
bottom: 10.0,
|
||||
),
|
||||
child: SingleChildScrollView(
|
||||
child: SizedBox(
|
||||
height: 200,
|
||||
child: ListView(
|
||||
children: [
|
||||
Table(
|
||||
children: [
|
||||
for (var g in genreList)
|
||||
TableRow(children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 1, horizontal: 4),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(g),
|
||||
],
|
||||
),
|
||||
),
|
||||
]),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowDetailsOverviewBox extends StatelessWidget {
|
||||
const TVShowDetailsOverviewBox({super.key, required this.overview});
|
||||
|
||||
final String overview;
|
||||
|
||||
@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(
|
||||
'Overview',
|
||||
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(
|
||||
overview,
|
||||
style: const TextStyle(fontSize: 14.0),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
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: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,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
]),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'dart:ui' as ui;
|
||||
|
||||
import 'dart:convert';
|
||||
import 'package:multimedia/widgets/tvshowDetailsScreen.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
@@ -12,13 +13,7 @@ import 'package:syncfusion_flutter_core/theme.dart';
|
||||
|
||||
import 'package:multimedia/data/tvshows.dart';
|
||||
|
||||
Color _kColorNone = Colors.black;
|
||||
Color _kColorInit = const Color.fromARGB(255, 192, 192, 192);
|
||||
Color _kColorProg = const Color.fromARGB(255, 0, 0, 192);
|
||||
Color _kColorDone = const Color.fromARGB(255, 0, 192, 0);
|
||||
|
||||
double _kStateWidth = 6;
|
||||
double _kStateHeight = 30;
|
||||
import 'package:multimedia/constants.dart';
|
||||
|
||||
class TVShowsScreen extends StatefulWidget {
|
||||
const TVShowsScreen({
|
||||
@@ -36,6 +31,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
late TVShowDataSource tvshowDataSource;
|
||||
List<GridColumn> _columns = [];
|
||||
late bool initDone = false;
|
||||
late List<TVShow> _tvshowsList;
|
||||
|
||||
Future<List<TVShow>> generateTVShowList() async {
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
@@ -89,6 +85,8 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
|
||||
initDone = true;
|
||||
|
||||
_tvshowsList = _tvshows;
|
||||
|
||||
return _tvshows;
|
||||
}
|
||||
|
||||
@@ -107,13 +105,15 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
List<GridColumn> getColumns() {
|
||||
return <GridColumn>[
|
||||
GridColumn(
|
||||
columnName: 'seriesID',
|
||||
visible: false,
|
||||
width: 70,
|
||||
label: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text('seriesID'))),
|
||||
columnName: 'seriesID',
|
||||
visible: false,
|
||||
width: 70,
|
||||
label: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text('seriesID'),
|
||||
),
|
||||
),
|
||||
GridColumn(
|
||||
columnName: 'seriesState',
|
||||
visible: false,
|
||||
@@ -138,6 +138,22 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text('cliffhanger'))),
|
||||
GridColumn(
|
||||
columnName: 'backdropPath',
|
||||
visible: false,
|
||||
width: 70,
|
||||
label: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text('backdropPath'))),
|
||||
GridColumn(
|
||||
columnName: 'overview',
|
||||
visible: false,
|
||||
width: 70,
|
||||
label: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: const Text('overview'))),
|
||||
GridColumn(
|
||||
columnName: 'seriesName',
|
||||
// columnWidthMode: ColumnWidthMode.auto,
|
||||
@@ -168,6 +184,29 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
_columns = getColumns();
|
||||
}
|
||||
|
||||
void showTVShowDetails(int index) {
|
||||
List<DataGridCell<dynamic>> cells =
|
||||
tvshowDataSource.effectiveRows.elementAt(index).getCells();
|
||||
|
||||
String seriesID = cells[TVShowColumn.seriesID].value.toString();
|
||||
bool found = false;
|
||||
int tvShowIndex;
|
||||
|
||||
for (tvShowIndex = 0; tvShowIndex < _tvshowsList.length; tvShowIndex++) {
|
||||
if (_tvshowsList[tvShowIndex].seriesID == int.parse(seriesID)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (ctx) => TVShowDetailsScreen(tvShow: _tvshowsList[tvShowIndex])));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@@ -186,7 +225,21 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||
columns: _columns,
|
||||
controller: _dataGridController,
|
||||
columnWidthMode: ColumnWidthMode.auto,
|
||||
columnWidthCalculationRange: ColumnWidthCalculationRange.allRows,
|
||||
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);
|
||||
},
|
||||
),
|
||||
)
|
||||
: const Center(
|
||||
@@ -263,6 +316,9 @@ class TVShowDataSource extends DataGridSource {
|
||||
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>(
|
||||
@@ -283,19 +339,8 @@ class TVShowDataSource extends DataGridSource {
|
||||
@override
|
||||
List<DataGridRow> get rows => _tvshowDataGridRows;
|
||||
|
||||
void _drawEpisodeState(Canvas c, Paint p, double x, Color color) {
|
||||
Offset p1 = Offset(x + _kStateWidth, 1);
|
||||
Offset p2 = Offset(x + _kStateWidth, _kStateHeight - 1);
|
||||
Rect rect = Rect.fromLTRB(x, 0, x + _kStateWidth, _kStateHeight);
|
||||
p.style = PaintingStyle.fill;
|
||||
p.color = color;
|
||||
c.drawRect(rect, p);
|
||||
p.color = Colors.black;
|
||||
c.drawLine(p1, p2, p);
|
||||
}
|
||||
|
||||
Row generateSeasonState(String state) {
|
||||
if (state.length == 0) {
|
||||
if (state.isEmpty) {
|
||||
return const Row(
|
||||
children: [Text('')],
|
||||
);
|
||||
@@ -304,14 +349,14 @@ class TVShowDataSource extends DataGridSource {
|
||||
List<Color> stateColor = [];
|
||||
|
||||
for (int x = 0; x < state.length; x++) {
|
||||
Color c = _kColorNone;
|
||||
Color c = StateColor.none;
|
||||
|
||||
if (state[x] == '1') {
|
||||
c = _kColorInit;
|
||||
c = StateColor.init;
|
||||
} else if (state[x] == '2') {
|
||||
c = _kColorProg;
|
||||
c = StateColor.prog;
|
||||
} else if (state[x] == '3') {
|
||||
c = _kColorDone;
|
||||
c = StateColor.done;
|
||||
}
|
||||
|
||||
stateColor.add(c);
|
||||
@@ -339,17 +384,17 @@ class TVShowDataSource extends DataGridSource {
|
||||
FontStyle fontStyle = FontStyle.normal;
|
||||
|
||||
if (e.columnName == 'seriesName') {
|
||||
int seriesState = row.getCells().toList()[1].value;
|
||||
String status = row.getCells().toList()[2].value;
|
||||
int cliffhanger = row.getCells().toList()[3].value;
|
||||
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 = _kColorInit;
|
||||
colorBG = StateColor.init;
|
||||
} else if (seriesState == 2) {
|
||||
colorBG = _kColorProg;
|
||||
colorBG = StateColor.prog;
|
||||
colorFG = Colors.white;
|
||||
} else {
|
||||
colorBG = _kColorDone;
|
||||
colorBG = StateColor.done;
|
||||
}
|
||||
|
||||
if (cliffhanger == 1) {
|
||||
@@ -366,19 +411,33 @@ class TVShowDataSource extends DataGridSource {
|
||||
|
||||
return Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
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,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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,
|
||||
),
|
||||
|
||||
+18
-10
@@ -204,18 +204,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider
|
||||
sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b
|
||||
sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
version: "2.1.3"
|
||||
path_provider_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path_provider_android
|
||||
sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668"
|
||||
sha256: "51f0d2c554cfbc9d6a312ab35152fc77e2f0b758ce9f1a444a3a1e5b8f3c6b7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.2.3"
|
||||
path_provider_foundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -268,10 +268,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: shared_preferences
|
||||
sha256: "81429e4481e1ccfb51ede496e916348668fd0921627779233bd24cc3ff6abd02"
|
||||
sha256: d3bbe5553a986e83980916ded2f0b435ef2e1893dfaa29d5a7a790d0eca12180
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.2.3"
|
||||
shared_preferences_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -361,18 +361,18 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_core
|
||||
sha256: "9fae07d8d1f1f66c61ad40cce8f85c02b8a3506ff0c3eae8ace0fd1d504b1ea5"
|
||||
sha256: "159b125f55d95534c0c39a5efd644f50a310821191946e15eac50a49032fb42c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "25.1.38"
|
||||
version: "25.1.39"
|
||||
syncfusion_flutter_datagrid:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: syncfusion_flutter_datagrid
|
||||
sha256: "261587a0a673c5a38f46a48b1279ce24755c08645115021efc439483b583a2af"
|
||||
sha256: "5b31219c6acf4f65d71955476966288c03d5c8ea9c2842d938860c683181360f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "25.1.38"
|
||||
version: "25.1.39"
|
||||
term_glyph:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -389,6 +389,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
transparent_image:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: transparent_image
|
||||
sha256: e8991d955a2094e197ca24c645efec2faf4285772a4746126ca12875e54ca02f
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -41,6 +41,7 @@ dependencies:
|
||||
syncfusion_flutter_core: ^25.1.37
|
||||
google_fonts: ^6.2.1
|
||||
shared_preferences: ^2.2.2
|
||||
transparent_image: ^2.0.1
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
|
||||
Reference in New Issue
Block a user