From 6dbf2b2f3126db8bcd96ad094e206b9f63df95eb Mon Sep 17 00:00:00 2001 From: Herwig Birke Date: Tue, 2 Apr 2024 14:01:32 +0200 Subject: [PATCH] movie and tvshow list --- lib/widgets/tvshowsScreen.dart | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/widgets/tvshowsScreen.dart b/lib/widgets/tvshowsScreen.dart index 1a969c5..13410e9 100644 --- a/lib/widgets/tvshowsScreen.dart +++ b/lib/widgets/tvshowsScreen.dart @@ -25,6 +25,8 @@ class TVShowsScreen extends StatefulWidget { class _TVShowsScreenState extends State { final DataGridController _dataGridController = DataGridController(); + late int maxSeason; + late Map episodeCount; late TVShowDataSource tvshowDataSource; List _columns = []; @@ -54,11 +56,20 @@ class _TVShowsScreenState extends State { Map 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 _tvshows = - await list.map((json) => TVShow.fromJson(json)).toList(); + await tvshowList.map((json) => TVShow.fromJson(json)).toList(); tvshowDataSource = TVShowDataSource(_tvshows); + + maxSeason = mSeason; + return _tvshows; }