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