mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: dynamicDetail/html page
Closes #60 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -69,7 +69,7 @@ Widget htmlRender({
|
|||||||
],
|
],
|
||||||
style: {
|
style: {
|
||||||
'html': Style(
|
'html': Style(
|
||||||
fontSize: FontSize(17),
|
fontSize: FontSize(16),
|
||||||
lineHeight: LineHeight.percent(160),
|
lineHeight: LineHeight.percent(160),
|
||||||
letterSpacing: 0.3,
|
letterSpacing: 0.3,
|
||||||
),
|
),
|
||||||
@@ -105,7 +105,7 @@ Widget htmlRender({
|
|||||||
margin: Margins.only(bottom: 8),
|
margin: Margins.only(bottom: 8),
|
||||||
),
|
),
|
||||||
'h3,h4,h5': Style(
|
'h3,h4,h5': Style(
|
||||||
fontSize: FontSize(17),
|
fontSize: FontSize(16),
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
margin: Margins.only(bottom: 4),
|
margin: Margins.only(bottom: 4),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -310,8 +310,7 @@ class _AboutPageState extends State<AboutPage> {
|
|||||||
onTap: () async {
|
onTap: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
String data = await GStorage.exportAllSettings();
|
String data = await GStorage.exportAllSettings();
|
||||||
Clipboard.setData(ClipboardData(text: data));
|
Utils.copyText(data);
|
||||||
SmartDialog.showToast('已复制到剪贴板');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import 'package:PiliPalaX/pages/common/common_controller.dart';
|
|||||||
import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart';
|
import 'package:PiliPalaX/pages/video/detail/introduction/controller.dart';
|
||||||
import 'package:PiliPalaX/utils/utils.dart';
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get/get_navigation/src/dialog/dialog_route.dart';
|
import 'package:get/get_navigation/src/dialog/dialog_route.dart';
|
||||||
@@ -325,8 +324,7 @@ class BangumiIntroController extends CommonController {
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
Clipboard.setData(ClipboardData(text: videoUrl));
|
Utils.copyText(videoUrl);
|
||||||
SmartDialog.showToast('已复制');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|||||||
@@ -115,25 +115,39 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查看二级评论
|
// 查看二级评论
|
||||||
void replyReply(replyItem, id, isTop) {
|
void replyReply(context, replyItem, id, isTop) {
|
||||||
EasyThrottle.throttle('replyReply', const Duration(milliseconds: 500), () {
|
EasyThrottle.throttle('replyReply', const Duration(milliseconds: 500), () {
|
||||||
int oid = replyItem.oid.toInt();
|
int oid = replyItem.oid.toInt();
|
||||||
int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid;
|
int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid;
|
||||||
Get.to(
|
Widget replyReplyPage() => Scaffold(
|
||||||
() => Scaffold(
|
resizeToAvoidBottomInset: false,
|
||||||
resizeToAvoidBottomInset: false,
|
appBar: AppBar(title: Text('评论详情')),
|
||||||
appBar: AppBar(title: Text('评论详情')),
|
body: VideoReplyReplyPanel(
|
||||||
body: VideoReplyReplyPanel(
|
id: id,
|
||||||
id: id,
|
oid: oid,
|
||||||
oid: oid,
|
rpid: rpid,
|
||||||
rpid: rpid,
|
source: 'dynamic',
|
||||||
source: 'dynamic',
|
replyType: ReplyType.values[replyType],
|
||||||
replyType: ReplyType.values[replyType],
|
firstFloor: replyItem,
|
||||||
firstFloor: replyItem,
|
isTop: isTop ?? false,
|
||||||
isTop: isTop ?? false,
|
),
|
||||||
),
|
);
|
||||||
),
|
if (this.context.orientation == Orientation.portrait) {
|
||||||
);
|
Get.to(replyReplyPage);
|
||||||
|
} else {
|
||||||
|
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
||||||
|
if (scaffoldState != null) {
|
||||||
|
scaffoldState.showBottomSheet(
|
||||||
|
(context) => MediaQuery.removePadding(
|
||||||
|
context: context,
|
||||||
|
removeLeft: true,
|
||||||
|
child: replyReplyPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Get.to(replyReplyPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,125 +261,137 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
},
|
},
|
||||||
icon: Transform.rotate(
|
icon: Transform.rotate(
|
||||||
angle: pi / 2,
|
angle: pi / 2,
|
||||||
child: Icon(Icons.splitscreen),
|
child: Icon(Icons.splitscreen, size: 19),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 16),
|
const SizedBox(width: 16),
|
||||||
]
|
]
|
||||||
: null,
|
: null,
|
||||||
),
|
),
|
||||||
body: refreshIndicator(
|
body: context.orientation == Orientation.portrait
|
||||||
onRefresh: () async {
|
? refreshIndicator(
|
||||||
await _dynamicDetailController.onRefresh();
|
onRefresh: () async {
|
||||||
},
|
await _dynamicDetailController.onRefresh();
|
||||||
child: Stack(
|
|
||||||
children: [
|
|
||||||
OrientationBuilder(
|
|
||||||
builder: (context, orientation) {
|
|
||||||
double padding = max(context.width / 2 - Grid.maxRowWidth, 0);
|
|
||||||
if (orientation == Orientation.portrait) {
|
|
||||||
return CustomScrollView(
|
|
||||||
controller: _dynamicDetailController.scrollController,
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
slivers: [
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: DynamicPanel(
|
|
||||||
item: _dynamicDetailController.item,
|
|
||||||
source: 'detail',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
replyPersistentHeader(context),
|
|
||||||
Obx(
|
|
||||||
() => replyList(
|
|
||||||
_dynamicDetailController.loadingState.value),
|
|
||||||
),
|
|
||||||
]
|
|
||||||
.map<Widget>((e) => SliverPadding(
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: padding),
|
|
||||||
sliver: e))
|
|
||||||
.toList(),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: _ratio[0].toInt(),
|
|
||||||
child: CustomScrollView(
|
|
||||||
controller: ScrollController(),
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
slivers: [
|
|
||||||
SliverPadding(
|
|
||||||
padding: EdgeInsets.only(left: padding / 4),
|
|
||||||
sliver: SliverToBoxAdapter(
|
|
||||||
child: DynamicPanel(
|
|
||||||
item: _dynamicDetailController.item,
|
|
||||||
source: 'detail',
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: _ratio[1].toInt(),
|
|
||||||
child: CustomScrollView(
|
|
||||||
controller: _dynamicDetailController.scrollController,
|
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
|
||||||
slivers: [
|
|
||||||
SliverPadding(
|
|
||||||
padding: EdgeInsets.only(right: padding / 4),
|
|
||||||
sliver: replyPersistentHeader(context),
|
|
||||||
),
|
|
||||||
SliverPadding(
|
|
||||||
padding: EdgeInsets.only(right: padding / 4),
|
|
||||||
sliver: Obx(
|
|
||||||
() => replyList(_dynamicDetailController
|
|
||||||
.loadingState.value),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
child: _buildBody(context.orientation),
|
||||||
if (_fabAnimationCtr != null)
|
)
|
||||||
Positioned(
|
: _buildBody(context.orientation),
|
||||||
bottom: MediaQuery.of(context).padding.bottom + 14,
|
|
||||||
right: 14,
|
|
||||||
child: SlideTransition(
|
|
||||||
position: Tween<Offset>(
|
|
||||||
begin: const Offset(0, 2),
|
|
||||||
end: const Offset(0, 0),
|
|
||||||
).animate(CurvedAnimation(
|
|
||||||
parent: _fabAnimationCtr!,
|
|
||||||
curve: Curves.easeInOut,
|
|
||||||
)),
|
|
||||||
child: FloatingActionButton(
|
|
||||||
heroTag: null,
|
|
||||||
onPressed: () {
|
|
||||||
feedBack();
|
|
||||||
dynamic oid = _dynamicDetailController.oid ??
|
|
||||||
IdUtils.bv2av(Get.parameters['bvid']!);
|
|
||||||
_dynamicDetailController.onReply(
|
|
||||||
context,
|
|
||||||
oid: oid,
|
|
||||||
replyType: ReplyType.values[replyType],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
tooltip: '评论动态',
|
|
||||||
child: const Icon(Icons.reply),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildBody(Orientation orientation) => Stack(
|
||||||
|
children: [
|
||||||
|
Builder(
|
||||||
|
builder: (context) {
|
||||||
|
double padding = max(context.width / 2 - Grid.maxRowWidth, 0);
|
||||||
|
if (orientation == Orientation.portrait) {
|
||||||
|
return CustomScrollView(
|
||||||
|
controller: _dynamicDetailController.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
SliverToBoxAdapter(
|
||||||
|
child: DynamicPanel(
|
||||||
|
item: _dynamicDetailController.item,
|
||||||
|
source: 'detail',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
replyPersistentHeader(context),
|
||||||
|
Obx(
|
||||||
|
() => replyList(
|
||||||
|
_dynamicDetailController.loadingState.value),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
.map<Widget>((e) => SliverPadding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: padding),
|
||||||
|
sliver: e))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: _ratio[0].toInt(),
|
||||||
|
child: CustomScrollView(
|
||||||
|
controller: ScrollController(),
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.only(left: padding / 4),
|
||||||
|
sliver: SliverToBoxAdapter(
|
||||||
|
child: DynamicPanel(
|
||||||
|
item: _dynamicDetailController.item,
|
||||||
|
source: 'detail',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: _ratio[1].toInt(),
|
||||||
|
child: Scaffold(
|
||||||
|
body: refreshIndicator(
|
||||||
|
onRefresh: () async {
|
||||||
|
await _dynamicDetailController.onRefresh();
|
||||||
|
},
|
||||||
|
child: CustomScrollView(
|
||||||
|
controller:
|
||||||
|
_dynamicDetailController.scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
slivers: [
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.only(right: padding / 4),
|
||||||
|
sliver: replyPersistentHeader(context),
|
||||||
|
),
|
||||||
|
SliverPadding(
|
||||||
|
padding: EdgeInsets.only(right: padding / 4),
|
||||||
|
sliver: Obx(
|
||||||
|
() => replyList(_dynamicDetailController
|
||||||
|
.loadingState.value),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (_fabAnimationCtr != null)
|
||||||
|
Positioned(
|
||||||
|
bottom: MediaQuery.of(context).padding.bottom + 14,
|
||||||
|
right: 14,
|
||||||
|
child: SlideTransition(
|
||||||
|
position: Tween<Offset>(
|
||||||
|
begin: const Offset(0, 2),
|
||||||
|
end: const Offset(0, 0),
|
||||||
|
).animate(CurvedAnimation(
|
||||||
|
parent: _fabAnimationCtr!,
|
||||||
|
curve: Curves.easeInOut,
|
||||||
|
)),
|
||||||
|
child: FloatingActionButton(
|
||||||
|
heroTag: null,
|
||||||
|
onPressed: () {
|
||||||
|
feedBack();
|
||||||
|
dynamic oid = _dynamicDetailController.oid ??
|
||||||
|
IdUtils.bv2av(Get.parameters['bvid']!);
|
||||||
|
_dynamicDetailController.onReply(
|
||||||
|
context,
|
||||||
|
oid: oid,
|
||||||
|
replyType: ReplyType.values[replyType],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
tooltip: '评论动态',
|
||||||
|
child: const Icon(Icons.reply),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
SliverPersistentHeader replyPersistentHeader(BuildContext context) {
|
SliverPersistentHeader replyPersistentHeader(BuildContext context) {
|
||||||
return SliverPersistentHeader(
|
return SliverPersistentHeader(
|
||||||
delegate: _MySliverPersistentHeaderDelegate(
|
delegate: _MySliverPersistentHeaderDelegate(
|
||||||
@@ -454,7 +480,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
replyItem: loadingState.response.replies[index],
|
replyItem: loadingState.response.replies[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: replyReply,
|
replyReply: (replyItem, id, isTop) =>
|
||||||
|
replyReply(context, replyItem, id, isTop),
|
||||||
replyType: ReplyType.values[replyType],
|
replyType: ReplyType.values[replyType],
|
||||||
onReply: () {
|
onReply: () {
|
||||||
_dynamicDetailController.onReply(
|
_dynamicDetailController.onReply(
|
||||||
@@ -472,7 +499,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
|
|||||||
replyItem: loadingState.response.replies[index],
|
replyItem: loadingState.response.replies[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: replyReply,
|
replyReply: (replyItem, id, isTop) =>
|
||||||
|
replyReply(context, replyItem, id, isTop),
|
||||||
replyType: ReplyType.values[replyType],
|
replyType: ReplyType.values[replyType],
|
||||||
onReply: () {
|
onReply: () {
|
||||||
_dynamicDetailController.onReply(
|
_dynamicDetailController.onReply(
|
||||||
|
|||||||
@@ -8,11 +8,10 @@ import 'package:PiliPalaX/pages/video/detail/reply/widgets/reply_item_grpc.dart'
|
|||||||
import 'package:PiliPalaX/utils/extension.dart';
|
import 'package:PiliPalaX/utils/extension.dart';
|
||||||
import 'package:PiliPalaX/utils/global_data.dart';
|
import 'package:PiliPalaX/utils/global_data.dart';
|
||||||
import 'package:PiliPalaX/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
|
import 'package:PiliPalaX/common/skeleton/video_reply.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/html_render.dart';
|
import 'package:PiliPalaX/common/widgets/html_render.dart';
|
||||||
@@ -106,27 +105,41 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void replyReply(replyItem, id, isTop) {
|
void replyReply(context, replyItem, id, isTop) {
|
||||||
EasyThrottle.throttle('replyReply', const Duration(milliseconds: 500), () {
|
EasyThrottle.throttle('replyReply', const Duration(milliseconds: 500), () {
|
||||||
int oid = replyItem.oid.toInt();
|
int oid = replyItem.oid.toInt();
|
||||||
int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid;
|
int rpid = GlobalData().grpcReply ? replyItem.id.toInt() : replyItem.rpid;
|
||||||
Get.to(
|
Widget replyReplyPage() => Scaffold(
|
||||||
() => Scaffold(
|
resizeToAvoidBottomInset: false,
|
||||||
resizeToAvoidBottomInset: false,
|
appBar: AppBar(
|
||||||
appBar: AppBar(
|
title: Text('评论详情'),
|
||||||
title: Text('评论详情'),
|
),
|
||||||
),
|
body: VideoReplyReplyPanel(
|
||||||
body: VideoReplyReplyPanel(
|
id: id,
|
||||||
id: id,
|
oid: oid,
|
||||||
oid: oid,
|
rpid: rpid,
|
||||||
rpid: rpid,
|
source: 'dynamic',
|
||||||
source: 'dynamic',
|
replyType: ReplyType.values[type],
|
||||||
replyType: ReplyType.values[type],
|
firstFloor: replyItem,
|
||||||
firstFloor: replyItem,
|
isTop: isTop ?? false,
|
||||||
isTop: isTop ?? false,
|
),
|
||||||
),
|
);
|
||||||
),
|
if (this.context.orientation == Orientation.portrait) {
|
||||||
);
|
Get.to(replyReplyPage);
|
||||||
|
} else {
|
||||||
|
ScaffoldState? scaffoldState = Scaffold.maybeOf(context);
|
||||||
|
if (scaffoldState != null) {
|
||||||
|
scaffoldState.showBottomSheet(
|
||||||
|
(context) => MediaQuery.removePadding(
|
||||||
|
context: context,
|
||||||
|
removeLeft: true,
|
||||||
|
child: replyReplyPage(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Get.to(replyReplyPage);
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +191,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
},
|
},
|
||||||
icon: Transform.rotate(
|
icon: Transform.rotate(
|
||||||
angle: pi / 2,
|
angle: pi / 2,
|
||||||
child: Icon(Icons.splitscreen),
|
child: Icon(Icons.splitscreen, size: 19),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -193,7 +206,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
icon: const Icon(Icons.open_in_browser_outlined, size: 19),
|
icon: const Icon(Icons.open_in_browser_outlined, size: 19),
|
||||||
),
|
),
|
||||||
PopupMenuButton(
|
PopupMenuButton(
|
||||||
icon: const Icon(Icons.more_vert),
|
icon: const Icon(Icons.more_vert, size: 19),
|
||||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () => {
|
onTap: () => {
|
||||||
@@ -226,10 +239,7 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
PopupMenuItem(
|
PopupMenuItem(
|
||||||
onTap: () => {
|
onTap: () => Utils.copyText(url),
|
||||||
Clipboard.setData(ClipboardData(text: url)),
|
|
||||||
SmartDialog.showToast('已复制'),
|
|
||||||
},
|
|
||||||
child: const Row(
|
child: const Row(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@@ -322,23 +332,25 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
Theme.of(context).dividerColor.withOpacity(0.05)),
|
Theme.of(context).dividerColor.withOpacity(0.05)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: _ratio[1].toInt(),
|
flex: _ratio[1].toInt(),
|
||||||
child: CustomScrollView(
|
child: Scaffold(
|
||||||
controller: _htmlRenderCtr.scrollController,
|
body: CustomScrollView(
|
||||||
slivers: [
|
controller: _htmlRenderCtr.scrollController,
|
||||||
SliverPadding(
|
slivers: [
|
||||||
padding: EdgeInsets.only(right: padding / 4),
|
SliverPadding(
|
||||||
sliver: SliverToBoxAdapter(
|
padding: EdgeInsets.only(right: padding / 4),
|
||||||
child: replyHeader(),
|
sliver: SliverToBoxAdapter(
|
||||||
|
child: replyHeader(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
SliverPadding(
|
||||||
SliverPadding(
|
padding: EdgeInsets.only(right: padding / 4),
|
||||||
padding: EdgeInsets.only(right: padding / 4),
|
sliver: Obx(
|
||||||
sliver: Obx(
|
() => replyList(
|
||||||
() =>
|
_htmlRenderCtr.loadingState.value),
|
||||||
replyList(_htmlRenderCtr.loadingState.value),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -414,7 +426,8 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
replyItem: loadingState.response.replies[index],
|
replyItem: loadingState.response.replies[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: replyReply,
|
replyReply: (replyItem, id, isTop) =>
|
||||||
|
replyReply(context, replyItem, id, isTop),
|
||||||
replyType: ReplyType.values[type],
|
replyType: ReplyType.values[type],
|
||||||
onReply: () {
|
onReply: () {
|
||||||
_htmlRenderCtr.onReply(
|
_htmlRenderCtr.onReply(
|
||||||
@@ -431,7 +444,8 @@ class _HtmlRenderPageState extends State<HtmlRenderPage>
|
|||||||
replyItem: loadingState.response.replies[index],
|
replyItem: loadingState.response.replies[index],
|
||||||
showReplyRow: true,
|
showReplyRow: true,
|
||||||
replyLevel: '1',
|
replyLevel: '1',
|
||||||
replyReply: replyReply,
|
replyReply: (replyItem, id, isTop) =>
|
||||||
|
replyReply(context, replyItem, id, isTop),
|
||||||
replyType: ReplyType.values[type],
|
replyType: ReplyType.values[type],
|
||||||
onReply: () {
|
onReply: () {
|
||||||
_htmlRenderCtr.onReply(
|
_htmlRenderCtr.onReply(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import 'dart:io';
|
|||||||
|
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:PiliPalaX/models/video/play/url.dart';
|
import 'package:PiliPalaX/models/video/play/url.dart';
|
||||||
import 'package:PiliPalaX/pages/live_room/index.dart';
|
import 'package:PiliPalaX/pages/live_room/index.dart';
|
||||||
import 'package:PiliPalaX/plugin/pl_player/index.dart';
|
import 'package:PiliPalaX/plugin/pl_player/index.dart';
|
||||||
@@ -91,9 +90,7 @@ class _BottomControlState extends State<BottomControl> {
|
|||||||
widget.controller!.hiddenControls(false);
|
widget.controller!.hiddenControls(false);
|
||||||
try {
|
try {
|
||||||
canUsePiP = await widget.floating!.isPipAvailable;
|
canUsePiP = await widget.floating!.isPipAvailable;
|
||||||
} on PlatformException catch (_) {
|
} catch (_) {}
|
||||||
canUsePiP = false;
|
|
||||||
}
|
|
||||||
if (canUsePiP) {
|
if (canUsePiP) {
|
||||||
await widget.floating!.enable(const EnableManual());
|
await widget.floating!.enable(const EnableManual());
|
||||||
} else {}
|
} else {}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
|
|
||||||
import 'package:PiliPalaX/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -120,10 +121,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||||||
// _loginPageCtr.codeInfo.value['data']?['url'] ?? "",
|
// _loginPageCtr.codeInfo.value['data']?['url'] ?? "",
|
||||||
// mode: LaunchMode.externalApplication);
|
// mode: LaunchMode.externalApplication);
|
||||||
// 复制到剪贴板
|
// 复制到剪贴板
|
||||||
Clipboard.setData(ClipboardData(
|
Utils.copyText(
|
||||||
text: _loginPageCtr.codeInfo.value['data']?['url'] ?? ""));
|
_loginPageCtr.codeInfo.value['data']?['url'] ?? '',
|
||||||
SmartDialog.showToast('已复制到剪贴板,可粘贴至已登录的app私信处发送,然后点击已发送的链接打开',
|
toastText: '已复制到剪贴板,可粘贴至已登录的app私信处发送,然后点击已发送的链接打开');
|
||||||
displayTime: const Duration(seconds: 5));
|
|
||||||
},
|
},
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding:
|
||||||
|
|||||||
@@ -454,10 +454,7 @@ class _MemberPageState extends State<MemberPage>
|
|||||||
const SizedBox(width: 5),
|
const SizedBox(width: 5),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(_memberController.mid.toString());
|
||||||
ClipboardData(text: _memberController.mid.toString()),
|
|
||||||
);
|
|
||||||
SmartDialog.showToast('已复制${_memberController.mid}至剪贴板');
|
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding:
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
import 'package:PiliPalaX/common/widgets/loading_widget.dart';
|
||||||
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
import '../../../services/loggeer.dart';
|
import '../../../services/loggeer.dart';
|
||||||
|
|
||||||
class LogsPage extends StatefulWidget {
|
class LogsPage extends StatefulWidget {
|
||||||
@@ -72,25 +71,17 @@ class _LogsPageState extends State<LogsPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void copyLogs() async {
|
void copyLogs() async {
|
||||||
await Clipboard.setData(ClipboardData(text: fileContent));
|
await Utils.copyText(fileContent, needToast: false);
|
||||||
if (context.mounted) {
|
if (mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text('复制成功')),
|
const SnackBar(content: Text('复制成功')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void feedback() {
|
|
||||||
launchUrl(
|
|
||||||
Uri.parse('https://github.com/bggRGjQaUbCoE/PiliPalaX/issues'),
|
|
||||||
// 系统自带浏览器打开
|
|
||||||
mode: LaunchMode.externalApplication,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void clearLogsHandle() async {
|
void clearLogsHandle() async {
|
||||||
if (await clearLogs()) {
|
if (await clearLogs()) {
|
||||||
if (context.mounted) {
|
if (mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
const SnackBar(content: Text('已清空')),
|
const SnackBar(content: Text('已清空')),
|
||||||
);
|
);
|
||||||
@@ -114,7 +105,8 @@ class _LogsPageState extends State<LogsPage> {
|
|||||||
copyLogs();
|
copyLogs();
|
||||||
break;
|
break;
|
||||||
case 'feedback':
|
case 'feedback':
|
||||||
feedback();
|
Utils.launchURL(
|
||||||
|
'https://github.com/bggRGjQaUbCoE/PiliPalaX/issues');
|
||||||
break;
|
break;
|
||||||
case 'clear':
|
case 'clear':
|
||||||
clearLogsHandle();
|
clearLogsHandle();
|
||||||
@@ -160,9 +152,7 @@ class _LogsPageState extends State<LogsPage> {
|
|||||||
),
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
await Clipboard.setData(
|
await Utils.copyText(log['body'], needToast: false);
|
||||||
ClipboardData(text: log['body']),
|
|
||||||
);
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(
|
SnackBar(
|
||||||
|
|||||||
@@ -434,8 +434,7 @@ class VideoIntroController extends GetxController
|
|||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
Clipboard.setData(ClipboardData(text: videoUrl));
|
Utils.copyText(videoUrl);
|
||||||
SmartDialog.showToast('已复制');
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
|
|||||||
@@ -1008,9 +1008,8 @@ class MorePanel extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'copyAll':
|
case 'copyAll':
|
||||||
await Clipboard.setData(ClipboardData(text: message));
|
|
||||||
SmartDialog.showToast('已复制');
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
Utils.copyText(message);
|
||||||
break;
|
break;
|
||||||
case 'copyFreedom':
|
case 'copyFreedom':
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@@ -1059,9 +1059,8 @@ class ReplyItemGrpc extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'copyAll':
|
case 'copyAll':
|
||||||
await Clipboard.setData(ClipboardData(text: message));
|
|
||||||
SmartDialog.showToast('已复制');
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
Utils.copyText(message);
|
||||||
break;
|
break;
|
||||||
case 'copyFreedom':
|
case 'copyFreedom':
|
||||||
Get.back();
|
Get.back();
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import 'package:PiliPalaX/utils/utils.dart';
|
|||||||
import 'package:auto_orientation/auto_orientation.dart';
|
import 'package:auto_orientation/auto_orientation.dart';
|
||||||
import 'package:easy_debounce/easy_throttle.dart';
|
import 'package:easy_debounce/easy_throttle.dart';
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/services.dart';
|
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -164,15 +163,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
appbarStreamListen();
|
appbarStreamListen();
|
||||||
// lifecycleListener();
|
// lifecycleListener();
|
||||||
autoScreen();
|
autoScreen();
|
||||||
Utils.channel.setMethodCallHandler((call) async {
|
if (Platform.isAndroid) {
|
||||||
if (call.method == 'onUserLeaveHint') {
|
Utils.channel.setMethodCallHandler((call) async {
|
||||||
if (autoPiP &&
|
if (call.method == 'onUserLeaveHint') {
|
||||||
plPlayerController?.playerStatus.status.value ==
|
if (autoPiP &&
|
||||||
PlayerStatus.playing) {
|
plPlayerController?.playerStatus.status.value ==
|
||||||
enterPip();
|
PlayerStatus.playing) {
|
||||||
|
enterPip();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
// _animationController = AnimationController(
|
// _animationController = AnimationController(
|
||||||
// vsync: this,
|
// vsync: this,
|
||||||
// duration: const Duration(milliseconds: 300),
|
// duration: const Duration(milliseconds: 300),
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import 'dart:math';
|
|||||||
import 'package:PiliPalaX/pages/setting/widgets/switch_item.dart';
|
import 'package:PiliPalaX/pages/setting/widgets/switch_item.dart';
|
||||||
import 'package:PiliPalaX/utils/extension.dart';
|
import 'package:PiliPalaX/utils/extension.dart';
|
||||||
import 'package:PiliPalaX/utils/id_utils.dart';
|
import 'package:PiliPalaX/utils/id_utils.dart';
|
||||||
|
import 'package:PiliPalaX/utils/utils.dart';
|
||||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@@ -340,11 +341,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
'${player.state.width}x${player.state.height}'),
|
'${player.state.width}x${player.state.height}'),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'Resolution\n${player.state.width}x${player.state.height}',
|
||||||
text:
|
needToast: false,
|
||||||
"Resolution\n${player.state.width}x${player.state.height}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -355,11 +354,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.state.videoParams
|
.state.videoParams
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'VideoParams\n${player.state.videoParams}',
|
||||||
text:
|
needToast: false,
|
||||||
"VideoParams\n${player.state.videoParams}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -370,11 +367,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.state.audioParams
|
.state.audioParams
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'AudioParams\n${player.state.audioParams}',
|
||||||
text:
|
needToast: false,
|
||||||
"AudioParams\n${player.state.audioParams}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -384,11 +379,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
player.state.playlist.toString()),
|
player.state.playlist.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'Media\n${player.state.playlist}',
|
||||||
text:
|
needToast: false,
|
||||||
"Media\n${player.state.playlist}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -399,11 +392,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.state.track.audio
|
.state.track.audio
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'AudioTrack\n${player.state.track.audio}',
|
||||||
text:
|
needToast: false,
|
||||||
"AudioTrack\n${player.state.track.audio}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -414,11 +405,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.state.track.video
|
.state.track.video
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'VideoTrack\n${player.state.track.audio}',
|
||||||
text:
|
needToast: false,
|
||||||
"VideoTrack\n${player.state.track.audio}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -428,11 +417,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
player.state.pitch.toString()),
|
player.state.pitch.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'pitch\n${player.state.pitch}',
|
||||||
text:
|
needToast: false,
|
||||||
"pitch\n${player.state.pitch}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -441,11 +428,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
player.state.rate.toString()),
|
player.state.rate.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'rate\n${player.state.rate}',
|
||||||
text:
|
needToast: false,
|
||||||
"rate\n${player.state.rate}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
ListTile(
|
ListTile(
|
||||||
@@ -455,11 +440,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.state.audioBitrate
|
.state.audioBitrate
|
||||||
.toString()),
|
.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'AudioBitrate\n${player.state.audioBitrate}',
|
||||||
text:
|
needToast: false,
|
||||||
"AudioBitrate\n${player.state.audioBitrate}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@@ -469,11 +452,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
player.state.volume.toString()),
|
player.state.volume.toString()),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Clipboard.setData(
|
Utils.copyText(
|
||||||
ClipboardData(
|
'Volume\n${player.state.volume}',
|
||||||
text:
|
needToast: false,
|
||||||
"Volume\n${player.state.volume}",
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import 'package:PiliPalaX/utils/feed_back.dart';
|
|||||||
import 'package:PiliPalaX/utils/login.dart';
|
import 'package:PiliPalaX/utils/login.dart';
|
||||||
import 'package:PiliPalaX/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
import 'package:crypto/crypto.dart';
|
import 'package:crypto/crypto.dart';
|
||||||
import 'package:device_info_plus/device_info_plus.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
@@ -437,9 +436,15 @@ class Utils {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void copyText(String text) {
|
static Future copyText(
|
||||||
|
String text, {
|
||||||
|
bool needToast = true,
|
||||||
|
String? toastText,
|
||||||
|
}) async {
|
||||||
Clipboard.setData(ClipboardData(text: text));
|
Clipboard.setData(ClipboardData(text: text));
|
||||||
SmartDialog.showToast('已复制');
|
if (needToast) {
|
||||||
|
SmartDialog.showToast(toastText ?? '已复制');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static launchURL(String url) async {
|
static launchURL(String url) async {
|
||||||
@@ -766,9 +771,9 @@ class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 版本对比
|
// 版本对比
|
||||||
static bool needUpdate(localVersion, remoteVersion) {
|
// static bool needUpdate(localVersion, remoteVersion) {
|
||||||
return localVersion != remoteVersion;
|
// return localVersion != remoteVersion;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 检查更新
|
// 检查更新
|
||||||
// static Future<bool> checkUpdate() async {
|
// static Future<bool> checkUpdate() async {
|
||||||
@@ -859,29 +864,26 @@ class Utils {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 下载适用于当前系统的安装包
|
// 下载适用于当前系统的安装包
|
||||||
static Future matchVersion(data) async {
|
// static Future matchVersion(data) async {
|
||||||
await SmartDialog.dismiss();
|
// await SmartDialog.dismiss();
|
||||||
// 获取设备信息
|
// // 获取设备信息
|
||||||
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
// DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
|
||||||
if (Platform.isAndroid) {
|
// if (Platform.isAndroid) {
|
||||||
AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
// AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
|
||||||
// [arm64-v8a]
|
// // [arm64-v8a]
|
||||||
String abi = androidInfo.supportedAbis.first;
|
// String abi = androidInfo.supportedAbis.first;
|
||||||
late String downloadUrl;
|
// late String downloadUrl;
|
||||||
if (data.assets.isNotEmpty) {
|
// if (data.assets.isNotEmpty) {
|
||||||
for (var i in data.assets) {
|
// for (var i in data.assets) {
|
||||||
if (i.downloadUrl.contains(abi)) {
|
// if (i.downloadUrl.contains(abi)) {
|
||||||
downloadUrl = i.downloadUrl;
|
// downloadUrl = i.downloadUrl;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
// 应用外下载
|
// // 应用外下载
|
||||||
launchUrl(
|
// launchURL(downloadUrl);
|
||||||
Uri.parse(downloadUrl),
|
// }
|
||||||
mode: LaunchMode.externalApplication,
|
// }
|
||||||
);
|
// }
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 时间戳转时间
|
// 时间戳转时间
|
||||||
static tampToSeektime(number) {
|
static tampToSeektime(number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user