网络文章-v3 -下拉与加载更多

This commit is contained in:
toly
2023-05-20 07:51:54 +08:00
parent ea86391cfc
commit 2f025c5a2e
2 changed files with 2 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.toly1994.flutter_first_station"> package="com.toly1994.flutter_first_station">
<uses-permission android:name="android.permission.INTERNET"/>
<application <application
android:label="flutter_first_station" android:label="flutter_first_station"
android:name="${applicationName}" android:name="${applicationName}"

View File

@@ -76,7 +76,7 @@ class _ArticleContentState extends State<ArticleContent> {
} }
void _onLoad() async{ void _onLoad() async{
int nextPage = _articles.length%20; int nextPage = _articles.length ~/ 20;
List<Article> newArticles = await api.loadArticles(nextPage); List<Article> newArticles = await api.loadArticles(nextPage);
_articles = _articles + newArticles; _articles = _articles + newArticles;
setState(() {}); setState(() {});