movie and tvshow list
This commit is contained in:
@@ -25,6 +25,8 @@ class TVShowsScreen extends StatefulWidget {
|
|||||||
|
|
||||||
class _TVShowsScreenState extends State<TVShowsScreen> {
|
class _TVShowsScreenState extends State<TVShowsScreen> {
|
||||||
final DataGridController _dataGridController = DataGridController();
|
final DataGridController _dataGridController = DataGridController();
|
||||||
|
late int maxSeason;
|
||||||
|
late Map<int, int> episodeCount;
|
||||||
late TVShowDataSource tvshowDataSource;
|
late TVShowDataSource tvshowDataSource;
|
||||||
List<GridColumn> _columns = [];
|
List<GridColumn> _columns = [];
|
||||||
|
|
||||||
@@ -54,11 +56,20 @@ class _TVShowsScreenState extends State<TVShowsScreen> {
|
|||||||
Map<String, dynamic> tvshows = json.decode(response.body);
|
Map<String, dynamic> tvshows = json.decode(response.body);
|
||||||
error = tvshows['error'];
|
error = tvshows['error'];
|
||||||
errorMessage = tvshows['errmsg'];
|
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 =
|
List<TVShow> _tvshows =
|
||||||
await list.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
await tvshowList.map<TVShow>((json) => TVShow.fromJson(json)).toList();
|
||||||
tvshowDataSource = TVShowDataSource(_tvshows);
|
tvshowDataSource = TVShowDataSource(_tvshows);
|
||||||
|
|
||||||
|
maxSeason = mSeason;
|
||||||
|
|
||||||
return _tvshows;
|
return _tvshows;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user