|
|
|
@ -24,6 +24,7 @@ import 'package:recook/pages/live/widget/more_people.dart';
|
|
|
|
|
import 'package:recook/pages/user/user_page.dart';
|
|
|
|
|
import 'package:recook/utils/custom_route.dart';
|
|
|
|
|
import 'package:recook/utils/share_tool.dart';
|
|
|
|
|
import 'package:recook/widgets/alert.dart';
|
|
|
|
|
import 'package:recook/widgets/bottom_sheet/action_sheet.dart';
|
|
|
|
|
import 'package:recook/widgets/custom_image_button.dart';
|
|
|
|
|
import 'package:tencent_im_plugin/entity/group_member_entity.dart';
|
|
|
|
@ -77,6 +78,22 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
bool _waitSignal = false;
|
|
|
|
|
int _livePauseTimeStamp = 0;
|
|
|
|
|
|
|
|
|
|
/*ALL THE FUNCTION */
|
|
|
|
|
Future<bool> checkPop() async {
|
|
|
|
|
return await showDialog(
|
|
|
|
|
context: context,
|
|
|
|
|
child: NormalTextDialog(
|
|
|
|
|
title: '确认退出直播间吗',
|
|
|
|
|
content: '',
|
|
|
|
|
items: ['确认'],
|
|
|
|
|
deleteItem: '取消',
|
|
|
|
|
type: NormalTextDialogType.delete,
|
|
|
|
|
listener: (_) => Navigator.pop(context, true),
|
|
|
|
|
deleteListener: () => Navigator.pop(context),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
super.initState();
|
|
|
|
@ -356,11 +373,14 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Scaffold(
|
|
|
|
|
return WillPopScope(
|
|
|
|
|
onWillPop: () async => (await checkPop()) == true,
|
|
|
|
|
child: Scaffold(
|
|
|
|
|
body: _streamInfoModel == null
|
|
|
|
|
? Center(child: CircularProgressIndicator())
|
|
|
|
|
: Stack(
|
|
|
|
|
children: [
|
|
|
|
|
// Cloud Video view
|
|
|
|
|
Positioned(
|
|
|
|
|
top: 0,
|
|
|
|
|
left: 0,
|
|
|
|
@ -378,49 +398,18 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
onWarningReconnect: () {
|
|
|
|
|
reconnectToLive();
|
|
|
|
|
},
|
|
|
|
|
onWarningVideoDecodeFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningAudioDecodeFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningRecvDataLag: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningVideoPlayLag: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningHwAccelerationFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningVideoDiscontinuity: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningDNSFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningServerConnFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onWarningShakeFail: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onEventRcvFirstIFrame: () {
|
|
|
|
|
print('');
|
|
|
|
|
},
|
|
|
|
|
onEventPlayBegin: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_waitSignal = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onEventPlayEnd: () {
|
|
|
|
|
print('`');
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
// waiting viewe
|
|
|
|
|
Positioned(
|
|
|
|
|
left: 0,
|
|
|
|
|
right: 0,
|
|
|
|
@ -428,6 +417,7 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
top: 0,
|
|
|
|
|
child: _buildWait(),
|
|
|
|
|
),
|
|
|
|
|
//tool tap view
|
|
|
|
|
Positioned(
|
|
|
|
|
left: 0,
|
|
|
|
|
top: 0,
|
|
|
|
@ -518,8 +508,9 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
builder: (context) {
|
|
|
|
|
return LiveUsersView(
|
|
|
|
|
members: _groupMembers,
|
|
|
|
|
usersId:
|
|
|
|
|
_groupMembers.map((e) => e.user).toList(),
|
|
|
|
|
usersId: _groupMembers
|
|
|
|
|
.map((e) => e.user)
|
|
|
|
|
.toList(),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
@ -547,7 +538,10 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
Icons.clear,
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () => Navigator.pop(context),
|
|
|
|
|
onPressed: () async {
|
|
|
|
|
bool result = await checkPop();
|
|
|
|
|
if (result == true) Navigator.pop(context);
|
|
|
|
|
},
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
@ -659,8 +653,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
listener: (index) {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
//fake
|
|
|
|
|
Future.delayed(Duration(milliseconds: 1000),
|
|
|
|
|
() {
|
|
|
|
|
Future.delayed(
|
|
|
|
|
Duration(milliseconds: 1000), () {
|
|
|
|
|
GSDialog.of(context)
|
|
|
|
|
.showSuccess(context, '举报成功');
|
|
|
|
|
});
|
|
|
|
@ -686,7 +680,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
children: [
|
|
|
|
|
CustomImageButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Navigator.pop(
|
|
|
|
|
context);
|
|
|
|
|
setState(() {
|
|
|
|
|
chatObjects.clear();
|
|
|
|
|
});
|
|
|
|
@ -707,17 +702,21 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
),
|
|
|
|
|
CustomImageButton(
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
if (UserManager.instance
|
|
|
|
|
Navigator.pop(
|
|
|
|
|
context);
|
|
|
|
|
if (UserManager
|
|
|
|
|
.instance
|
|
|
|
|
.haveLogin) {
|
|
|
|
|
showModalBottomSheet(
|
|
|
|
|
context: context,
|
|
|
|
|
builder: (context) {
|
|
|
|
|
builder:
|
|
|
|
|
(context) {
|
|
|
|
|
return LiveReportView();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
showToast('未登陆,请先登陆');
|
|
|
|
|
showToast(
|
|
|
|
|
'未登陆,请先登陆');
|
|
|
|
|
CRoute.pushReplace(
|
|
|
|
|
context,
|
|
|
|
|
UserPage());
|
|
|
|
@ -788,7 +787,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
padding:
|
|
|
|
|
EdgeInsets.all(rSize(15)),
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
mainAxisSize:
|
|
|
|
|
MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
Image.asset(
|
|
|
|
|
R.ASSETS_SHARE_BOTTOM_SHARE_BOTTOM_WECHAT_PNG,
|
|
|
|
@ -863,7 +863,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
height: rSize(44),
|
|
|
|
|
alignment: Alignment.bottomCenter,
|
|
|
|
|
child: Text(
|
|
|
|
|
_streamInfoModel.goodsLists.length.toString(),
|
|
|
|
|
_streamInfoModel.goodsLists.length
|
|
|
|
|
.toString(),
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
fontSize: rSP(13),
|
|
|
|
@ -872,8 +873,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
image: DecorationImage(
|
|
|
|
|
image:
|
|
|
|
|
AssetImage(R.ASSETS_LIVE_LIVE_GOOD_PNG),
|
|
|
|
|
image: AssetImage(
|
|
|
|
|
R.ASSETS_LIVE_LIVE_GOOD_PNG),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@ -915,7 +916,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.vertical(
|
|
|
|
|
top: Radius.circular(rSize(15)),
|
|
|
|
|
top: Radius.circular(
|
|
|
|
|
rSize(15)),
|
|
|
|
|
),
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
),
|
|
|
|
@ -934,7 +936,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
margin: EdgeInsets.all(rSize(10)),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(rSize(4)),
|
|
|
|
|
borderRadius:
|
|
|
|
|
BorderRadius.circular(rSize(4)),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
@ -973,7 +976,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
),
|
|
|
|
|
Expanded(
|
|
|
|
|
child: Container(
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
alignment:
|
|
|
|
|
Alignment.centerLeft,
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
@ -985,7 +989,8 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
|
|
|
|
nowGoodList.discountPrice,
|
|
|
|
|
nowGoodList
|
|
|
|
|
.discountPrice,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color:
|
|
|
|
|
Color(0xFFC92219),
|
|
|
|
@ -1024,11 +1029,13 @@ class _LiveStreamViewPageState extends State<LiveStreamViewPage> {
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
bottom: rSize(67),
|
|
|
|
|
right: showDetailWindow ? rSize(25) : -rSize(25 + 20 + 110.0),
|
|
|
|
|
right:
|
|
|
|
|
showDetailWindow ? rSize(25) : -rSize(25 + 20 + 110.0),
|
|
|
|
|
duration: Duration(milliseconds: 300),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|