diff --git a/lib/views/home/new_statistic/new_statistic.dart b/lib/views/home/new_statistic/new_statistic.dart index 6684343..730681b 100644 --- a/lib/views/home/new_statistic/new_statistic.dart +++ b/lib/views/home/new_statistic/new_statistic.dart @@ -70,11 +70,11 @@ class _NewStatisticState extends State { ), GestureDetector( onTap: () => Future.delayed(Duration.zero, () { - Navigator.of(context).pushNamed(Routes.statGeneral, - arguments: { - "id": 7, - "title": state.contents[0].header - }); + Navigator.of(context) + .pushNamed(Routes.statGeneral, arguments: { + "id": 7, + "title": state.contents[0].header, + }).then((value) => state.getStatistic()); }), child: StatHeader(header: state.contents[0].header)), SizedBox( diff --git a/lib/views/home/new_statistic/new_statistics_state.dart b/lib/views/home/new_statistic/new_statistics_state.dart index b3d65e0..c0ccd66 100644 --- a/lib/views/home/new_statistic/new_statistics_state.dart +++ b/lib/views/home/new_statistic/new_statistics_state.dart @@ -22,6 +22,8 @@ class NewStatisticState extends CoreProvier { if (service.isSuccess) { final res = NewStatisticModel.fromJson(service.result); + contents.clear(); + for (var element in res.lists) { contents.add(element); } diff --git a/lib/views/home/new_statistic/statistics_details/stat_cats_general_state.dart b/lib/views/home/new_statistic/statistics_details/stat_cats_general_state.dart index bfc6154..ae4dd4c 100644 --- a/lib/views/home/new_statistic/statistics_details/stat_cats_general_state.dart +++ b/lib/views/home/new_statistic/statistics_details/stat_cats_general_state.dart @@ -1,4 +1,3 @@ - import 'package:didvan/models/enums.dart'; import 'package:didvan/models/new_statistic/general_item_model.dart'; import 'package:didvan/models/requests/newstats_general.dart'; @@ -40,6 +39,9 @@ class StatGeneralScreenState extends CoreProvier { await service.httpGet(); if (service.isSuccess) { final content = StatisticGeneralContent.fromJson(service.result); + + contents.clear(); + contents.addAll(content.contents); appState = AppState.idle;