修改圈子列表加载
This commit is contained in:
parent
82921e0d04
commit
9e55ec1d68
@ -13,7 +13,7 @@ import 'package:get/get.dart';
|
||||
import 'package:get/get_core/src/get_main.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class InfoListView extends StatelessWidget {
|
||||
class InfoListView extends StatefulWidget {
|
||||
// Get.lazyPut(() => ListLogic());
|
||||
|
||||
CircleLogic logic;
|
||||
@ -22,7 +22,13 @@ class InfoListView extends StatelessWidget {
|
||||
|
||||
InfoListView(this.index, this.bean, this.logic, {super.key});
|
||||
|
||||
@override
|
||||
State<InfoListView> createState() => _InfoListViewState();
|
||||
}
|
||||
|
||||
class _InfoListViewState extends State<InfoListView> {
|
||||
List<String> genderList = ['男', '女,' 'MTF', 'FTM', 'CD', '酷儿'];
|
||||
|
||||
List<String> orientationList = [
|
||||
'异性恋',
|
||||
'同性恋',
|
||||
@ -32,19 +38,26 @@ class InfoListView extends StatelessWidget {
|
||||
'智性恋',
|
||||
'性单恋'
|
||||
];
|
||||
|
||||
List<String> roleList = ['Sado', 'Maso', 'Dom', 'Sub', 'Switch'];
|
||||
|
||||
ListLogic? listsLg;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
Get.lazyPut(() => ListLogic());
|
||||
listsLg = Get.find<ListLogic>();
|
||||
listsLg!.loadCallOutListData(bean.id.toString());
|
||||
listsLg!.loadCallOutListData(widget.bean.id.toString());
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
TextSpan descSpan;
|
||||
TextSpan span;
|
||||
if (bean.intro.length > 60) {
|
||||
String truncatedText = bean.intro.substring(0, 60);
|
||||
if (widget.bean.intro.length > 60) {
|
||||
String truncatedText = widget.bean.intro.substring(0, 60);
|
||||
descSpan = TextSpan(
|
||||
text: truncatedText,
|
||||
style: TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
@ -55,7 +68,7 @@ class InfoListView extends StatelessWidget {
|
||||
);
|
||||
} else {
|
||||
descSpan = TextSpan(
|
||||
text: bean.intro,
|
||||
text: widget.bean.intro,
|
||||
style: TextStyle(color: Colors.white, fontSize: 10.sp),
|
||||
);
|
||||
span = TextSpan(
|
||||
@ -64,7 +77,7 @@ class InfoListView extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
List<JoinUser> urlList = bean.lastJoinUsers;
|
||||
List<JoinUser> urlList = widget.bean.lastJoinUsers;
|
||||
List<Widget> widgets = [];
|
||||
int i = 0;
|
||||
urlList.forEach((element) {
|
||||
@ -82,8 +95,8 @@ class InfoListView extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(10.sp),
|
||||
child: Container(
|
||||
width: Get.width,
|
||||
margin:
|
||||
EdgeInsets.only(left: index > 0 ? 4.sp : 0, right: 4.sp),
|
||||
margin: EdgeInsets.only(
|
||||
left: widget.index > 0 ? 4.sp : 0, right: 4.sp),
|
||||
child: Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
@ -106,6 +119,7 @@ class InfoListView extends StatelessWidget {
|
||||
child: listLogic.lists.isEmpty
|
||||
? loaddingWidget(true)
|
||||
: ListView.builder(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
scrollDirection: Axis.vertical,
|
||||
controller: listLogic.scrollController,
|
||||
itemCount: listLogic.lists.length + 2,
|
||||
@ -130,7 +144,8 @@ class InfoListView extends StatelessWidget {
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
_showTextContentDialog(
|
||||
context, bean.intro);
|
||||
context,
|
||||
widget.bean.intro);
|
||||
},
|
||||
child: RichText(
|
||||
overflow: TextOverflow.fade,
|
||||
@ -161,7 +176,7 @@ class InfoListView extends StatelessWidget {
|
||||
width: 8.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.viewTotal)}圈友',
|
||||
'${convertToTenThousand(widget.bean.viewTotal)}圈友',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
@ -231,7 +246,7 @@ class InfoListView extends StatelessWidget {
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
child: Image.network(
|
||||
bean.image,
|
||||
widget.bean.image,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
),
|
||||
@ -247,7 +262,7 @@ class InfoListView extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
bean.title,
|
||||
widget.bean.title,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18.sp,
|
||||
@ -257,7 +272,7 @@ class InfoListView extends StatelessWidget {
|
||||
height: 4.sp,
|
||||
),
|
||||
Text(
|
||||
'${convertToTenThousand(bean.joinTotal)}人看过',
|
||||
'${convertToTenThousand(widget.bean.joinTotal)}人看过',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Color(0xff03FEFB),
|
||||
@ -268,26 +283,32 @@ class InfoListView extends StatelessWidget {
|
||||
),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
if (bean.isJoin) {
|
||||
_showOutCircleDialog(context, logic, bean);
|
||||
} else {
|
||||
await logic.outCircle(
|
||||
bean.id.toString(), bean.isJoin);
|
||||
logic.update();
|
||||
}
|
||||
},
|
||||
child:Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(!bean.isJoin ? '申请加入':'已加入',style: TextStyle(color: Colors.white,fontSize: 12.sp),)
|
||||
],
|
||||
)
|
||||
)
|
||||
onTap: () async {
|
||||
if (widget.bean.isJoin) {
|
||||
_showOutCircleDialog(
|
||||
context, widget.logic, widget.bean);
|
||||
} else {
|
||||
await widget.logic.outCircle(
|
||||
widget.bean.id.toString(),
|
||||
widget.bean.isJoin);
|
||||
widget.logic.update();
|
||||
}
|
||||
},
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
getCircleImage('add'),
|
||||
width: 77.sp,
|
||||
),
|
||||
Text(
|
||||
!widget.bean.isJoin ? '申请加入' : '已加入',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12.sp),
|
||||
)
|
||||
],
|
||||
))
|
||||
],
|
||||
),
|
||||
)),
|
||||
@ -405,7 +426,7 @@ class InfoListView extends StatelessWidget {
|
||||
picHeight = 109.sp;
|
||||
}
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = 140.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -457,7 +478,8 @@ class InfoListView extends StatelessWidget {
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(lists,lists.id.toString());
|
||||
listsLg?.pushMsgPage(
|
||||
lists, lists.id.toString());
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
@ -538,50 +560,55 @@ class InfoListView extends StatelessWidget {
|
||||
child: descText,
|
||||
),
|
||||
Container(
|
||||
height: 100.sp,
|
||||
height: picHeight,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
placeholder: (context, url) =>
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xFF07FAFB),
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0]!.url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
// placeholder: (context, url) =>
|
||||
// SizedBox(
|
||||
// width: 30.sp,
|
||||
// height: 30.sp,
|
||||
// child: CircularProgressIndicator(
|
||||
// color: Color(0xFF07FAFB),
|
||||
// strokeWidth: 2.sp,
|
||||
// ),
|
||||
// ),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
),
|
||||
Container(
|
||||
height: 34.sp,
|
||||
@ -620,7 +647,8 @@ class InfoListView extends StatelessWidget {
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(lists,bean.id.toString());
|
||||
listsLg?.pushMsgPage(
|
||||
lists, widget.bean.id.toString());
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('chat'),
|
||||
@ -658,7 +686,7 @@ class InfoListView extends StatelessWidget {
|
||||
picHeight = 109.sp;
|
||||
}
|
||||
} else {
|
||||
picHeight = 109.sp;
|
||||
picHeight = 140.sp;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -732,18 +760,19 @@ class InfoListView extends StatelessWidget {
|
||||
getCircleImage('avatar_bg'),
|
||||
width: 42.sp,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(lists,bean.id.toString());
|
||||
},
|
||||
child:ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
))
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(
|
||||
lists, widget.bean.id.toString());
|
||||
},
|
||||
child: ClipOval(
|
||||
child: Image.network(
|
||||
lists.user!.avatar!,
|
||||
width: 40.sp,
|
||||
height: 40.sp,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
))
|
||||
],
|
||||
)),
|
||||
Expanded(
|
||||
@ -816,50 +845,61 @@ class InfoListView extends StatelessWidget {
|
||||
picHeight > 0
|
||||
? Container(
|
||||
height: picHeight,
|
||||
alignment: Alignment.centerLeft,
|
||||
margin: EdgeInsets.only(top: 5.sp),
|
||||
child: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
child: picHeight == 140.sp
|
||||
? ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(lists.album![0].url!))
|
||||
: GridView.builder(
|
||||
itemCount: lists.album!.length,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
gridDelegate:
|
||||
SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3, //横轴三个子widget
|
||||
crossAxisSpacing: 8.sp,
|
||||
mainAxisSpacing: 8.sp,
|
||||
childAspectRatio: 1.0 //宽高比为1时,子widget
|
||||
),
|
||||
itemBuilder: (contentxt, currentIndex) {
|
||||
Album album = lists.album![currentIndex];
|
||||
if (album.type == 2) {
|
||||
return ClipRRect(
|
||||
borderRadius:
|
||||
BorderRadius.circular(6.sp),
|
||||
child: VideoItemWidget(album.url!));
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
placeholder: (context, url) =>
|
||||
CircularProgressIndicator(
|
||||
color: Color(0xFF07FAFB),
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
var imgList = <String>[];
|
||||
for (var element in lists.album!) {
|
||||
imgList.add(element.url!);
|
||||
}
|
||||
Get.toNamed(AppRoutes.Swiper, arguments: {
|
||||
'imaglist': imgList,
|
||||
'index': currentIndex
|
||||
});
|
||||
},
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6.sp),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: album.url!,
|
||||
// placeholder: (context, url) =>
|
||||
// SizedBox(
|
||||
// width: 30.sp,
|
||||
// height: 30.sp,
|
||||
// child: CircularProgressIndicator(
|
||||
// color: Color(0xFF07FAFB),
|
||||
// strokeWidth: 2.sp,
|
||||
// ),
|
||||
// ),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
errorWidget: (context, url, error) =>
|
||||
Icon(Icons.error),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
);
|
||||
}))
|
||||
);
|
||||
}))
|
||||
: Container(),
|
||||
Container(
|
||||
height: 34.sp,
|
||||
@ -896,14 +936,15 @@ class InfoListView extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 12.sp),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(lists,bean.id.toString());
|
||||
},
|
||||
child:Image.asset(
|
||||
getCircleImage('chat'),
|
||||
width: 60.sp,
|
||||
))
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
listsLg?.pushMsgPage(
|
||||
lists, widget.bean.id.toString());
|
||||
},
|
||||
child: Image.asset(
|
||||
getCircleImage('chat'),
|
||||
width: 60.sp,
|
||||
))
|
||||
],
|
||||
),
|
||||
)
|
||||
@ -1032,8 +1073,9 @@ class InfoListView extends StatelessWidget {
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Navigator.pop(context);
|
||||
await logic.outCircle(bean.id.toString(), bean.isJoin);
|
||||
logic.update();
|
||||
await widget.logic
|
||||
.outCircle(bean.id.toString(), bean.isJoin);
|
||||
widget.logic.update();
|
||||
},
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(top: 24.sp),
|
||||
|
||||
@ -19,6 +19,7 @@ class _VideoItemWidgetState extends State<VideoItemWidget> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
// ignore: deprecated_member_use
|
||||
videoPlayerController = VideoPlayerController.network(
|
||||
widget.url)
|
||||
..initialize().then((_) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user