修改圈子列表加载问题
This commit is contained in:
parent
b2934d29a6
commit
6a7dc210ea
@ -1,6 +1,6 @@
|
|||||||
class CircleState {
|
class CircleState {
|
||||||
String msg = '';
|
String msg = '';
|
||||||
int index = 1;
|
int index = 0;
|
||||||
CircleState() {
|
CircleState() {
|
||||||
///Initialize variables
|
///Initialize variables
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,15 +62,17 @@ class _CirclePageState extends State<CirclePage>
|
|||||||
controller.state.index = index;
|
controller.state.index = index;
|
||||||
if (index == logic.circle.lists.length - 1) {
|
if (index == logic.circle.lists.length - 1) {
|
||||||
logic.loadMore();
|
logic.loadMore();
|
||||||
|
|
||||||
}
|
}
|
||||||
print(index.toString());
|
print(index.toString());
|
||||||
controller.update();
|
|
||||||
},
|
},
|
||||||
index: controller.state.index,
|
index: controller.state.index,
|
||||||
itemCount: logic.circle.lists.length,
|
itemCount: logic.circle.lists.length,
|
||||||
viewportFraction: 0.93,
|
viewportFraction: 0.93,
|
||||||
// scale: 0.9,
|
// scale: 0.9,
|
||||||
loop: false,
|
loop: false,
|
||||||
|
key: UniqueKey(),
|
||||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||||
))
|
))
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:circle_app/app/circle/logic.dart';
|
|||||||
import 'package:circle_app/app/circle/state.dart';
|
import 'package:circle_app/app/circle/state.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/list_logic.dart';
|
import 'package:circle_app/app/circle/widgets/list_logic.dart';
|
||||||
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
import 'package:circle_app/app/circle/widgets/video_item.dart';
|
||||||
|
import 'package:circle_app/network/dio_manager.dart';
|
||||||
import 'package:circle_app/router/app_routers.dart';
|
import 'package:circle_app/router/app_routers.dart';
|
||||||
import 'package:circle_app/util/util.dart';
|
import 'package:circle_app/util/util.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -12,6 +13,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get/get_core/src/get_main.dart';
|
import 'package:get/get_core/src/get_main.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
class InfoListView extends StatefulWidget {
|
class InfoListView extends StatefulWidget {
|
||||||
// Get.lazyPut(() => ListLogic());
|
// Get.lazyPut(() => ListLogic());
|
||||||
@ -26,7 +28,10 @@ class InfoListView extends StatefulWidget {
|
|||||||
State<InfoListView> createState() => _InfoListViewState();
|
State<InfoListView> createState() => _InfoListViewState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _InfoListViewState extends State<InfoListView> {
|
class _InfoListViewState extends State<InfoListView> with AutomaticKeepAliveClientMixin {
|
||||||
|
@override
|
||||||
|
bool get wantKeepAlive => true;
|
||||||
|
|
||||||
List<String> genderList = ['男', '女,' 'MTF', 'FTM', 'CD', '酷儿'];
|
List<String> genderList = ['男', '女,' 'MTF', 'FTM', 'CD', '酷儿'];
|
||||||
|
|
||||||
List<String> orientationList = [
|
List<String> orientationList = [
|
||||||
@ -43,14 +48,120 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
|
|
||||||
ListLogic? listsLg;
|
ListLogic? listsLg;
|
||||||
|
|
||||||
|
int callOutPage = 1;
|
||||||
|
|
||||||
|
bool isLoad = true;
|
||||||
|
bool callOutMore = true;
|
||||||
|
var circleId = '';
|
||||||
|
List<Lists> lists = [];
|
||||||
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
super.dispose();
|
||||||
|
scrollController.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
super.initState();
|
super.initState();
|
||||||
Get.lazyPut(() => ListLogic());
|
scrollController.addListener(() {
|
||||||
listsLg = Get.find<ListLogic>();
|
try {
|
||||||
listsLg!.loadCallOutListData(widget.bean.id.toString());
|
if (scrollController.position.pixels ==
|
||||||
|
scrollController.position.maxScrollExtent) {
|
||||||
|
loadMore();
|
||||||
}
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
});
|
||||||
|
circleId = widget.bean.id
|
||||||
|
.toString();
|
||||||
|
loadCallOutListData();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
loadCallOutListData() async {
|
||||||
|
var data = await DioManager.instance.get(
|
||||||
|
url: "/up-service/interest/$circleId/callouts",
|
||||||
|
params: {"page": callOutPage, "page_size": "20"});
|
||||||
|
if (data["code"] == 200) {
|
||||||
|
List dataList = data["data"]["lists"] ?? [];
|
||||||
|
if (callOutPage == 1) {
|
||||||
|
if (lists.isNotEmpty) {
|
||||||
|
lists.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (dataList.isNotEmpty) {
|
||||||
|
callOutMore = true;
|
||||||
|
for (var element in dataList) {
|
||||||
|
lists.add(Lists.fromJson(element));
|
||||||
|
}
|
||||||
|
callOutPage++;
|
||||||
|
}
|
||||||
|
callOutMore = dataList.length == 20;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
showToast(data["msg"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setCircleId(String id) {
|
||||||
|
circleId = id;
|
||||||
|
loadCallOutListData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void refreshData() {
|
||||||
|
callOutPage = 1;
|
||||||
|
callOutMore = true;
|
||||||
|
loadCallOutListData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void loadMore() {
|
||||||
|
if (callOutMore == false) return;
|
||||||
|
loadCallOutListData();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pushOtherPeopleHomePage(String userId) {
|
||||||
|
Get.toNamed(AppRoutes.UserInfoActivity, arguments: userId);
|
||||||
|
|
||||||
|
// if (bean.isQueen) {
|
||||||
|
// showJoinCiclePiker(cicleId);
|
||||||
|
// } else {
|
||||||
|
//跳转消息页面
|
||||||
|
// Get.bottomSheet(Open_vip_tipPage(),
|
||||||
|
// isScrollControlled: true,
|
||||||
|
// enableDrag: false,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
void pushHomePage(Lists bean, String cicleId) async {
|
||||||
|
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||||
|
int userId = prefs.getInt("userId") ?? 0;
|
||||||
|
if (bean.user!.id == userId) {
|
||||||
|
Get.toNamed(AppRoutes.UserInfoActivity);
|
||||||
|
} else {
|
||||||
|
Get.toNamed(AppRoutes.UserInfoActivity,
|
||||||
|
arguments: bean.user!.id!.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (bean.isQueen) {
|
||||||
|
// showJoinCiclePiker(cicleId);
|
||||||
|
// } else {
|
||||||
|
//跳转消息页面
|
||||||
|
// Get.bottomSheet(Open_vip_tipPage(),
|
||||||
|
// isScrollControlled: true,
|
||||||
|
// enableDrag: false,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
void pushMsgPage(Lists bean, String cicleId) async {}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -88,15 +199,12 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
|
||||||
return GetBuilder<ListLogic>(
|
|
||||||
assignId: true,
|
|
||||||
builder: (listLogic) {
|
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(10.sp),
|
borderRadius: BorderRadius.circular(10.sp),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: Get.width,
|
width: Get.width,
|
||||||
margin: EdgeInsets.only(
|
margin:
|
||||||
left: widget.index > 0 ? 4.sp : 0, right: 4.sp),
|
EdgeInsets.only(left: widget.index > 0 ? 4.sp : 0, right: 4.sp),
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
@ -114,15 +222,17 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
margin: EdgeInsets.only(top: 72.sp),
|
margin: EdgeInsets.only(top: 72.sp),
|
||||||
child: RefreshIndicator(
|
child: RefreshIndicator(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
listLogic.refreshData();
|
refreshData();
|
||||||
},
|
},
|
||||||
child: listLogic.lists.isEmpty
|
child: lists.isEmpty
|
||||||
? !listLogic.callOutMore ? noResultWidget() : loaddingWidget(true)
|
? !callOutMore
|
||||||
|
? noResultWidget()
|
||||||
|
: loaddingWidget(true)
|
||||||
: ListView.builder(
|
: ListView.builder(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
scrollDirection: Axis.vertical,
|
scrollDirection: Axis.vertical,
|
||||||
controller: listLogic.scrollController,
|
controller: scrollController,
|
||||||
itemCount: listLogic.lists.length + 2,
|
itemCount: lists.length + 2,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
return Container(
|
return Container(
|
||||||
@ -132,8 +242,8 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(getCircleImage(
|
image: AssetImage(
|
||||||
'circle_desc')))),
|
getCircleImage('circle_desc')))),
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.only(top: 14.sp),
|
margin: EdgeInsets.only(top: 14.sp),
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -144,8 +254,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
_showTextContentDialog(
|
_showTextContentDialog(
|
||||||
context,
|
context, widget.bean.intro);
|
||||||
widget.bean.intro);
|
|
||||||
},
|
},
|
||||||
child: RichText(
|
child: RichText(
|
||||||
overflow: TextOverflow.fade,
|
overflow: TextOverflow.fade,
|
||||||
@ -197,19 +306,18 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else if (listLogic.lists.length + 1 >
|
} else if (lists.length + 1 > index) {
|
||||||
index) {
|
Lists list = lists[index - 1];
|
||||||
Lists lists = listLogic.lists[index - 1];
|
if (list.isQueen!) {
|
||||||
if (lists.isQueen!) {
|
return vipDynamicItem(list);
|
||||||
return vipDynamicItem(lists);
|
|
||||||
} else {
|
} else {
|
||||||
return normalDynamicItem(lists);
|
return normalDynamicItem(list);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(top: listLogic.callOutMore ? 0 : 10.sp),
|
margin: EdgeInsets.only(
|
||||||
child: loaddingWidget(
|
top: callOutMore ? 0 : 10.sp),
|
||||||
listLogic.callOutMore));
|
child: loaddingWidget(callOutMore));
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
@ -224,8 +332,8 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
image: AssetImage(
|
image:
|
||||||
getCircleImage('top_circle_bg')))),
|
AssetImage(getCircleImage('top_circle_bg')))),
|
||||||
child: Row(
|
child: Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -256,8 +364,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding: EdgeInsets.only(left: 8.sp, top: 12.sp),
|
||||||
EdgeInsets.only(left: 8.sp, top: 12.sp),
|
|
||||||
// alignment: Alignment.,
|
// alignment: Alignment.,
|
||||||
height: 72.sp,
|
height: 72.sp,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -306,8 +413,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
Text(
|
Text(
|
||||||
!widget.bean.isJoin ? '申请加入' : '已加入',
|
!widget.bean.isJoin ? '申请加入' : '已加入',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white, fontSize: 12.sp),
|
||||||
fontSize: 12.sp),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
))
|
))
|
||||||
@ -322,8 +428,6 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
)));
|
)));
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void _showTextContentDialog(BuildContext context, String msg) {
|
void _showTextContentDialog(BuildContext context, String msg) {
|
||||||
@ -450,8 +554,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
image: AssetImage(
|
image: AssetImage(
|
||||||
getCircleImage('pic_bg'),
|
getCircleImage('pic_bg'),
|
||||||
))),
|
))),
|
||||||
child: Stack(
|
child: Stack(children: [
|
||||||
children: [
|
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
top: 2.sp,
|
top: 2.sp,
|
||||||
@ -461,7 +564,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
Positioned(
|
Positioned(
|
||||||
right: 2.sp,
|
right: 2.sp,
|
||||||
top: 2.sp,
|
top: 2.sp,
|
||||||
child:Stack(
|
child: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
@ -497,8 +600,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
),
|
),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
listsLg?.pushHomePage(
|
listsLg?.pushHomePage(lists, lists.id.toString());
|
||||||
lists, lists.id.toString());
|
|
||||||
},
|
},
|
||||||
child: ClipOval(
|
child: ClipOval(
|
||||||
child: Image.network(
|
child: Image.network(
|
||||||
@ -679,7 +781,8 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)]));
|
)
|
||||||
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
///普通图文喊话
|
///普通图文喊话
|
||||||
@ -831,10 +934,11 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
Container(
|
Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
height: 18.sp,
|
height: 18.sp,
|
||||||
padding:
|
padding: EdgeInsets.only(
|
||||||
EdgeInsets.only(left: 6.sp, right: 6.sp),
|
left: 6.sp, right: 6.sp),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(9.sp),
|
borderRadius:
|
||||||
|
BorderRadius.circular(9.sp),
|
||||||
gradient: const LinearGradient(
|
gradient: const LinearGradient(
|
||||||
begin: Alignment(0.25, 0.5),
|
begin: Alignment(0.25, 0.5),
|
||||||
end: Alignment(0.75, 0.5),
|
end: Alignment(0.75, 0.5),
|
||||||
@ -896,13 +1000,15 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
for (var element in lists.album!) {
|
for (var element in lists.album!) {
|
||||||
imgList.add(element.url!);
|
imgList.add(element.url!);
|
||||||
}
|
}
|
||||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
Get.toNamed(AppRoutes.Swiper,
|
||||||
|
arguments: {
|
||||||
'imaglist': imgList,
|
'imaglist': imgList,
|
||||||
'index': currentIndex
|
'index': currentIndex
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(6.sp),
|
borderRadius:
|
||||||
|
BorderRadius.circular(6.sp),
|
||||||
child: CachedNetworkImage(
|
child: CachedNetworkImage(
|
||||||
imageUrl: album.url!,
|
imageUrl: album.url!,
|
||||||
// placeholder: (context, url) =>
|
// placeholder: (context, url) =>
|
||||||
@ -973,8 +1079,7 @@ class _InfoListViewState extends State<InfoListView> {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
circleWidget(String url, {double width = 30}) {
|
circleWidget(String url, {double width = 30}) {
|
||||||
|
|||||||
@ -13,12 +13,11 @@ class ListLogic extends GetxController {
|
|||||||
|
|
||||||
bool isLoad = true;
|
bool isLoad = true;
|
||||||
bool callOutMore = true;
|
bool callOutMore = true;
|
||||||
var _circleId = '';
|
var circleId = '';
|
||||||
List<Lists> lists = [];
|
List<Lists> lists = [];
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
loadCallOutListData(String circleId) async {
|
loadCallOutListData() async {
|
||||||
_circleId = circleId;
|
|
||||||
var data = await DioManager.instance.get(
|
var data = await DioManager.instance.get(
|
||||||
url: "/up-service/interest/$circleId/callouts",
|
url: "/up-service/interest/$circleId/callouts",
|
||||||
params: {"page": callOutPage, "page_size": "20"});
|
params: {"page": callOutPage, "page_size": "20"});
|
||||||
@ -43,17 +42,22 @@ class ListLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCircleId(String id) {
|
||||||
|
circleId = id;
|
||||||
|
loadCallOutListData();
|
||||||
|
}
|
||||||
|
|
||||||
void refreshData() {
|
void refreshData() {
|
||||||
callOutPage = 1;
|
callOutPage = 1;
|
||||||
callOutMore = true;
|
callOutMore = true;
|
||||||
loadCallOutListData(_circleId);
|
loadCallOutListData();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadMore() {
|
void loadMore() {
|
||||||
if (callOutMore == false) return;
|
if (callOutMore == false) return;
|
||||||
loadCallOutListData(_circleId);
|
loadCallOutListData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,18 +104,23 @@ class ListLogic extends GetxController {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
// TODO: implement onInit
|
// TODO: implement onInit
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
scrollController.addListener(() {
|
||||||
|
try {
|
||||||
|
if (scrollController.position.pixels == scrollController.position.maxScrollExtent) {
|
||||||
|
loadMore();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
scrollController.addListener(() {
|
|
||||||
if (scrollController.position.pixels == scrollController.position.maxScrollExtent && callOutMore) {
|
|
||||||
loadMore();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
|
|||||||
@ -54,12 +54,12 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
// Text(controller.state.msg),
|
// Text(controller.state.msg),
|
||||||
//组件使用
|
//组件使用
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Swiper(
|
child: logic.circle.lists.isEmpty ? loaddingWidget(true) : Swiper(
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
var bean = logic.circle.lists[index];
|
var bean = logic.circle.lists[index];
|
||||||
return InfoListView(index, bean, controller);
|
return InfoListView(index, bean, controller);
|
||||||
},
|
},
|
||||||
index: logic.circle.lists.isNotEmpty ? 0 : controller.state.index,
|
index: controller.state.index,
|
||||||
itemCount: logic.circle.lists.length,
|
itemCount: logic.circle.lists.length,
|
||||||
viewportFraction: 0.93,
|
viewportFraction: 0.93,
|
||||||
// scale: 0.9,
|
// scale: 0.9,
|
||||||
@ -69,8 +69,8 @@ class _My_circlePageState extends State<My_circlePage>
|
|||||||
if (index == logic.circle.lists.length - 1 && controller.isMore) {
|
if (index == logic.circle.lists.length - 1 && controller.isMore) {
|
||||||
|
|
||||||
logic.loadMore();
|
logic.loadMore();
|
||||||
controller.update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
// pagination: new SwiperPagination(),//如果不填则不显示指示点
|
||||||
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
// control: new SwiperControl(),//如果不填则不显示左右按钮
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user