|
|
|
@ -10,7 +10,6 @@ import 'package:huixiang/retrofit/data/page.dart';
|
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/classic_header.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/custom_image.dart'; |
|
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
@ -34,15 +33,14 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
|
|
|
|
|
List<HeadlinesList> headlines = []; |
|
|
|
|
final RefreshController refreshController = RefreshController(); |
|
|
|
|
int pageNum = 1; |
|
|
|
|
final ScrollController scrollController = ScrollController(); |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
articles = widget.arguments["articles"]; |
|
|
|
|
WidgetsBinding.instance.addObserver(this); |
|
|
|
|
queryHeadlinesDetails(widget.arguments["categoryId"]); |
|
|
|
|
queryArticleList(widget.arguments["categoryId"]); |
|
|
|
|
queryHeadlinesDetails(widget.arguments["id"]); |
|
|
|
|
queryArticleList(widget.arguments["id"]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///文章合集详情 |
|
|
|
@ -80,7 +78,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
|
|
|
|
|
"searchKey": "", |
|
|
|
|
"state": 1, |
|
|
|
|
"type": 2, |
|
|
|
|
"categoryId":widget.arguments["categoryId"] |
|
|
|
|
"categoryId":categoryId |
|
|
|
|
}).catchError((onError){ |
|
|
|
|
refreshController.refreshFailed(); |
|
|
|
|
refreshController.loadFailed(); |
|
|
|
@ -104,24 +102,11 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
_onRefresh(){ |
|
|
|
|
queryHeadlinesDetails(widget.arguments["categoryId"]); |
|
|
|
|
queryArticleList(widget.arguments["categoryId"]);//分类列表 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
|
return Scaffold( |
|
|
|
|
body: Container( |
|
|
|
|
child: SmartRefresher( |
|
|
|
|
controller: refreshController, |
|
|
|
|
enablePullDown: true, |
|
|
|
|
enablePullUp: false, |
|
|
|
|
header: MyHeader(), |
|
|
|
|
physics: ClampingScrollPhysics(), |
|
|
|
|
onRefresh: _onRefresh, |
|
|
|
|
scrollController: scrollController, |
|
|
|
|
child:Column( |
|
|
|
|
child: Column( |
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: SingleChildScrollView( |
|
|
|
@ -251,7 +236,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
|
|
|
|
|
), |
|
|
|
|
ListView.builder( |
|
|
|
|
padding: EdgeInsets.zero, |
|
|
|
|
itemCount:articles.length, |
|
|
|
|
itemCount:articles == null ? 0 : articles.length, |
|
|
|
|
scrollDirection: Axis.vertical, |
|
|
|
|
shrinkWrap: true, |
|
|
|
|
physics: NeverScrollableScrollPhysics(), |
|
|
|
@ -276,7 +261,7 @@ class _HeadlinesColumnDetails extends State<HeadlinesColumnDetails>
|
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
),) |
|
|
|
|
), |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|