|
|
|
|
@ -50,44 +50,50 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
final response = await http.get(url);
|
|
|
|
|
bool? error;
|
|
|
|
|
String? errorMessage;
|
|
|
|
|
String? mSeason;
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> tvshows = json.decode(response.body);
|
|
|
|
|
error = tvshows['error'];
|
|
|
|
|
errorMessage = tvshows['errmsg'];
|
|
|
|
|
mSeason = tvshows['maxSeason'];
|
|
|
|
|
|
|
|
|
|
var tvshowList = tvshows['tvshows'];
|
|
|
|
|
var episodeList = tvshows['episodeCount'];
|
|
|
|
|
|
|
|
|
|
if (mSeason != null) {
|
|
|
|
|
if (int.tryParse(mSeason!) != null) {
|
|
|
|
|
maxSeason = int.parse(mSeason);
|
|
|
|
|
try {
|
|
|
|
|
final response = await http.get(url);
|
|
|
|
|
bool? error;
|
|
|
|
|
String? errorMessage;
|
|
|
|
|
String? mSeason;
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> tvshows = json.decode(response.body);
|
|
|
|
|
error = tvshows['error'];
|
|
|
|
|
errorMessage = tvshows['errmsg'];
|
|
|
|
|
mSeason = tvshows['maxSeason'];
|
|
|
|
|
|
|
|
|
|
var tvshowList = tvshows['tvshows'];
|
|
|
|
|
var episodeList = tvshows['episodeCount'];
|
|
|
|
|
|
|
|
|
|
if (mSeason != null) {
|
|
|
|
|
if (int.tryParse(mSeason!) != null) {
|
|
|
|
|
maxSeason = int.parse(mSeason);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<TVShow> _tvshows =
|
|
|
|
|
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
|
|
|
|
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
|
|
|
|
List<TVShow> _tvshows =
|
|
|
|
|
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
|
|
|
|
tvshowDataSource = TVShowDataSource(_tvshows, maxSeason);
|
|
|
|
|
|
|
|
|
|
List<EpisodeCount> _episodecount = await episodeList
|
|
|
|
|
.map<EpisodeCount>((json) => EpisodeCount.fromJson(json))
|
|
|
|
|
.toList();
|
|
|
|
|
List<EpisodeCount> _episodecount = await episodeList
|
|
|
|
|
.map<EpisodeCount>((json) => EpisodeCount.fromJson(json))
|
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
episodeCount = _episodecount;
|
|
|
|
|
episodeCount = _episodecount;
|
|
|
|
|
|
|
|
|
|
if (initDone == false) {
|
|
|
|
|
addSeasonColumns(maxSeason);
|
|
|
|
|
}
|
|
|
|
|
if (initDone == false) {
|
|
|
|
|
addSeasonColumns(maxSeason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initDone = true;
|
|
|
|
|
|
|
|
|
|
initDone = true;
|
|
|
|
|
_tvshowsList = _tvshows;
|
|
|
|
|
|
|
|
|
|
_tvshowsList = _tvshows;
|
|
|
|
|
return _tvshows;
|
|
|
|
|
} catch (e) {
|
|
|
|
|
print (e.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return _tvshows;
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void addSeasonColumns(int maxSeason) {
|
|
|
|
|
@ -96,7 +102,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
columnName: 'season$x',
|
|
|
|
|
// columnWidthMode: ColumnWidthMode.auto,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: Text('Season $x'))));
|
|
|
|
|
}
|
|
|
|
|
@ -109,7 +115,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('seriesID'),
|
|
|
|
|
),
|
|
|
|
|
@ -119,7 +125,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('seriesState'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
@ -127,7 +133,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('status'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
@ -135,7 +141,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('cliffhanger'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
@ -143,7 +149,7 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('backdropPath'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
@ -151,28 +157,28 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
visible: false,
|
|
|
|
|
width: 70,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(16.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('overview'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
columnName: 'seriesName',
|
|
|
|
|
// columnWidthMode: ColumnWidthMode.auto,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('Name'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
columnName: 'firstAired',
|
|
|
|
|
// columnWidthMode: ColumnWidthMode.auto,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('First Aired'))),
|
|
|
|
|
GridColumn(
|
|
|
|
|
columnName: 'resolution',
|
|
|
|
|
// columnWidthMode: ColumnWidthMode.auto,
|
|
|
|
|
label: Container(
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
padding: const EdgeInsets.all(4.0),
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
child: const Text('Resolution'))),
|
|
|
|
|
];
|
|
|
|
|
@ -371,7 +377,7 @@ class TVShowDataSource extends DataGridSource {
|
|
|
|
|
'1',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontFamily: 'geometric',
|
|
|
|
|
fontSize: 30,
|
|
|
|
|
fontSize: 25,
|
|
|
|
|
color: col,
|
|
|
|
|
),
|
|
|
|
|
)),
|
|
|
|
|
|