网络文章-v3 -下拉与加载更多
This commit is contained in:
@@ -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}"
|
||||||
|
|||||||
@@ -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(() {});
|
||||||
|
|||||||
Reference in New Issue
Block a user