直播者右滑关掉界面,直接结束了直播, 需要弹窗提示,否则万一不小心滑到就是中断直播

master
laiiihz 4 years ago
parent 9bf3a500e9
commit dd81d3d544

@ -15,8 +15,6 @@ PODS:
- AFNetworking/UIKit (4.0.1):
- AFNetworking/NSURLSession
- AlipaySDK-iOS (15.6.8)
- AMap3DMap-NO-IDFA (7.6.0):
- AMapFoundation-NO-IDFA (~> 1.6.3)
- amap_core_fluttify (0.0.1):
- AMapFoundation-NO-IDFA (~> 1.6.4)
- Flutter
@ -26,24 +24,9 @@ PODS:
- AMapLocation-NO-IDFA (= 2.6.7)
- Flutter
- foundation_fluttify
- amap_map_fluttify (0.0.1):
- AMap3DMap-NO-IDFA (= 7.6.0)
- amap_core_fluttify
- amap_location_fluttify
- amap_search_fluttify
- Flutter
- foundation_fluttify
- url_launcher
- amap_search_fluttify (0.0.1):
- amap_core_fluttify
- AMapSearch-NO-IDFA (~> 7.3.0)
- Flutter
- foundation_fluttify
- AMapFoundation-NO-IDFA (1.6.4)
- AMapLocation-NO-IDFA (2.6.7):
- AMapFoundation-NO-IDFA (~> 1.6.4)
- AMapSearch-NO-IDFA (7.3.0):
- AMapFoundation-NO-IDFA (~> 1.6.3)
- Bugly (2.5.71)
- camera (0.0.1):
- Flutter
@ -204,6 +187,9 @@ PODS:
- Flutter
- photo_manager (0.0.1):
- Flutter
- raw_toast (0.0.1):
- Flutter
- Toaster
- SDWebImage (5.9.3):
- SDWebImage/Core (= 5.9.3)
- SDWebImage/Core (5.9.3)
@ -235,6 +221,7 @@ PODS:
- Flutter
- foundation_fluttify
- TXLiteAVSDK_Professional (= 7.2.8927)
- Toaster (2.3.0)
- tobias (0.0.1):
- AlipaySDK-iOS (~> 15.6.8)
- Flutter
@ -256,8 +243,6 @@ PODS:
DEPENDENCIES:
- amap_core_fluttify (from `.symlinks/plugins/amap_core_fluttify/ios`)
- amap_location_fluttify (from `.symlinks/plugins/amap_location_fluttify/ios`)
- amap_map_fluttify (from `.symlinks/plugins/amap_map_fluttify/ios`)
- amap_search_fluttify (from `.symlinks/plugins/amap_search_fluttify/ios`)
- camera (from `.symlinks/plugins/camera/ios`)
- core_location_fluttify (from `.symlinks/plugins/core_location_fluttify/ios`)
- file_picker (from `.symlinks/plugins/file_picker/ios`)
@ -279,6 +264,7 @@ DEPENDENCIES:
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- permission_handler (from `.symlinks/plugins/permission_handler/ios`)
- photo_manager (from `.symlinks/plugins/photo_manager/ios`)
- raw_toast (from `.symlinks/plugins/raw_toast/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
- sharesdk_plugin (from `.symlinks/plugins/sharesdk_plugin/ios`)
- tencent_im_plugin (from `.symlinks/plugins/tencent_im_plugin/ios`)
@ -294,10 +280,8 @@ SPEC REPOS:
trunk:
- AFNetworking
- AlipaySDK-iOS
- AMap3DMap-NO-IDFA
- AMapFoundation-NO-IDFA
- AMapLocation-NO-IDFA
- AMapSearch-NO-IDFA
- Bugly
- DKImagePickerController
- DKPhotoGallery
@ -313,6 +297,7 @@ SPEC REPOS:
- mobile-ffmpeg-min
- SDWebImage
- SwiftyGif
- Toaster
- TOCropViewController
- TXIMSDK_iOS
- TXLiteAVSDK_Professional
@ -322,10 +307,6 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/amap_core_fluttify/ios"
amap_location_fluttify:
:path: ".symlinks/plugins/amap_location_fluttify/ios"
amap_map_fluttify:
:path: ".symlinks/plugins/amap_map_fluttify/ios"
amap_search_fluttify:
:path: ".symlinks/plugins/amap_search_fluttify/ios"
camera:
:path: ".symlinks/plugins/camera/ios"
core_location_fluttify:
@ -368,6 +349,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/permission_handler/ios"
photo_manager:
:path: ".symlinks/plugins/photo_manager/ios"
raw_toast:
:path: ".symlinks/plugins/raw_toast/ios"
shared_preferences:
:path: ".symlinks/plugins/shared_preferences/ios"
sharesdk_plugin:
@ -392,14 +375,10 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
AFNetworking: 7864c38297c79aaca1500c33288e429c3451fdce
AlipaySDK-iOS: 703a55774a37f412410ab04af96c011b91ec58cb
AMap3DMap-NO-IDFA: 5e5b483ef230d1bed6c8d989d36254a66c67a6fc
amap_core_fluttify: 832331914f028c32aebf1dab23474a82aff828e8
amap_location_fluttify: baa3007e3f215456ab2ea2f4ccccf5bc1a9a164b
amap_map_fluttify: 6b64256d6ccea7813e1b6423fcf7b5ef10d3c984
amap_search_fluttify: f83f950b4f8e8688bc8b100684c33868335f2e06
AMapFoundation-NO-IDFA: 68a24362b110b8e0a3677605d0fd36bdf521f2bb
AMapLocation-NO-IDFA: 2a3edfee336b38481b892e1ecc85df0f6b365851
AMapSearch-NO-IDFA: 85555dc9ba312949d39a259baa4ef4e0619fa944
Bugly: fd066c75c4a0eca1440f9b6a84bd37d51bfc85ac
camera: a0ca5080336f7af47b88436e5e26da3dee5568f0
core_location_fluttify: 9466a411ea7d22c6349c7e6a767ae4623f01eb1d
@ -434,12 +413,14 @@ SPEC CHECKSUMS:
path_provider: abfe2b5c733d04e238b0d8691db0cfd63a27a93c
permission_handler: 67637977b227d62d46bfbf524f335f8568de5a73
photo_manager: f7c619c2cc8c2adb8d85c63363babac477de9c67
raw_toast: 24d3af32bd83848a73a4a9f8edeed98ff5c469c4
SDWebImage: a31ee8e90a97303529e03fb0c333eae0eacb88e9
shared_preferences: 1feebfa37bb57264736e16865e7ffae7fc99b523
sharesdk_plugin: 1afa172841a590314b6ecd37eee084dfbd18f725
SwiftyGif: e466e86c660d343357ab944a819a101c4127cb40
tencent_im_plugin: a055ed155fd2cae7f006e756dbec96255b4aa0a3
tencent_live_fluttify: 98821d3233cf13a47eadf1555ebd56b050e0a5ca
Toaster: c3473963c78e8cabbf6ea6f11ad0fdaae6f54987
tobias: b77cace96409ab4a1710403cd362bf6a9dd9c685
TOCropViewController: da59f531f8ac8a94ef6d6c0fc34009350f9e8bfe
TXIMSDK_iOS: d4231ccd8a045f54ca04d008dba46fdbf25687fb
@ -452,4 +433,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 92b158b51b335be17f029808df79886222d2ae9c
COCOAPODS: 1.9.3
COCOAPODS: 1.10.1

@ -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),
),
],
),
),
);
}
}

Loading…
Cancel
Save