From 5363f327e001c1c9ac55fc1ae55dfba22766c5de Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Mon, 7 Mar 2022 16:58:16 +0330 Subject: [PATCH] news & radars pagination bug fixed --- lib/views/home/news/news.dart | 2 +- lib/views/home/radar/radar.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/views/home/news/news.dart b/lib/views/home/news/news.dart index df3950e..2911204 100644 --- a/lib/views/home/news/news.dart +++ b/lib/views/home/news/news.dart @@ -56,7 +56,7 @@ class _NewsState extends State { state: state, builder: (context, state, index) { index += 2; - if (index % 15 == 0 && index / 15 >= state.page) { + if (index % 15 == 0 && state.lastPage != state.page) { state.getNews(page: index ~/ 15 + 1); } index -= 2; diff --git a/lib/views/home/radar/radar.dart b/lib/views/home/radar/radar.dart index 0a2adb1..1a241b0 100644 --- a/lib/views/home/radar/radar.dart +++ b/lib/views/home/radar/radar.dart @@ -129,7 +129,7 @@ class _RadarState extends State { placeholder: RadarOverview.placeholder, builder: (context, state, index) { index += 2; - if (index % 15 == 0 && index / 15 >= state.page) { + if (index % 15 == 0 && state.lastPage != state.page) { state.getRadars(page: index ~/ 15 + 1); } index -= 2;