mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
@@ -1,10 +0,0 @@
|
||||
视频详情页预渲染
|
||||
+ videoItem
|
||||
+ title
|
||||
+ stat
|
||||
+ view
|
||||
+ danmaku
|
||||
+ pubdate
|
||||
+ owner
|
||||
+ face
|
||||
+ name
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -16,12 +16,17 @@ import 'package:PiliPlus/models/common/sponsor_block/skip_type.dart';
|
||||
import 'package:PiliPlus/models/video/later.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/note/note_list_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/post_panel/post_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/widgets/send_danmaku_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/widgets/media_list_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/note/view.dart';
|
||||
import 'package:PiliPlus/pages/video/post_panel/view.dart';
|
||||
import 'package:PiliPlus/pages/video/send_danmaku/view.dart';
|
||||
import 'package:PiliPlus/pages/video/medialist/view.dart';
|
||||
import 'package:PiliPlus/pages/video/widgets/header_control.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/data_source.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
@@ -36,7 +41,6 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/video/play/quality.dart';
|
||||
import 'package:PiliPlus/models/video/play/url.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
@@ -45,9 +49,6 @@ import 'package:hive/hive.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
|
||||
import '../../../utils/id_utils.dart';
|
||||
import 'widgets/header_control.dart';
|
||||
|
||||
class VideoDetailController extends GetxController
|
||||
with GetTickerProviderStateMixin {
|
||||
/// 路由传参
|
||||
@@ -1,4 +0,0 @@
|
||||
library video_detail;
|
||||
|
||||
export './controller.dart';
|
||||
export './view_v.dart';
|
||||
@@ -1,4 +0,0 @@
|
||||
library video_intro_panel;
|
||||
|
||||
export './controller.dart';
|
||||
export './view.dart';
|
||||
@@ -1,394 +0,0 @@
|
||||
import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/http/msg.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_cropper/image_cropper.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
class CreateFavPage extends StatefulWidget {
|
||||
const CreateFavPage({super.key});
|
||||
|
||||
@override
|
||||
State<CreateFavPage> createState() => _CreateFavPageState();
|
||||
}
|
||||
|
||||
class _CreateFavPageState extends State<CreateFavPage> {
|
||||
dynamic _mediaId;
|
||||
late final _titleController = TextEditingController();
|
||||
late final _introController = TextEditingController();
|
||||
String? _cover;
|
||||
bool _isPublic = true;
|
||||
late final _imagePicker = ImagePicker();
|
||||
String? _errMsg;
|
||||
int? _attr;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_mediaId = Get.parameters['mediaId'];
|
||||
if (_mediaId != null) {
|
||||
_getFolderInfo();
|
||||
}
|
||||
}
|
||||
|
||||
void _getFolderInfo() {
|
||||
UserHttp.folderInfo(mediaId: _mediaId).then((data) {
|
||||
if (data['status']) {
|
||||
_titleController.text = data['data']['title'];
|
||||
_introController.text = data['data']['intro'];
|
||||
_isPublic = Utils.isPublicFav(data['data']['attr']);
|
||||
_cover = data['data']['cover'];
|
||||
_attr = data['data']['attr'];
|
||||
} else {
|
||||
_errMsg = data['msg'];
|
||||
}
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_titleController.dispose();
|
||||
_introController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(_mediaId != null ? '编辑' : '创建'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (_titleController.text.isEmpty) {
|
||||
SmartDialog.showToast('名称不能为空');
|
||||
return;
|
||||
}
|
||||
UserHttp.addOrEditFolder(
|
||||
isAdd: _mediaId == null,
|
||||
mediaId: _mediaId,
|
||||
title: _titleController.text,
|
||||
privacy: _isPublic ? 0 : 1,
|
||||
cover: _cover ?? '',
|
||||
intro: _introController.text,
|
||||
).then((data) {
|
||||
if (data['status']) {
|
||||
Get.back(result: data['data']);
|
||||
SmartDialog.showToast('${_mediaId != null ? '编辑' : '创建'}成功');
|
||||
} else {
|
||||
SmartDialog.showToast(data['msg']);
|
||||
}
|
||||
});
|
||||
},
|
||||
child: const Text('完成'),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
),
|
||||
body: _mediaId != null
|
||||
? _titleController.text.isNotEmpty
|
||||
? _buildBody(theme)
|
||||
: _errMsg?.isNotEmpty == true
|
||||
? Center(
|
||||
child: CustomScrollView(
|
||||
shrinkWrap: true,
|
||||
slivers: [
|
||||
HttpError(
|
||||
errMsg: _errMsg,
|
||||
onReload: _getFolderInfo,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Center(child: CircularProgressIndicator())
|
||||
: _buildBody(theme),
|
||||
);
|
||||
}
|
||||
|
||||
void _pickImg(ThemeData theme) async {
|
||||
try {
|
||||
XFile? pickedFile = await _imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFile != null && mounted) {
|
||||
CroppedFile? croppedFile = await ImageCropper().cropImage(
|
||||
sourcePath: pickedFile.path,
|
||||
uiSettings: [
|
||||
AndroidUiSettings(
|
||||
toolbarTitle: '裁剪',
|
||||
toolbarColor: theme.colorScheme.secondaryContainer,
|
||||
toolbarWidgetColor: theme.colorScheme.onSecondaryContainer,
|
||||
aspectRatioPresets: [
|
||||
CropAspectRatioPreset.ratio16x9,
|
||||
],
|
||||
lockAspectRatio: true,
|
||||
hideBottomControls: true,
|
||||
initAspectRatio: CropAspectRatioPreset.ratio16x9,
|
||||
),
|
||||
IOSUiSettings(
|
||||
title: '裁剪',
|
||||
aspectRatioPresets: [
|
||||
CropAspectRatioPreset.ratio16x9,
|
||||
],
|
||||
aspectRatioLockEnabled: true,
|
||||
resetAspectRatioEnabled: false,
|
||||
aspectRatioPickerButtonHidden: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
if (croppedFile != null) {
|
||||
MsgHttp.uploadImage(
|
||||
path: croppedFile.path,
|
||||
bucket: 'medialist',
|
||||
dir: 'cover',
|
||||
).then((data) {
|
||||
if (data['status']) {
|
||||
_cover = data['data']['location'];
|
||||
setState(() {});
|
||||
} else {
|
||||
SmartDialog.showToast(data['msg']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
dynamic leadingStyle = TextStyle(fontSize: 14);
|
||||
|
||||
Widget _buildBody(ThemeData theme) => SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
if (_attr == null || !Utils.isDefaultFav(_attr!)) ...[
|
||||
ListTile(
|
||||
tileColor: theme.colorScheme.onInverseSurface,
|
||||
onTap: () {
|
||||
EasyThrottle.throttle(
|
||||
'imagePicker', const Duration(milliseconds: 500),
|
||||
() async {
|
||||
if (_cover?.isNotEmpty == true) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding:
|
||||
const EdgeInsets.fromLTRB(0, 12, 0, 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
_pickImg(theme);
|
||||
},
|
||||
title: const Text(
|
||||
'替换封面',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
_cover = null;
|
||||
setState(() {});
|
||||
},
|
||||
title: const Text(
|
||||
'移除封面',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
_pickImg(theme);
|
||||
}
|
||||
});
|
||||
},
|
||||
leading: Text(
|
||||
'封面',
|
||||
style: leadingStyle,
|
||||
),
|
||||
trailing: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if (_cover?.isNotEmpty == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
return ClipRRect(
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: Utils.thumbnailImgUrl(_cover!),
|
||||
height: constraints.maxHeight,
|
||||
width: constraints.maxHeight * 16 / 9,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Icon(
|
||||
Icons.keyboard_arrow_right,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
ListTile(
|
||||
tileColor: theme.colorScheme.onInverseSurface,
|
||||
leading: Text.rich(
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '*',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
height: 1,
|
||||
color: theme.colorScheme.error,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '名称',
|
||||
style: TextStyle(
|
||||
height: 1,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
title: TextField(
|
||||
autofocus: true,
|
||||
readOnly: _attr != null && Utils.isDefaultFav(_attr!),
|
||||
controller: _titleController,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: _attr != null && Utils.isDefaultFav(_attr!)
|
||||
? theme.colorScheme.outline
|
||||
: null,
|
||||
),
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: '名称',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
gapPadding: 0,
|
||||
),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
if (_attr == null || !Utils.isDefaultFav(_attr!)) ...[
|
||||
ListTile(
|
||||
tileColor: theme.colorScheme.onInverseSurface,
|
||||
title: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '简介',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: '*',
|
||||
style: TextStyle(color: Colors.transparent),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: TextField(
|
||||
minLines: 6,
|
||||
maxLines: 6,
|
||||
controller: _introController,
|
||||
style: TextStyle(fontSize: 14),
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(200),
|
||||
],
|
||||
decoration: InputDecoration(
|
||||
isDense: true,
|
||||
hintText: '可填写简介',
|
||||
hintStyle: TextStyle(
|
||||
fontSize: 14,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
border: OutlineInputBorder(
|
||||
borderSide: BorderSide.none,
|
||||
gapPadding: 0,
|
||||
),
|
||||
contentPadding: EdgeInsets.all(0),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
ListTile(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_isPublic = !_isPublic;
|
||||
});
|
||||
},
|
||||
tileColor: theme.colorScheme.onInverseSurface,
|
||||
leading: Text(
|
||||
'公开',
|
||||
style: leadingStyle,
|
||||
),
|
||||
trailing: Transform.scale(
|
||||
alignment: Alignment.centerRight,
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
value: _isPublic,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
_isPublic = value;
|
||||
});
|
||||
}),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
|
||||
import '../../../../../utils/utils.dart';
|
||||
|
||||
class FavPanel extends StatefulWidget {
|
||||
const FavPanel({
|
||||
super.key,
|
||||
this.ctr,
|
||||
this.scrollController,
|
||||
});
|
||||
|
||||
final dynamic ctr;
|
||||
final ScrollController? scrollController;
|
||||
|
||||
@override
|
||||
State<FavPanel> createState() => _FavPanelState();
|
||||
}
|
||||
|
||||
class _FavPanelState extends State<FavPanel> {
|
||||
late Future _futureBuilderFuture;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_futureBuilderFuture = widget.ctr.queryVideoInFolder();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return NotificationListener<DraggableScrollableNotification>(
|
||||
onNotification: (notification) {
|
||||
if (notification.extent <= 1e-5) {
|
||||
Get.back();
|
||||
}
|
||||
return false;
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
leading: IconButton(
|
||||
tooltip: '关闭',
|
||||
onPressed: Get.back,
|
||||
icon: const Icon(Icons.close_outlined),
|
||||
),
|
||||
title: const Text('添加到收藏夹'),
|
||||
actions: [
|
||||
TextButton.icon(
|
||||
onPressed: () {
|
||||
Get.toNamed('/createFav')?.then((data) {
|
||||
if (data != null) {
|
||||
(widget.ctr?.favFolderData.value as FavFolderData?)
|
||||
?.list
|
||||
?.insert(1, data);
|
||||
widget.ctr?.favFolderData.refresh();
|
||||
}
|
||||
});
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
label: const Text('新建收藏夹'),
|
||||
style: TextButton.styleFrom(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 18, vertical: 14),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: -2,
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
// TODO: refactor
|
||||
if (snapshot.data is! Map) {
|
||||
return HttpError(
|
||||
isSliver: false,
|
||||
onReload: () => setState(() {
|
||||
_futureBuilderFuture = widget.ctr.queryVideoInFolder();
|
||||
}),
|
||||
);
|
||||
}
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['status']) {
|
||||
return Obx(
|
||||
() => Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView.builder(
|
||||
controller: widget.scrollController,
|
||||
itemCount: widget.ctr.favFolderData.value.list.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
onTap: () => widget.ctr.onChoose(
|
||||
widget.ctr.favFolderData.value.list[index]
|
||||
.favState !=
|
||||
1,
|
||||
index),
|
||||
dense: true,
|
||||
leading: Utils.isPublicFav(widget
|
||||
.ctr.favFolderData.value.list[index].attr)
|
||||
? const Icon(Icons.folder_outlined)
|
||||
: const Icon(Icons.lock_outline),
|
||||
minLeadingWidth: 0,
|
||||
title: Text(widget
|
||||
.ctr.favFolderData.value.list[index].title!),
|
||||
subtitle: Text(
|
||||
'${widget.ctr.favFolderData.value.list[index].mediaCount}个内容 . ${Utils.isPublicFavText(widget.ctr.favFolderData.value.list[index].attr)}',
|
||||
),
|
||||
trailing: Transform.scale(
|
||||
scale: 0.9,
|
||||
child: Checkbox(
|
||||
value: widget.ctr.favFolderData.value
|
||||
.list[index].favState ==
|
||||
1,
|
||||
onChanged: (bool? checkValue) =>
|
||||
widget.ctr.onChoose(checkValue!, index),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return CustomScrollView(
|
||||
controller: widget.scrollController,
|
||||
slivers: [
|
||||
HttpError(
|
||||
errMsg: data['msg'],
|
||||
onReload: () => setState(() {
|
||||
_futureBuilderFuture =
|
||||
widget.ctr.queryVideoInFolder();
|
||||
}),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: theme.disabledColor.withOpacity(0.08),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 12,
|
||||
bottom: MediaQuery.of(context).padding.bottom + 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Get.back(),
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: -1,
|
||||
vertical: -2,
|
||||
),
|
||||
foregroundColor: theme.colorScheme.outline,
|
||||
backgroundColor: theme.colorScheme.onInverseSurface,
|
||||
),
|
||||
child: const Text('取消'),
|
||||
),
|
||||
const SizedBox(width: 25),
|
||||
FilledButton.tonal(
|
||||
onPressed: () async {
|
||||
feedBack();
|
||||
await widget.ctr.actionFavVideo();
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20, vertical: 10),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: -1,
|
||||
vertical: -2,
|
||||
),
|
||||
),
|
||||
child: const Text('完成'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,191 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/http/member.dart';
|
||||
import 'package:PiliPlus/models/member/tags.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
|
||||
class GroupPanel extends StatefulWidget {
|
||||
final int? mid;
|
||||
final List? tags;
|
||||
final ScrollController? scrollController;
|
||||
const GroupPanel({
|
||||
super.key,
|
||||
this.mid,
|
||||
this.tags,
|
||||
this.scrollController,
|
||||
});
|
||||
|
||||
@override
|
||||
State<GroupPanel> createState() => _GroupPanelState();
|
||||
}
|
||||
|
||||
class _GroupPanelState extends State<GroupPanel> {
|
||||
late Future _futureBuilderFuture;
|
||||
late List<MemberTagItemModel> tagsList;
|
||||
bool showDefaultBtn = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_futureBuilderFuture = MemberHttp.followUpTags();
|
||||
() async {
|
||||
dynamic result = await _futureBuilderFuture;
|
||||
if (result['status']) {
|
||||
tagsList = result['data'];
|
||||
tagsList.removeWhere((item) => item.tagid == 0);
|
||||
tagsList = tagsList.map((item) {
|
||||
return item..checked = widget.tags?.contains(item.tagid) == true;
|
||||
}).toList();
|
||||
setState(() {
|
||||
showDefaultBtn = !tagsList.any((e) => e.checked == true);
|
||||
});
|
||||
}
|
||||
}();
|
||||
}
|
||||
|
||||
void onSave() async {
|
||||
feedBack();
|
||||
// 是否有选中的 有选中的带id,没选使用默认0
|
||||
final bool anyHasChecked =
|
||||
tagsList.any((MemberTagItemModel e) => e.checked == true);
|
||||
late List<int> tagidList;
|
||||
if (anyHasChecked) {
|
||||
final List<MemberTagItemModel> checkedList =
|
||||
tagsList.where((MemberTagItemModel e) => e.checked == true).toList();
|
||||
tagidList = checkedList.map<int>((e) => e.tagid!).toList();
|
||||
} else {
|
||||
tagidList = [0];
|
||||
}
|
||||
// 保存
|
||||
final res = await MemberHttp.addUsers([widget.mid], tagidList);
|
||||
SmartDialog.showToast(res['msg']);
|
||||
if (res['status']) {
|
||||
Get.back(result: tagidList);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return NotificationListener<DraggableScrollableNotification>(
|
||||
onNotification: (notification) {
|
||||
if (notification.extent <= 1e-5) {
|
||||
Get.back();
|
||||
}
|
||||
return false;
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
leading: IconButton(
|
||||
tooltip: '关闭',
|
||||
onPressed: Get.back,
|
||||
icon: const Icon(Icons.close_outlined)),
|
||||
title: const Text('设置关注分组'),
|
||||
),
|
||||
Expanded(
|
||||
child: FutureBuilder(
|
||||
future: _futureBuilderFuture,
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
if (snapshot.connectionState == ConnectionState.done) {
|
||||
// TODO: refactor
|
||||
if (snapshot.data is! Map) {
|
||||
return HttpError(
|
||||
isSliver: false,
|
||||
onReload: () => setState(() {
|
||||
_futureBuilderFuture = MemberHttp.followUpTags();
|
||||
}),
|
||||
);
|
||||
}
|
||||
Map data = snapshot.data as Map;
|
||||
if (data['status']) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: ListView.builder(
|
||||
controller: widget.scrollController,
|
||||
itemCount: tagsList.length,
|
||||
itemBuilder: (context, index) {
|
||||
return ListTile(
|
||||
onTap: () {
|
||||
tagsList[index].checked =
|
||||
!tagsList[index].checked!;
|
||||
showDefaultBtn =
|
||||
!tagsList.any((e) => e.checked == true);
|
||||
setState(() {});
|
||||
},
|
||||
dense: true,
|
||||
leading: const Icon(Icons.group_outlined),
|
||||
minLeadingWidth: 0,
|
||||
title: Text(tagsList[index].name ?? ''),
|
||||
subtitle: tagsList[index].tip != ''
|
||||
? Text(tagsList[index].tip ?? '')
|
||||
: null,
|
||||
trailing: Transform.scale(
|
||||
scale: 0.9,
|
||||
child: Checkbox(
|
||||
value: tagsList[index].checked,
|
||||
onChanged: (bool? checkValue) {
|
||||
tagsList[index].checked = checkValue;
|
||||
showDefaultBtn =
|
||||
!tagsList.any((e) => e.checked == true);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return CustomScrollView(
|
||||
controller: widget.scrollController,
|
||||
slivers: [
|
||||
HttpError(
|
||||
errMsg: data['msg'],
|
||||
onReload: () => setState(() {}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Divider(
|
||||
height: 1,
|
||||
color: theme.disabledColor.withOpacity(0.08),
|
||||
),
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20,
|
||||
right: 20,
|
||||
top: 12,
|
||||
bottom: MediaQuery.of(context).padding.bottom + 12,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
TextButton(
|
||||
onPressed: () => onSave(),
|
||||
style: TextButton.styleFrom(
|
||||
padding: const EdgeInsets.only(left: 30, right: 30),
|
||||
foregroundColor: theme.colorScheme.onPrimary,
|
||||
backgroundColor: theme.colorScheme.primary,
|
||||
),
|
||||
child: Text(showDefaultBtn ? '保存至默认分组' : '保存'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
library releated_video_panel;
|
||||
|
||||
export './controller.dart';
|
||||
export './view.dart';
|
||||
@@ -1,4 +0,0 @@
|
||||
library video_reply_panel;
|
||||
|
||||
export './controller.dart';
|
||||
export './view.dart';
|
||||
@@ -1,40 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ToolbarIconButton extends StatelessWidget {
|
||||
final VoidCallback? onPressed;
|
||||
final Icon icon;
|
||||
final bool selected;
|
||||
final String? tooltip;
|
||||
|
||||
const ToolbarIconButton({
|
||||
super.key,
|
||||
this.onPressed,
|
||||
required this.icon,
|
||||
required this.selected,
|
||||
this.tooltip,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
return SizedBox(
|
||||
width: 36,
|
||||
height: 36,
|
||||
child: IconButton(
|
||||
tooltip: tooltip,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
highlightColor: theme.colorScheme.secondaryContainer,
|
||||
color: selected
|
||||
? theme.colorScheme.onSecondaryContainer
|
||||
: theme.colorScheme.outline,
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
return selected ? theme.colorScheme.secondaryContainer : null;
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
library video_reply_reply_panel;
|
||||
|
||||
export './controller.dart';
|
||||
export './view.dart';
|
||||
629
lib/pages/video/introduction/pgc/controller.dart
Normal file
629
lib/pages/video/introduction/pgc/controller.dart
Normal file
@@ -0,0 +1,629 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/pages/common/common_data_controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/pay_coins/view.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:html/parser.dart' as html_parser;
|
||||
import 'package:html/dom.dart' as dom;
|
||||
|
||||
class BangumiIntroController
|
||||
extends CommonDataController<BangumiInfoModel, BangumiInfoModel> {
|
||||
// 视频bvid
|
||||
String bvid = Get.parameters['bvid'] ?? '';
|
||||
var seasonId = Get.parameters['seasonId'] != null
|
||||
? int.tryParse(Get.parameters['seasonId']!)
|
||||
: null;
|
||||
var epId = Get.parameters['epId'] != null
|
||||
? int.tryParse(Get.parameters['epId']!)
|
||||
: null;
|
||||
|
||||
late dynamic type =
|
||||
Get.parameters['type'] == '1' || Get.parameters['type'] == '4'
|
||||
? '追番'
|
||||
: '追剧';
|
||||
|
||||
// 是否预渲染 骨架屏
|
||||
bool preRender = false;
|
||||
|
||||
// 视频详情 上个页面传入
|
||||
Map? videoItem = {};
|
||||
BangumiInfoModel? bangumiItem;
|
||||
|
||||
// up主粉丝数
|
||||
Map userStat = {'follower': '-'};
|
||||
|
||||
// 是否点赞
|
||||
RxBool hasLike = false.obs;
|
||||
// 投币数量
|
||||
final RxInt _coinNum = 0.obs;
|
||||
// 是否投币
|
||||
bool get hasCoin => _coinNum.value != 0;
|
||||
// 是否收藏
|
||||
RxBool hasFav = false.obs;
|
||||
dynamic videoTags;
|
||||
bool isLogin = false;
|
||||
Rx<FavFolderData> favFolderData = FavFolderData().obs;
|
||||
List? favIds;
|
||||
dynamic userInfo;
|
||||
|
||||
late final enableQuickFav =
|
||||
GStorage.setting.get(SettingBoxKey.enableQuickFav, defaultValue: false);
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
if (Get.arguments.isNotEmpty as bool) {
|
||||
if (Get.arguments.containsKey('bangumiItem') as bool) {
|
||||
preRender = true;
|
||||
bangumiItem = Get.arguments['bangumiItem'];
|
||||
}
|
||||
}
|
||||
userInfo = GStorage.userInfo.get('userInfoCache');
|
||||
isLogin = userInfo != null;
|
||||
|
||||
if (isLogin && epId != null) {
|
||||
queryBangumiLikeCoinFav();
|
||||
}
|
||||
|
||||
queryData();
|
||||
|
||||
if (isLogin && seasonId != null) {
|
||||
queryIsFollowed();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future queryData([bool isRefresh = true]) async {
|
||||
await queryVideoTags();
|
||||
return super.queryData(isRefresh);
|
||||
}
|
||||
|
||||
Future queryVideoTags() async {
|
||||
var result = await UserHttp.videoTags(bvid: bvid);
|
||||
if (result['status']) {
|
||||
videoTags = result['data'];
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
bool customHandleResponse(
|
||||
bool isRefresh, Success<BangumiInfoModel> response) {
|
||||
epId ??= response.response.episodes?.firstOrNull?.id;
|
||||
loadingState.value = response;
|
||||
return true;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState<BangumiInfoModel>> customGetData() =>
|
||||
SearchHttp.bangumiInfoNew(seasonId: seasonId, epId: epId);
|
||||
|
||||
// 获取点赞/投币/收藏状态
|
||||
Future queryBangumiLikeCoinFav() async {
|
||||
var result = await VideoHttp.bangumiLikeCoinFav(epId: epId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]['like'] == 1;
|
||||
_coinNum.value = result["data"]['coin_number'];
|
||||
hasFav.value = result["data"]['favorite'] == 1;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
// (取消)点赞
|
||||
Future actionLikeVideo() async {
|
||||
var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value);
|
||||
if (result['status']) {
|
||||
SmartDialog.showToast(!hasLike.value ? result['data']['toast'] : '取消赞');
|
||||
BangumiInfoModel bangumiDetail = (loadingState.value as Success).response;
|
||||
bangumiDetail.stat!['likes'] =
|
||||
bangumiDetail.stat!['likes'] + (!hasLike.value ? 1 : -1);
|
||||
hasLike.value = !hasLike.value;
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
void coinVideo(int coin, [bool selectLike = false]) async {
|
||||
var res = await VideoHttp.coinVideo(
|
||||
bvid: bvid,
|
||||
multiply: coin,
|
||||
selectLike: selectLike ? 1 : 0,
|
||||
);
|
||||
if (res['status']) {
|
||||
SmartDialog.showToast('投币成功');
|
||||
BangumiInfoModel bangumiDetail = (loadingState.value as Success).response;
|
||||
bangumiDetail.stat!['coins'] = bangumiDetail.stat!['coins'] + coin;
|
||||
if (selectLike && hasLike.value.not) {
|
||||
hasLike.value = true;
|
||||
bangumiDetail.stat!['likes'] = bangumiDetail.stat!['likes'] + 1;
|
||||
}
|
||||
_coinNum.value += coin;
|
||||
GlobalData().afterCoin(coin);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
// 投币
|
||||
Future actionCoinVideo() async {
|
||||
if (userInfo == null) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
|
||||
if (_coinNum.value >= 2) {
|
||||
SmartDialog.showToast('达到投币上限啦~');
|
||||
return;
|
||||
}
|
||||
|
||||
if (GlobalData().coins != null && GlobalData().coins! < 1) {
|
||||
SmartDialog.showToast('硬币不足');
|
||||
return;
|
||||
}
|
||||
|
||||
PayCoinsPage.toPayCoinsPage(
|
||||
onPayCoin: coinVideo,
|
||||
hasCoin: _coinNum.value == 1,
|
||||
);
|
||||
}
|
||||
|
||||
// (取消)收藏 bangumi
|
||||
Future actionFavVideo({type = 'choose'}) async {
|
||||
// 收藏至默认文件夹
|
||||
if (type == 'default') {
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
queryVideoInFolder().then((res) async {
|
||||
if (res['status']) {
|
||||
int defaultFolderId = favFolderData.value.list!.first.id!;
|
||||
int favStatus = favFolderData.value.list!.first.favState!;
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: epId,
|
||||
type: 24,
|
||||
addIds: favStatus == 0 ? '$defaultFolderId' : '',
|
||||
delIds: favStatus == 1 ? '$defaultFolderId' : '',
|
||||
);
|
||||
SmartDialog.dismiss();
|
||||
if (result['status']) {
|
||||
// 重新获取收藏状态
|
||||
await Future.delayed(const Duration(milliseconds: 255));
|
||||
await queryBangumiLikeCoinFav();
|
||||
SmartDialog.showToast('✅ 快速收藏/取消收藏成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
} else {
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
List<int?> addMediaIdsNew = [];
|
||||
List<int?> delMediaIdsNew = [];
|
||||
try {
|
||||
for (var i in favFolderData.value.list!.toList()) {
|
||||
bool isFaved = favIds?.contains(i.id) == true;
|
||||
if (i.favState == 1) {
|
||||
if (isFaved.not) {
|
||||
addMediaIdsNew.add(i.id);
|
||||
}
|
||||
} else {
|
||||
if (isFaved) {
|
||||
delMediaIdsNew.add(i.id);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
var result = await VideoHttp.favVideo(
|
||||
aid: epId,
|
||||
type: 24,
|
||||
addIds: addMediaIdsNew.join(','),
|
||||
delIds: delMediaIdsNew.join(','),
|
||||
);
|
||||
if (result['status']) {
|
||||
SmartDialog.showToast('操作成功');
|
||||
Get.back();
|
||||
Future.delayed(const Duration(milliseconds: 255), () {
|
||||
queryBangumiLikeCoinFav();
|
||||
});
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
// 分享视频
|
||||
Future actionShareVideo(context) async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
||||
return AlertDialog(
|
||||
clipBehavior: Clip.hardEdge,
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'复制链接',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Utils.copyText(videoUrl);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'其它app打开',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
PageUtils.launchURL(videoUrl);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享视频',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
Utils.shareText(videoUrl);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至动态',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
EpisodeItem? item = bangumiItem?.episodes
|
||||
?.firstWhereOrNull((item) => item.epId == epId);
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
useSafeArea: true,
|
||||
builder: (context) => RepostPanel(
|
||||
rid: epId,
|
||||
/**
|
||||
* 1:番剧 // 4097
|
||||
2:电影 // 4098
|
||||
3:纪录片 // 4101
|
||||
4:国创 // 4100
|
||||
5:电视剧 // 4099
|
||||
6:漫画
|
||||
7:综艺 // 4099
|
||||
*/
|
||||
dynType: switch (Get.parameters['type']) {
|
||||
'1' => 4097,
|
||||
'2' => 4098,
|
||||
'3' => 4101,
|
||||
'4' => 4100,
|
||||
'5' || '7' => 4099,
|
||||
_ => -1,
|
||||
},
|
||||
pic: bangumiItem?.cover,
|
||||
title:
|
||||
'${bangumiItem?.title}${item != null ? '\n${item.showTitle}' : ''}',
|
||||
uname: '',
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: const Text(
|
||||
'分享至消息',
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
try {
|
||||
EpisodeItem item = bangumiItem!.episodes!
|
||||
.firstWhere((item) => item.epId == epId);
|
||||
final title = '${bangumiItem!.title!} ${item.showTitle}';
|
||||
PageUtils.pmShare(
|
||||
context,
|
||||
content: {
|
||||
"id": epId!.toString(),
|
||||
"title": title,
|
||||
"url": item.shareUrl,
|
||||
"headline": title,
|
||||
"source": 16,
|
||||
"thumb": item.cover,
|
||||
"source_desc": switch (bangumiItem!.type) {
|
||||
1 => '番剧',
|
||||
2 => '电影',
|
||||
3 => '纪录片',
|
||||
4 => '国创',
|
||||
5 => '电视剧',
|
||||
6 => '漫画',
|
||||
7 => '综艺',
|
||||
_ => null,
|
||||
}
|
||||
},
|
||||
);
|
||||
} catch (e) {
|
||||
SmartDialog.showToast(e.toString());
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// 选择文件夹
|
||||
onChoose(bool checkValue, int index) {
|
||||
feedBack();
|
||||
List<FavFolderItemData> datalist = favFolderData.value.list!;
|
||||
datalist[index].favState = checkValue ? 1 : 0;
|
||||
datalist[index].mediaCount = checkValue
|
||||
? datalist[index].mediaCount! + 1
|
||||
: datalist[index].mediaCount! - 1;
|
||||
favFolderData.value.list = datalist;
|
||||
favFolderData.refresh();
|
||||
}
|
||||
|
||||
// 修改分P或番剧分集
|
||||
Future changeSeasonOrbangu(epId, bvid, cid, aid, cover) async {
|
||||
// 重新获取视频资源
|
||||
this.epId = epId;
|
||||
this.bvid = bvid;
|
||||
|
||||
final videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag'])
|
||||
..plPlayerController.pause()
|
||||
..makeHeartBeat()
|
||||
..onReset()
|
||||
..epId = epId
|
||||
..bvid = bvid
|
||||
..cid.value = cid
|
||||
..danmakuCid.value = cid
|
||||
..queryVideoUrl();
|
||||
if (cover is String && cover.isNotEmpty) {
|
||||
videoDetailCtr.videoItem['pic'] = cover;
|
||||
}
|
||||
|
||||
// 重新请求评论
|
||||
if (videoDetailCtr.showReply) {
|
||||
try {
|
||||
Get.find<VideoReplyController>(tag: Get.arguments['heroTag'])
|
||||
..aid = aid
|
||||
..onReload();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
if (isLogin) {
|
||||
queryBangumiLikeCoinFav();
|
||||
}
|
||||
|
||||
try {
|
||||
Get.find<VideoIntroController>(tag: Get.arguments['heroTag'])
|
||||
..bvid = bvid
|
||||
..lastPlayCid.value = cid
|
||||
..queryVideoIntro()
|
||||
..queryOnlineTotal();
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
// 追番
|
||||
Future bangumiAdd() async {
|
||||
var result = await VideoHttp.bangumiAdd(
|
||||
seasonId: (loadingState.value as Success).response.seasonId);
|
||||
if (result['status']) {
|
||||
isFollowed.value = true;
|
||||
followStatus.value = 2;
|
||||
}
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
|
||||
// 取消追番
|
||||
Future bangumiDel() async {
|
||||
var result = await VideoHttp.bangumiDel(
|
||||
seasonId: (loadingState.value as Success).response.seasonId);
|
||||
if (result['status']) {
|
||||
isFollowed.value = false;
|
||||
}
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
|
||||
Future bangumiUpdate(status) async {
|
||||
var result = await VideoHttp.bangumiUpdate(
|
||||
seasonId: [(loadingState.value as Success).response.seasonId],
|
||||
status: status,
|
||||
);
|
||||
if (result['status']) {
|
||||
followStatus.value = status;
|
||||
}
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
|
||||
Future queryVideoInFolder() async {
|
||||
favIds = null;
|
||||
var result = await VideoHttp.videoInFolder(
|
||||
mid: userInfo.mid,
|
||||
rid: epId, // bangumi
|
||||
type: 24, // bangumi
|
||||
);
|
||||
if (result['status']) {
|
||||
favFolderData.value = result['data'];
|
||||
favIds = favFolderData.value.list
|
||||
?.where((item) => item.favState == 1)
|
||||
.map((item) => item.id)
|
||||
.toList();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
bool prevPlay() {
|
||||
late List episodes;
|
||||
if ((loadingState.value as Success).response.episodes != null) {
|
||||
episodes = (loadingState.value as Success).response.episodes!;
|
||||
}
|
||||
VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||
int currentIndex =
|
||||
episodes.indexWhere((e) => e.cid == videoDetailCtr.cid.value);
|
||||
int prevIndex = currentIndex - 1;
|
||||
PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
||||
if (prevIndex < 0) {
|
||||
if (playRepeat == PlayRepeat.listCycle) {
|
||||
prevIndex = episodes.length - 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int epid = episodes[prevIndex].epId;
|
||||
int cid = episodes[prevIndex].cid;
|
||||
String bvid = episodes[prevIndex].bvid;
|
||||
int aid = episodes[prevIndex].aid;
|
||||
dynamic cover = episodes[prevIndex].cover;
|
||||
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// 列表循环或者顺序播放时,自动播放下一个;自动连播时,播放相关视频
|
||||
bool nextPlay() {
|
||||
try {
|
||||
late List episodes;
|
||||
VideoDetailController videoDetailCtr =
|
||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag']);
|
||||
PlayRepeat playRepeat = videoDetailCtr.plPlayerController.playRepeat;
|
||||
|
||||
if ((loadingState.value as Success<BangumiInfoModel>).response.episodes !=
|
||||
null) {
|
||||
episodes = (loadingState.value as Success<BangumiInfoModel>)
|
||||
.response
|
||||
.episodes!;
|
||||
} else {
|
||||
if (playRepeat == PlayRepeat.autoPlayRelated) {
|
||||
return playRelated();
|
||||
}
|
||||
}
|
||||
int currentIndex =
|
||||
episodes.indexWhere((e) => e.cid == videoDetailCtr.cid.value);
|
||||
int nextIndex = currentIndex + 1;
|
||||
// 列表循环
|
||||
if (nextIndex >= episodes.length) {
|
||||
if (playRepeat == PlayRepeat.listCycle) {
|
||||
nextIndex = 0;
|
||||
} else if (playRepeat == PlayRepeat.autoPlayRelated) {
|
||||
return playRelated();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
int epid = episodes[nextIndex].epId;
|
||||
int cid = episodes[nextIndex].cid;
|
||||
String bvid = episodes[nextIndex].bvid;
|
||||
int aid = episodes[nextIndex].aid;
|
||||
dynamic cover = episodes[nextIndex].cover;
|
||||
changeSeasonOrbangu(epid, bvid, cid, aid, cover);
|
||||
return true;
|
||||
} catch (_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool playRelated() {
|
||||
SmartDialog.showToast('番剧暂无相关视频');
|
||||
return false;
|
||||
}
|
||||
|
||||
// 一键三连
|
||||
Future actionOneThree() async {
|
||||
feedBack();
|
||||
if (userInfo == null) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
if (hasLike.value && hasCoin && hasFav.value) {
|
||||
// 已点赞、投币、收藏
|
||||
SmartDialog.showToast('已三连');
|
||||
return false;
|
||||
}
|
||||
var result = await VideoHttp.triple(epId: epId, seasonId: seasonId);
|
||||
if (result['status']) {
|
||||
hasLike.value = result["data"]["like"] == 1;
|
||||
if (result["data"]["coin"] == 1) {
|
||||
_coinNum.value = 2;
|
||||
GlobalData().afterCoin(2);
|
||||
}
|
||||
hasFav.value = result["data"]["favorite"] == 1;
|
||||
SmartDialog.showToast('三连成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
RxBool isFollowed = false.obs;
|
||||
RxInt followStatus = (-1).obs;
|
||||
|
||||
Future queryIsFollowed() async {
|
||||
try {
|
||||
dynamic result = await Request().get(
|
||||
'https://www.bilibili.com/bangumi/play/ss$seasonId',
|
||||
);
|
||||
dom.Document document = html_parser.parse(result.data);
|
||||
dom.Element? scriptElement =
|
||||
document.querySelector('script#__NEXT_DATA__');
|
||||
if (scriptElement != null) {
|
||||
dynamic scriptContent = jsonDecode(scriptElement.text);
|
||||
isFollowed.value =
|
||||
scriptContent['props']['pageProps']['followState']['isFollowed'];
|
||||
followStatus.value =
|
||||
scriptContent['props']['pageProps']['followState']['followStatus'];
|
||||
}
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
// 收藏
|
||||
showFavBottomSheet(BuildContext context, {type = 'tap'}) {
|
||||
if (userInfo == null) {
|
||||
SmartDialog.showToast('账号未登录');
|
||||
return;
|
||||
}
|
||||
// 快速收藏 &
|
||||
// 点按 收藏至默认文件夹
|
||||
// 长按选择文件夹
|
||||
if (enableQuickFav) {
|
||||
if (type == 'tap') {
|
||||
actionFavVideo(type: 'default');
|
||||
} else {
|
||||
PageUtils.showFavBottomSheet(context: context, ctr: this);
|
||||
}
|
||||
} else if (type != 'longPress') {
|
||||
PageUtils.showFavBottomSheet(context: context, ctr: this);
|
||||
}
|
||||
}
|
||||
}
|
||||
675
lib/pages/video/introduction/pgc/view.dart
Normal file
675
lib/pages/video/introduction/pgc/view.dart
Normal file
@@ -0,0 +1,675 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/common/widgets/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart'
|
||||
show SourceModel;
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/badge.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/widgets/bangumi_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_row_item.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
|
||||
class BangumiIntroPanel extends StatefulWidget {
|
||||
final int? cid;
|
||||
final String heroTag;
|
||||
final Function showEpisodes;
|
||||
final Function showIntroDetail;
|
||||
|
||||
const BangumiIntroPanel({
|
||||
super.key,
|
||||
this.cid,
|
||||
required this.heroTag,
|
||||
required this.showEpisodes,
|
||||
required this.showIntroDetail,
|
||||
});
|
||||
|
||||
@override
|
||||
State<BangumiIntroPanel> createState() => _BangumiIntroPanelState();
|
||||
}
|
||||
|
||||
class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
late BangumiIntroController bangumiIntroController;
|
||||
late VideoDetailController videoDetailCtr;
|
||||
late int cid;
|
||||
StreamSubscription? _listener;
|
||||
|
||||
// 添加页面缓存
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
cid = widget.cid!;
|
||||
bangumiIntroController =
|
||||
Get.put(BangumiIntroController(), tag: widget.heroTag);
|
||||
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||
_listener = videoDetailCtr.cid.listen((int p0) {
|
||||
cid = p0;
|
||||
if (!mounted) return;
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_listener?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Obx(() => _buildBody(bangumiIntroController.loadingState.value));
|
||||
}
|
||||
|
||||
_buildBody(LoadingState loadingState) {
|
||||
return switch (loadingState) {
|
||||
Loading() => BangumiInfo(
|
||||
heroTag: widget.heroTag,
|
||||
isLoading: true,
|
||||
bangumiDetail: null,
|
||||
cid: cid,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
showIntroDetail: () {},
|
||||
),
|
||||
Success() => BangumiInfo(
|
||||
heroTag: widget.heroTag,
|
||||
isLoading: false,
|
||||
bangumiDetail: loadingState.response,
|
||||
cid: cid,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
showIntroDetail: () => widget.showIntroDetail(
|
||||
loadingState.response,
|
||||
bangumiIntroController.videoTags,
|
||||
),
|
||||
),
|
||||
Error() => HttpError(
|
||||
errMsg: loadingState.errMsg,
|
||||
onReload: bangumiIntroController.onReload,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class BangumiInfo extends StatefulWidget {
|
||||
const BangumiInfo({
|
||||
super.key,
|
||||
this.isLoading = false,
|
||||
this.bangumiDetail,
|
||||
this.cid,
|
||||
required this.showEpisodes,
|
||||
required this.showIntroDetail,
|
||||
required this.heroTag,
|
||||
});
|
||||
|
||||
final bool isLoading;
|
||||
final BangumiInfoModel? bangumiDetail;
|
||||
final int? cid;
|
||||
final Function showEpisodes;
|
||||
final Function showIntroDetail;
|
||||
final String heroTag;
|
||||
|
||||
@override
|
||||
State<BangumiInfo> createState() => _BangumiInfoState();
|
||||
}
|
||||
|
||||
class _BangumiInfoState extends State<BangumiInfo> {
|
||||
late final BangumiIntroController bangumiIntroController;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
late final BangumiInfoModel? bangumiItem;
|
||||
int? cid;
|
||||
bool isProcessing = false;
|
||||
void handleState(Future Function() action) async {
|
||||
if (isProcessing.not) {
|
||||
isProcessing = true;
|
||||
await action();
|
||||
isProcessing = false;
|
||||
}
|
||||
}
|
||||
|
||||
late final _coinKey = GlobalKey<ActionItemState>();
|
||||
late final _favKey = GlobalKey<ActionItemState>();
|
||||
|
||||
StreamSubscription? _listener;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
bangumiIntroController =
|
||||
Get.put(BangumiIntroController(), tag: widget.heroTag);
|
||||
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||
bangumiItem = bangumiIntroController.bangumiItem;
|
||||
cid = widget.cid!;
|
||||
debugPrint('cid: $cid');
|
||||
_listener = videoDetailCtr.cid.listen((p0) {
|
||||
cid = p0;
|
||||
if (!mounted) return;
|
||||
setState(() {});
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_listener?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// 视频介绍
|
||||
showIntroDetail() {
|
||||
feedBack();
|
||||
widget.showIntroDetail();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
bool isLandscape =
|
||||
MediaQuery.of(context).orientation == Orientation.landscape;
|
||||
return SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
left: StyleString.safeSpace,
|
||||
right: StyleString.safeSpace,
|
||||
top: StyleString.safeSpace,
|
||||
bottom: StyleString.safeSpace + MediaQuery.paddingOf(context).bottom,
|
||||
),
|
||||
sliver: SliverToBoxAdapter(
|
||||
child: !widget.isLoading || bangumiItem != null
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
videoDetailCtr.onViewImage();
|
||||
context.imageView(
|
||||
imgList: [
|
||||
SourceModel(
|
||||
url: !widget.isLoading
|
||||
? widget.bangumiDetail!.cover!
|
||||
: bangumiItem!.cover!,
|
||||
)
|
||||
],
|
||||
onDismissed: videoDetailCtr.onDismissed,
|
||||
);
|
||||
},
|
||||
child: Hero(
|
||||
tag: !widget.isLoading
|
||||
? widget.bangumiDetail!.cover!
|
||||
: bangumiItem!.cover!,
|
||||
child: NetworkImgLayer(
|
||||
width: isLandscape ? 115 / 0.75 : 115,
|
||||
height: isLandscape ? 115 : 115 / 0.75,
|
||||
src: !widget.isLoading
|
||||
? widget.bangumiDetail!.cover!
|
||||
: bangumiItem!.cover!,
|
||||
semanticsLabel: '封面',
|
||||
),
|
||||
),
|
||||
),
|
||||
if (bangumiItem != null &&
|
||||
bangumiItem!.rating != null)
|
||||
PBadge(
|
||||
text:
|
||||
'评分 ${!widget.isLoading ? widget.bangumiDetail!.rating!['score']! : bangumiItem!.rating!['score']!}',
|
||||
top: null,
|
||||
right: 6,
|
||||
bottom: 6,
|
||||
left: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: GestureDetector(
|
||||
onTap: showIntroDetail,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: SizedBox(
|
||||
height: isLandscape ? 115 : 115 / 0.75,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
!widget.isLoading
|
||||
? widget.bangumiDetail!.title!
|
||||
: bangumiItem!.title!,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 20),
|
||||
Obx(
|
||||
() => FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
tapTargetSize:
|
||||
MaterialTapTargetSize.shrinkWrap,
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity: const VisualDensity(
|
||||
horizontal: -2,
|
||||
vertical: -2,
|
||||
),
|
||||
foregroundColor:
|
||||
bangumiIntroController
|
||||
.isFollowed.value
|
||||
? theme.colorScheme.outline
|
||||
: null,
|
||||
backgroundColor:
|
||||
bangumiIntroController
|
||||
.isFollowed.value
|
||||
? theme.colorScheme
|
||||
.onInverseSurface
|
||||
: null,
|
||||
),
|
||||
onPressed: bangumiIntroController
|
||||
.followStatus.value ==
|
||||
-1
|
||||
? null
|
||||
: () {
|
||||
if (bangumiIntroController
|
||||
.isFollowed.value) {
|
||||
showPgcFollowDialog(
|
||||
context: context,
|
||||
type: bangumiIntroController
|
||||
.type,
|
||||
followStatus:
|
||||
bangumiIntroController
|
||||
.followStatus.value,
|
||||
onUpdateStatus:
|
||||
(followStatus) {
|
||||
if (followStatus == -1) {
|
||||
bangumiIntroController
|
||||
.bangumiDel();
|
||||
} else {
|
||||
bangumiIntroController
|
||||
.bangumiUpdate(
|
||||
followStatus);
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
bangumiIntroController
|
||||
.bangumiAdd();
|
||||
}
|
||||
},
|
||||
child: Text(
|
||||
bangumiIntroController
|
||||
.isFollowed.value
|
||||
? '已${bangumiIntroController.type}'
|
||||
: '${bangumiIntroController.type}',
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
StatView(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(!widget.isLoading
|
||||
? widget.bangumiDetail!.stat!['views']
|
||||
: bangumiItem!.stat!['views']),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
StatDanMu(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(!widget.isLoading
|
||||
? widget
|
||||
.bangumiDetail!.stat!['danmakus']
|
||||
: bangumiItem!.stat!['danmakus']),
|
||||
),
|
||||
if (isLandscape) ...[
|
||||
const SizedBox(width: 6),
|
||||
AreasAndPubTime(
|
||||
widget: widget,
|
||||
bangumiItem: bangumiItem,
|
||||
theme: theme,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
NewEpDesc(
|
||||
widget: widget,
|
||||
bangumiItem: bangumiItem,
|
||||
theme: theme,
|
||||
),
|
||||
]
|
||||
],
|
||||
),
|
||||
SizedBox(height: isLandscape ? 2 : 6),
|
||||
if (!isLandscape)
|
||||
AreasAndPubTime(
|
||||
widget: widget,
|
||||
bangumiItem: bangumiItem,
|
||||
theme: theme,
|
||||
),
|
||||
if (!isLandscape)
|
||||
NewEpDesc(
|
||||
widget: widget,
|
||||
bangumiItem: bangumiItem,
|
||||
theme: theme,
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
'简介:${!widget.isLoading ? widget.bangumiDetail!.evaluate! : bangumiItem!.evaluate!}',
|
||||
maxLines: isLandscape ? 2 : 3,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
// 点赞收藏转发 布局样式2
|
||||
actionGrid(theme, bangumiIntroController),
|
||||
// 番剧分p
|
||||
if ((!widget.isLoading &&
|
||||
widget.bangumiDetail!.episodes!.isNotEmpty) ||
|
||||
bangumiItem != null &&
|
||||
bangumiItem!.episodes!.isNotEmpty) ...[
|
||||
BangumiPanel(
|
||||
heroTag: widget.heroTag,
|
||||
pages: bangumiItem != null
|
||||
? bangumiItem!.episodes!
|
||||
: widget.bangumiDetail!.episodes!,
|
||||
cid: cid ??
|
||||
(bangumiItem != null
|
||||
? bangumiItem!.episodes!.first.cid
|
||||
: widget.bangumiDetail!.episodes!.first.cid),
|
||||
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
||||
showEpisodes: widget.showEpisodes,
|
||||
newEp: bangumiItem?.newEp,
|
||||
)
|
||||
],
|
||||
],
|
||||
)
|
||||
: const SizedBox(
|
||||
height: 100,
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget actionGrid(
|
||||
ThemeData theme, BangumiIntroController bangumiIntroController) {
|
||||
return Material(
|
||||
color: theme.colorScheme.surface,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 1),
|
||||
child: SizedBox(
|
||||
height: 48,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
onTap: () =>
|
||||
handleState(bangumiIntroController.actionLikeVideo),
|
||||
onLongPress: bangumiIntroController.actionOneThree,
|
||||
selectStatus: bangumiIntroController.hasLike.value,
|
||||
loadingStatus: false,
|
||||
semanticsLabel: '点赞',
|
||||
text: !widget.isLoading
|
||||
? Utils.numFormat(widget.bangumiDetail!.stat!['likes']!)
|
||||
: Utils.numFormat(
|
||||
bangumiItem!.stat!['likes']!,
|
||||
),
|
||||
needAnim: true,
|
||||
hasTriple: bangumiIntroController.hasLike.value &&
|
||||
bangumiIntroController.hasCoin &&
|
||||
bangumiIntroController.hasFav.value,
|
||||
callBack: (start) {
|
||||
if (start) {
|
||||
HapticFeedback.lightImpact();
|
||||
_coinKey.currentState?.controller?.forward();
|
||||
_favKey.currentState?.controller?.forward();
|
||||
} else {
|
||||
_coinKey.currentState?.controller?.reverse();
|
||||
_favKey.currentState?.controller?.reverse();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _coinKey,
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () =>
|
||||
handleState(bangumiIntroController.actionCoinVideo),
|
||||
selectStatus: bangumiIntroController.hasCoin,
|
||||
loadingStatus: false,
|
||||
semanticsLabel: '投币',
|
||||
text: !widget.isLoading
|
||||
? Utils.numFormat(widget.bangumiDetail!.stat!['coins']!)
|
||||
: Utils.numFormat(
|
||||
bangumiItem!.stat!['coins']!,
|
||||
),
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _favKey,
|
||||
icon: const Icon(FontAwesomeIcons.star),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
onTap: () =>
|
||||
bangumiIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => bangumiIntroController
|
||||
.showFavBottomSheet(context, type: 'longPress'),
|
||||
selectStatus: bangumiIntroController.hasFav.value,
|
||||
loadingStatus: false,
|
||||
semanticsLabel: '收藏',
|
||||
text: !widget.isLoading
|
||||
? Utils.numFormat(
|
||||
widget.bangumiDetail!.stat!['favorite']!)
|
||||
: Utils.numFormat(
|
||||
bangumiItem!.stat!['favorite']!,
|
||||
),
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
selectIcon: const Icon(FontAwesomeIcons.reply),
|
||||
onTap: () => videoDetailCtr.tabCtr.animateTo(1),
|
||||
selectStatus: false,
|
||||
loadingStatus: false,
|
||||
semanticsLabel: '评论',
|
||||
text: !widget.isLoading
|
||||
? Utils.numFormat(widget.bangumiDetail!.stat!['reply']!)
|
||||
: Utils.numFormat(bangumiItem!.stat!['reply']!),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
onTap: () => bangumiIntroController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
loadingStatus: false,
|
||||
semanticsLabel: '转发',
|
||||
text: !widget.isLoading
|
||||
? Utils.numFormat(widget.bangumiDetail!.stat!['share']!)
|
||||
: Utils.numFormat(bangumiItem!.stat!['share']!)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget actionRow(
|
||||
BuildContext context,
|
||||
BangumiIntroController bangumiIntroController,
|
||||
VideoDetailController videoDetailCtr,
|
||||
) {
|
||||
return Row(children: [
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
onTap: () => handleState(bangumiIntroController.actionLikeVideo),
|
||||
selectStatus: bangumiIntroController.hasLike.value,
|
||||
loadingStatus: widget.isLoading,
|
||||
text: !widget.isLoading
|
||||
? widget.bangumiDetail!.stat!['likes']!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => handleState(bangumiIntroController.actionCoinVideo),
|
||||
selectStatus: bangumiIntroController.hasCoin,
|
||||
loadingStatus: widget.isLoading,
|
||||
text: !widget.isLoading
|
||||
? widget.bangumiDetail!.stat!['coins']!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.heart),
|
||||
onTap: () => bangumiIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => bangumiIntroController.showFavBottomSheet(context,
|
||||
type: 'longPress'),
|
||||
selectStatus: bangumiIntroController.hasFav.value,
|
||||
loadingStatus: widget.isLoading,
|
||||
text: !widget.isLoading
|
||||
? widget.bangumiDetail!.stat!['favorite']!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
onTap: () {
|
||||
videoDetailCtr.tabCtr.animateTo(1);
|
||||
},
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.isLoading,
|
||||
text: !widget.isLoading
|
||||
? widget.bangumiDetail!.stat!['reply']!.toString()
|
||||
: '-',
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.share),
|
||||
onTap: () => bangumiIntroController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.isLoading,
|
||||
text: '转发'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
class AreasAndPubTime extends StatelessWidget {
|
||||
const AreasAndPubTime({
|
||||
super.key,
|
||||
required this.widget,
|
||||
required this.bangumiItem,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
final BangumiInfo widget;
|
||||
final BangumiInfoModel? bangumiItem;
|
||||
final ThemeData theme;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
Text(
|
||||
!widget.isLoading
|
||||
? (widget.bangumiDetail!.areas!.isNotEmpty
|
||||
? widget.bangumiDetail!.areas!.first['name']
|
||||
: '')
|
||||
: (bangumiItem!.areas!.isNotEmpty
|
||||
? bangumiItem!.areas!.first['name']
|
||||
: ''),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
!widget.isLoading
|
||||
? widget.bangumiDetail!.publish!['pub_time_show']
|
||||
: bangumiItem!.publish!['pub_time_show'],
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class NewEpDesc extends StatelessWidget {
|
||||
const NewEpDesc({
|
||||
super.key,
|
||||
required this.widget,
|
||||
required this.bangumiItem,
|
||||
required this.theme,
|
||||
});
|
||||
|
||||
final BangumiInfo widget;
|
||||
final BangumiInfoModel? bangumiItem;
|
||||
final ThemeData theme;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text(
|
||||
!widget.isLoading
|
||||
? widget.bangumiDetail!.newEp!['desc']
|
||||
: bangumiItem!.newEp!['desc'],
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
240
lib/pages/video/introduction/pgc/widgets/bangumi_panel.dart
Normal file
240
lib/pages/video/introduction/pgc/widgets/bangumi_panel.dart
Normal file
@@ -0,0 +1,240 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
|
||||
class BangumiPanel extends StatefulWidget {
|
||||
const BangumiPanel({
|
||||
super.key,
|
||||
required this.pages,
|
||||
this.cid,
|
||||
required this.changeFuc,
|
||||
required this.showEpisodes,
|
||||
required this.heroTag,
|
||||
this.newEp,
|
||||
});
|
||||
|
||||
final List<EpisodeItem> pages;
|
||||
final int? cid;
|
||||
final Function changeFuc;
|
||||
final Function showEpisodes;
|
||||
final String heroTag;
|
||||
final dynamic newEp;
|
||||
|
||||
@override
|
||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||
}
|
||||
|
||||
class _BangumiPanelState extends State<BangumiPanel> {
|
||||
late int currentIndex;
|
||||
final ScrollController listViewScrollCtr = ScrollController();
|
||||
dynamic userInfo;
|
||||
// 默认未开通
|
||||
int vipStatus = 0;
|
||||
late int cid;
|
||||
late final VideoDetailController videoDetailCtr;
|
||||
StreamSubscription? _listener;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
cid = widget.cid!;
|
||||
currentIndex = widget.pages.indexWhere((e) => e.cid == cid);
|
||||
scrollToIndex();
|
||||
userInfo = GStorage.userInfo.get('userInfoCache');
|
||||
if (userInfo != null) {
|
||||
vipStatus = userInfo.vipStatus;
|
||||
}
|
||||
videoDetailCtr = Get.find<VideoDetailController>(tag: widget.heroTag);
|
||||
|
||||
_listener = videoDetailCtr.cid.listen((int p0) {
|
||||
cid = p0;
|
||||
currentIndex = widget.pages.indexWhere((EpisodeItem e) => e.cid == cid);
|
||||
if (!mounted) return;
|
||||
setState(() {});
|
||||
scrollToIndex();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_listener?.cancel();
|
||||
listViewScrollCtr.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void scrollToIndex() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
listViewScrollCtr.animateTo(
|
||||
(currentIndex * 150.0).clamp(listViewScrollCtr.position.minScrollExtent,
|
||||
listViewScrollCtr.position.maxScrollExtent),
|
||||
duration: const Duration(milliseconds: 500),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 5, bottom: 3),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text('合集 '),
|
||||
Expanded(
|
||||
child: Text(
|
||||
' 正在播放:${widget.pages[currentIndex].longTitle}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
SizedBox(
|
||||
height: 34,
|
||||
child: TextButton(
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => widget.showEpisodes(
|
||||
null,
|
||||
null,
|
||||
widget.pages,
|
||||
widget.pages[currentIndex].bvid,
|
||||
widget.pages[currentIndex].aid,
|
||||
cid,
|
||||
),
|
||||
child: Text(
|
||||
widget.newEp?['desc']?.contains('连载') == true
|
||||
? '连载中,更新至${Utils.isStringNumeric(widget.newEp['title']) ? '第${widget.newEp?['title']}话' : '${widget.newEp?['title']}'}'
|
||||
: widget.newEp?['desc'],
|
||||
style: const TextStyle(fontSize: 13),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 60,
|
||||
child: ListView.builder(
|
||||
controller: listViewScrollCtr,
|
||||
scrollDirection: Axis.horizontal,
|
||||
itemCount: widget.pages.length,
|
||||
itemExtent: 150,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final item = widget.pages[index];
|
||||
return Container(
|
||||
width: 150,
|
||||
margin: EdgeInsets.only(
|
||||
right: index == widget.pages.length - 1 ? 0 : 10,
|
||||
),
|
||||
child: Material(
|
||||
color: theme.colorScheme.onInverseSurface,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
if (item.badge != null &&
|
||||
item.badge == '会员' &&
|
||||
vipStatus != 1) {
|
||||
SmartDialog.showToast('需要大会员');
|
||||
}
|
||||
widget.changeFuc(
|
||||
item.epId,
|
||||
item.bvid,
|
||||
item.cid,
|
||||
item.aid,
|
||||
item.cover,
|
||||
);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 8, horizontal: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
if (index == currentIndex) ...<Widget>[
|
||||
Image.asset(
|
||||
'assets/images/live.png',
|
||||
color: theme.colorScheme.primary,
|
||||
height: 12,
|
||||
semanticLabel: "正在播放:",
|
||||
),
|
||||
const SizedBox(width: 6)
|
||||
],
|
||||
Expanded(
|
||||
child: Text(
|
||||
item.title ?? '第${index + 1}话',
|
||||
maxLines: (item.longTitle != null &&
|
||||
item.longTitle != '')
|
||||
? 1
|
||||
: 2,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: index == currentIndex
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface),
|
||||
)),
|
||||
const SizedBox(width: 2),
|
||||
if (item.badge != null) ...[
|
||||
const Spacer(),
|
||||
if (item.badge == '会员') ...[
|
||||
Image.asset(
|
||||
'assets/images/big-vip.png',
|
||||
height: 16,
|
||||
semanticLabel: "大会员",
|
||||
),
|
||||
],
|
||||
if (item.badge != '会员') ...[
|
||||
Text(
|
||||
item.badge!,
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
]
|
||||
],
|
||||
),
|
||||
if (item.longTitle != null &&
|
||||
item.longTitle != '') ...[
|
||||
const SizedBox(height: 3),
|
||||
Text(
|
||||
item.longTitle!,
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: index == currentIndex
|
||||
? theme.colorScheme.primary
|
||||
: theme.colorScheme.onSurface),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
)
|
||||
]
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
156
lib/pages/video/introduction/pgc/widgets/intro_detail.dart
Normal file
156
lib/pages/video/introduction/pgc/widgets/intro_detail.dart
Normal file
@@ -0,0 +1,156 @@
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class IntroDetail extends CommonCollapseSlidePage {
|
||||
final BangumiInfoModel bangumiDetail;
|
||||
final dynamic videoTags;
|
||||
|
||||
const IntroDetail({
|
||||
super.key,
|
||||
required this.bangumiDetail,
|
||||
this.videoTags,
|
||||
});
|
||||
|
||||
@override
|
||||
State<IntroDetail> createState() => _IntroDetailState();
|
||||
}
|
||||
|
||||
class _IntroDetailState extends CommonCollapseSlidePageState<IntroDetail> {
|
||||
@override
|
||||
Widget buildPage(ThemeData theme) {
|
||||
return Material(
|
||||
color: theme.colorScheme.surface,
|
||||
child: Column(
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: Get.back,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
height: 35,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color:
|
||||
theme.colorScheme.onSecondaryContainer.withOpacity(0.5),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: enableSlide ? slideList(theme) : buildList(theme),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildList(ThemeData theme) {
|
||||
final TextStyle smallTitle = TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.onSurface,
|
||||
);
|
||||
return ListView(
|
||||
controller: ScrollController(),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
padding: EdgeInsets.only(
|
||||
left: 14,
|
||||
right: 14,
|
||||
bottom: MediaQuery.paddingOf(context).bottom + 80,
|
||||
),
|
||||
children: [
|
||||
SelectableText(
|
||||
widget.bangumiDetail.title!,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
StatView(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!['views']),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
StatDanMu(
|
||||
context: context,
|
||||
theme: 'gray',
|
||||
value: Utils.numFormat(widget.bangumiDetail.stat!['danmakus']),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
widget.bangumiDetail.areas!.first['name'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
widget.bangumiDetail.publish!['pub_time_show'],
|
||||
style: smallTitle,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
widget.bangumiDetail.newEp!['desc'],
|
||||
style: smallTitle,
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'简介:',
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
SelectableText(
|
||||
widget.bangumiDetail.evaluate!,
|
||||
style: smallTitle.copyWith(fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'声优:',
|
||||
style: theme.textTheme.titleMedium,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
SelectableText(
|
||||
widget.bangumiDetail.actors!,
|
||||
style: smallTitle.copyWith(fontSize: 14),
|
||||
),
|
||||
if (widget.videoTags is List && widget.videoTags.isNotEmpty) ...[
|
||||
const SizedBox(height: 10),
|
||||
Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 8,
|
||||
children: (widget.videoTags as List)
|
||||
.map(
|
||||
(item) => SearchText(
|
||||
fontSize: 13,
|
||||
text: item['tag_name'],
|
||||
onTap: (_) => Get.toNamed(
|
||||
'/searchResult',
|
||||
parameters: {
|
||||
'keyword': item['tag_name'],
|
||||
},
|
||||
),
|
||||
onLongPress: (_) => Utils.copyText(item['tag_name']),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
)
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,12 @@ import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/member.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/repost_dyn_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/pay_coins_page.dart';
|
||||
import 'package:PiliPlus/http/search.dart';
|
||||
import 'package:PiliPlus/models/model_hot_video_item.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_repost/view.dart';
|
||||
import 'package:PiliPlus/pages/video/pay_coins/view.dart';
|
||||
import 'package:PiliPlus/pages/video/related/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -21,17 +25,12 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/models/user/fav_folder.dart';
|
||||
import 'package:PiliPlus/models/video/ai.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/index.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
|
||||
import '../../../../http/search.dart';
|
||||
import '../../../../models/model_hot_video_item.dart';
|
||||
import '../related/index.dart';
|
||||
|
||||
class VideoIntroController extends GetxController {
|
||||
// 视频bvid
|
||||
late String bvid;
|
||||
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:PiliPlus/common/widgets/avatar.dart';
|
||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||
import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -18,11 +19,10 @@ import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
@@ -1,13 +1,12 @@
|
||||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
|
||||
import '../../../../../utils/id_utils.dart';
|
||||
|
||||
class PagesPanel extends StatefulWidget {
|
||||
const PagesPanel({
|
||||
@@ -1,11 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/models/video_detail_res.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
|
||||
class SeasonPanel extends StatefulWidget {
|
||||
const SeasonPanel({
|
||||
@@ -4,8 +4,7 @@ import 'package:PiliPlus/models/member/info.dart';
|
||||
import 'package:PiliPlus/models/space_archive/data.dart';
|
||||
import 'package:PiliPlus/models/space_archive/item.dart';
|
||||
import 'package:PiliPlus/pages/common/common_data_controller.dart';
|
||||
import 'package:PiliPlus/pages/member/content/member_contribute/member_contribute.dart'
|
||||
show ContributeType;
|
||||
import 'package:PiliPlus/pages/member_contribute/view.dart' show ContributeType;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class HorizontalMemberPageController extends CommonDataController {
|
||||
@@ -52,7 +51,7 @@ class HorizontalMemberPageController extends CommonDataController {
|
||||
|
||||
@override
|
||||
bool customHandleResponse(bool isRefresh, Success response) {
|
||||
Data data = response.response;
|
||||
SpaceArchiveData data = response.response;
|
||||
count.value = data.count ?? -1;
|
||||
if (currentPage == 0 || isLoadPrevious) {
|
||||
hasPrev = data.hasPrev ?? false;
|
||||
@@ -61,7 +60,7 @@ class HorizontalMemberPageController extends CommonDataController {
|
||||
hasNext = data.hasNext ?? false;
|
||||
}
|
||||
if (currentPage != 0 && loadingState.value is Success) {
|
||||
data.item ??= <Item>[];
|
||||
data.item ??= <SpaceArchiveItem>[];
|
||||
if (isLoadPrevious) {
|
||||
data.item!.addAll((loadingState.value as Success).response);
|
||||
} else {
|
||||
@@ -8,9 +8,10 @@ import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/common/widgets/video_card_h_member_video.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/member/info.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/member/controller.dart';
|
||||
import 'package:PiliPlus/models/space_archive/item.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/member/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -21,8 +22,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../models/space_archive/item.dart';
|
||||
|
||||
class HorizontalMemberPage extends StatefulWidget {
|
||||
const HorizontalMemberPage({
|
||||
super.key,
|
||||
@@ -200,7 +199,8 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
||||
_controller.hasNext) {
|
||||
_controller.onLoadMore();
|
||||
}
|
||||
final Item videoItem = loadingState.response[index];
|
||||
final SpaceArchiveItem videoItem =
|
||||
loadingState.response[index];
|
||||
return VideoCardHMemberVideo(
|
||||
key: ValueKey('${videoItem.param}'),
|
||||
videoItem: videoItem,
|
||||
@@ -5,8 +5,8 @@ import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/pages/common/common_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/note/note_list_page_ctr.dart';
|
||||
import 'package:PiliPlus/pages/webview/webview_page.dart';
|
||||
import 'package:PiliPlus/pages/video/note/controller.dart';
|
||||
import 'package:PiliPlus/pages/webview/view.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -10,8 +10,8 @@ import 'package:PiliPlus/models/common/sponsor_block/action_type.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/post_segment_model.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/segment_type.dart';
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/model_hot_video_item.dart';
|
||||
import 'package:PiliPlus/pages/video/related/controller.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/skeleton/video_card_h.dart';
|
||||
import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/common/widgets/video_card_h.dart';
|
||||
import '../../../../common/constants.dart';
|
||||
import '../../../../utils/grid.dart';
|
||||
import './controller.dart';
|
||||
|
||||
class RelatedVideoPanel extends StatefulWidget {
|
||||
const RelatedVideoPanel({super.key, required this.heroTag});
|
||||
@@ -4,7 +4,7 @@ import 'package:PiliPlus/common/widgets/http_error.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models/common/reply_sort_type.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
@@ -8,8 +8,9 @@ import 'package:PiliPlus/common/widgets/report.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/common/widgets/save_panel.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/zan_grpc.dart';
|
||||
import 'package:PiliPlus/pages/save_panel/view.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/zan_grpc.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -20,7 +21,6 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/url_utils.dart';
|
||||
@@ -4,7 +4,7 @@ import 'package:PiliPlus/http/video.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/pages/common/common_publish_page.dart';
|
||||
import 'package:PiliPlus/pages/emote/view.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply_new/toolbar_icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/toolbar_icon_button.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -3,8 +3,8 @@ import 'package:PiliPlus/common/widgets/refresh_indicator.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/pages/common/common_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply_new/reply_page.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/widgets/reply_item_grpc.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_new/view.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
@@ -4,21 +4,35 @@ import 'dart:math';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/episode_panel.dart';
|
||||
import 'package:PiliPlus/pages/episode_panel/view.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
import 'package:PiliPlus/grpc/app/main/community/reply/v1/reply.pb.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/models/bangumi/info.dart';
|
||||
import 'package:PiliPlus/models/common/reply_type.dart';
|
||||
import 'package:PiliPlus/pages/bangumi/introduction/widgets/intro_detail.dart'
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/view.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/widgets/intro_detail.dart'
|
||||
as bangumi;
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/widgets/page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/widgets/season.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/member/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/member/horizontal_member_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply_reply/view.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/view_point/view_points_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/widgets/ai_detail.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/view.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/page.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/season.dart';
|
||||
import 'package:PiliPlus/pages/video/member/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/member/view.dart';
|
||||
import 'package:PiliPlus/pages/video/related/view.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/view.dart';
|
||||
import 'package:PiliPlus/pages/video/reply_reply/view.dart';
|
||||
import 'package:PiliPlus/pages/video/view_point/view.dart';
|
||||
import 'package:PiliPlus/pages/video/ai/view.dart';
|
||||
import 'package:PiliPlus/pages/video/widgets/header_control.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/view.dart';
|
||||
import 'package:PiliPlus/services/shutdown_timer_service.dart';
|
||||
import 'package:PiliPlus/utils/download.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -38,13 +52,8 @@ import 'package:get/get.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/pages/bangumi/introduction/index.dart';
|
||||
import 'package:PiliPlus/pages/danmaku/view.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/reply/index.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/index.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/related/index.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/services/service_locator.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
@@ -52,10 +61,6 @@ import 'package:PiliPlus/models/bangumi/info.dart' as bangumi;
|
||||
import 'package:PiliPlus/models/video_detail_res.dart' as video;
|
||||
import 'package:screen_brightness/screen_brightness.dart';
|
||||
|
||||
import '../../../services/shutdown_timer_service.dart';
|
||||
import 'widgets/header_control.dart';
|
||||
import 'package:PiliPlus/common/widgets/scroll_physics.dart';
|
||||
|
||||
class VideoDetailPageV extends StatefulWidget {
|
||||
const VideoDetailPageV({super.key});
|
||||
|
||||
@@ -3,8 +3,8 @@ import 'package:PiliPlus/common/widgets/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
|
||||
import 'package:PiliPlus/pages/common/common_collapse_slide_page.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
|
||||
class ScrollAppBar extends StatelessWidget {
|
||||
final double scrollVal;
|
||||
@@ -6,9 +6,15 @@ import 'package:PiliPlus/common/widgets/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/self_sized_horizontal_list.dart';
|
||||
import 'package:PiliPlus/models/common/search_type.dart';
|
||||
import 'package:PiliPlus/models/common/super_resolution_type.dart';
|
||||
import 'package:PiliPlus/pages/bangumi/introduction/controller.dart';
|
||||
import 'package:PiliPlus/models/video/play/CDN.dart';
|
||||
import 'package:PiliPlus/pages/setting/widgets/select_dialog.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||
import 'package:PiliPlus/pages/setting/widgets/switch_item.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/widgets/action_item.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/action_item.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/utils/fullscreen.dart';
|
||||
import 'package:PiliPlus/utils/download.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
@@ -28,15 +34,10 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:PiliPlus/models/video/play/quality.dart';
|
||||
import 'package:PiliPlus/models/video/play/url.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/index.dart';
|
||||
import 'package:PiliPlus/pages/video/detail/introduction/widgets/menu_row.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/index.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/menu_row.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import '../../../../models/video/play/CDN.dart';
|
||||
import '../../../setting/widgets/select_dialog.dart';
|
||||
import '../introduction/index.dart';
|
||||
import 'package:marquee/marquee.dart';
|
||||
|
||||
class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
||||
Reference in New Issue
Block a user