mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 08:08:19 +08:00
opt share video link (#1835)
* feat: share video with current time position preference * simplify --------- Co-authored-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
|
import 'package:PiliPlus/common/widgets/button/icon_button.dart';
|
||||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||||
import 'package:PiliPlus/http/api.dart';
|
import 'package:PiliPlus/http/api.dart';
|
||||||
import 'package:PiliPlus/http/constants.dart';
|
import 'package:PiliPlus/http/constants.dart';
|
||||||
@@ -299,8 +300,8 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
@override
|
@override
|
||||||
void actionShareVideo(BuildContext context) {
|
void actionShareVideo(BuildContext context) {
|
||||||
final videoDetail = this.videoDetail.value;
|
final videoDetail = this.videoDetail.value;
|
||||||
String videoUrl =
|
final playedTimePos = videoDetailCtr.playedTimePos;
|
||||||
'${HttpString.baseUrl}/video/$bvid${videoDetailCtr.playedTimePos}';
|
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (_) => AlertDialog(
|
builder: (_) => AlertDialog(
|
||||||
@@ -319,6 +320,16 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
|||||||
Get.back();
|
Get.back();
|
||||||
Utils.copyText(videoUrl);
|
Utils.copyText(videoUrl);
|
||||||
},
|
},
|
||||||
|
trailing: playedTimePos.isNotEmpty
|
||||||
|
? iconButton(
|
||||||
|
tooltip: '精确分享',
|
||||||
|
icon: const Icon(Icons.timer_outlined),
|
||||||
|
onPressed: () {
|
||||||
|
Get.back();
|
||||||
|
Utils.copyText('$videoUrl$playedTimePos');
|
||||||
|
},
|
||||||
|
)
|
||||||
|
: null,
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: true,
|
dense: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user