|
|
|
|
@ -25,6 +25,8 @@ class TVShowsScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
final DataGridController _dataGridController = DataGridController();
|
|
|
|
|
late int maxSeason;
|
|
|
|
|
late Map<int, int> episodeCount;
|
|
|
|
|
late TVShowDataSource tvshowDataSource;
|
|
|
|
|
List<GridColumn> _columns = [];
|
|
|
|
|
|
|
|
|
|
@ -54,11 +56,20 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|
|
|
|
Map<String, dynamic> tvshows = json.decode(response.body);
|
|
|
|
|
error = tvshows['error'];
|
|
|
|
|
errorMessage = tvshows['errmsg'];
|
|
|
|
|
var list = tvshows['tvshows'];
|
|
|
|
|
var mSeason = tvshows['maxSeason'];
|
|
|
|
|
var tvshowList = tvshows['tvshows'];
|
|
|
|
|
// var episodeList = tvshows['episodeCount'];
|
|
|
|
|
//
|
|
|
|
|
// for (var episode in episodeList) {
|
|
|
|
|
// episodeCount[episode['seasonNumber']] = episode['cnr'];
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
List<TVShow> _tvshows =
|
|
|
|
|
await list.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
|
|
|
|
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
|
|
|
|
tvshowDataSource = TVShowDataSource(_tvshows);
|
|
|
|
|
|
|
|
|
|
maxSeason = mSeason;
|
|
|
|
|
|
|
|
|
|
return _tvshows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|