opt: 转载视频标识
This commit is contained in:
@ -66,6 +66,8 @@ class VideoIntroController extends GetxController {
|
|||||||
late bool enableRelatedVideo;
|
late bool enableRelatedVideo;
|
||||||
UgcSeason? ugcSeason;
|
UgcSeason? ugcSeason;
|
||||||
RxList<Part> pages = <Part>[].obs;
|
RxList<Part> pages = <Part>[].obs;
|
||||||
|
// 默认原创视频
|
||||||
|
int copyright = 1;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
@ -94,6 +96,7 @@ class VideoIntroController extends GetxController {
|
|||||||
videoDetail.value = result['data']!;
|
videoDetail.value = result['data']!;
|
||||||
ugcSeason = result['data']!.ugcSeason;
|
ugcSeason = result['data']!.ugcSeason;
|
||||||
pages.value = result['data']!.pages!;
|
pages.value = result['data']!.pages!;
|
||||||
|
copyright = result['data']!.copyright!;
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
lastPlayCid.value = cid ?? videoDetail.value.cid!;
|
lastPlayCid.value = cid ?? videoDetail.value.cid!;
|
||||||
}
|
}
|
||||||
@ -215,7 +218,7 @@ class VideoIntroController extends GetxController {
|
|||||||
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
contentPadding: const EdgeInsets.fromLTRB(0, 12, 0, 24),
|
||||||
content: Column(
|
content: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [1, 2]
|
children: (copyright == 2 ? [1] : [1, 2])
|
||||||
.map(
|
.map(
|
||||||
(e) => ListTile(
|
(e) => ListTile(
|
||||||
title: Padding(
|
title: Padding(
|
||||||
|
@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
import 'package:pilipala/common/constants.dart';
|
import 'package:pilipala/common/constants.dart';
|
||||||
import 'package:pilipala/common/skeleton/video_intro.dart';
|
import 'package:pilipala/common/skeleton/video_intro.dart';
|
||||||
|
import 'package:pilipala/common/widgets/badge.dart';
|
||||||
import 'package:pilipala/common/widgets/http_error.dart';
|
import 'package:pilipala/common/widgets/http_error.dart';
|
||||||
import 'package:pilipala/pages/video/detail/index.dart';
|
import 'package:pilipala/pages/video/detail/index.dart';
|
||||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||||
@ -264,6 +265,26 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final ThemeData t = Theme.of(context);
|
final ThemeData t = Theme.of(context);
|
||||||
final Color outline = t.colorScheme.outline;
|
final Color outline = t.colorScheme.outline;
|
||||||
|
const TextStyle titleStyle = TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
);
|
||||||
|
|
||||||
|
TextSpan titltWidget = TextSpan(
|
||||||
|
children: [
|
||||||
|
WidgetSpan(
|
||||||
|
child: Visibility(
|
||||||
|
visible: widget.videoDetail!.copyright == 2,
|
||||||
|
child: const PBadge(text: '转载', type: 'color'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(text: ' '),
|
||||||
|
TextSpan(
|
||||||
|
text: widget.videoDetail!.title!,
|
||||||
|
style: titleStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
return SliverPadding(
|
return SliverPadding(
|
||||||
padding: const EdgeInsets.only(
|
padding: const EdgeInsets.only(
|
||||||
left: StyleString.safeSpace,
|
left: StyleString.safeSpace,
|
||||||
@ -285,25 +306,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
},
|
},
|
||||||
child: ExpandablePanel(
|
child: ExpandablePanel(
|
||||||
controller: _expandableCtr,
|
controller: _expandableCtr,
|
||||||
collapsed: Text(
|
collapsed: Text.rich(softWrap: true, maxLines: 2, titltWidget),
|
||||||
widget.videoDetail!.title!,
|
expanded: Text.rich(softWrap: true, maxLines: 10, titltWidget),
|
||||||
softWrap: true,
|
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
expanded: Text(
|
|
||||||
widget.videoDetail!.title!,
|
|
||||||
softWrap: true,
|
|
||||||
maxLines: 10,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 18,
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
theme: const ExpandableThemeData(
|
theme: const ExpandableThemeData(
|
||||||
animationDuration: Duration(milliseconds: 300),
|
animationDuration: Duration(milliseconds: 300),
|
||||||
scrollAnimationDuration: Duration(milliseconds: 300),
|
scrollAnimationDuration: Duration(milliseconds: 300),
|
||||||
|
Reference in New Issue
Block a user