mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-28 22:40:13 +08:00
@@ -567,7 +567,7 @@ class VideoDetailController extends GetxController
|
||||
alpha: 0.8,
|
||||
),
|
||||
textColor: theme.colorScheme.onSecondaryContainer,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
padding: const .symmetric(horizontal: 8, vertical: 4),
|
||||
fontSize: 14,
|
||||
text: item is SegmentModel
|
||||
? '跳过: ${item.segmentType.shortTitle}'
|
||||
|
||||
@@ -41,15 +41,13 @@ import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/share_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
late ExpandableController expandableCtr;
|
||||
|
||||
late final RxBool expand;
|
||||
final RxBool status = true.obs;
|
||||
|
||||
// up主粉丝数
|
||||
@@ -72,18 +70,15 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
bool alwaysExpandIntroPanel = Pref.alwaysExpandIntroPanel;
|
||||
expandableCtr = ExpandableController(
|
||||
initialExpanded: alwaysExpandIntroPanel,
|
||||
);
|
||||
final alwaysExpandIntroPanel = Pref.alwaysExpandIntroPanel;
|
||||
expand = RxBool(alwaysExpandIntroPanel);
|
||||
if (!alwaysExpandIntroPanel && Pref.expandIntroPanelH) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!expandableCtr.expanded && !DeviceUtils.size.isPortrait) {
|
||||
expandableCtr.toggle();
|
||||
if (!expand.value && !DeviceUtils.size.isPortrait) {
|
||||
expand.toggle();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
videoDetail.value.title = Get.arguments['title'] ?? '';
|
||||
}
|
||||
|
||||
@@ -558,12 +553,6 @@ class UgcIntroController extends CommonIntroController with ReloadMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
expandableCtr.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
/// 播放上一个
|
||||
@override
|
||||
bool prevPlay([bool skipPart = false]) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:PiliPlus/common/assets.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/style.dart';
|
||||
import 'package:PiliPlus/common/widgets/dialog/dialog.dart';
|
||||
import 'package:PiliPlus/common/widgets/expandable.dart';
|
||||
import 'package:PiliPlus/common/widgets/gesture/tap_gesture_recognizer.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/pendant_avatar.dart';
|
||||
@@ -37,7 +38,6 @@ import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:expandable/expandable.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -82,13 +82,6 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
const expandTheme = ExpandableThemeData(
|
||||
animationDuration: Duration(milliseconds: 300),
|
||||
scrollAnimationDuration: Duration(milliseconds: 300),
|
||||
crossFadePoint: 0,
|
||||
fadeCurve: Curves.ease,
|
||||
sizeCurve: Curves.linear,
|
||||
);
|
||||
final isPortrait = widget.isPortrait;
|
||||
final isHorizontal = !isPortrait && widget.isHorizontal;
|
||||
return SliverPadding(
|
||||
@@ -110,7 +103,7 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
return;
|
||||
}
|
||||
feedBack();
|
||||
introController.expandableCtr.toggle();
|
||||
introController.expand.toggle();
|
||||
},
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -191,11 +184,16 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
),
|
||||
)
|
||||
else
|
||||
ExpandablePanel(
|
||||
controller: introController.expandableCtr,
|
||||
collapsed: _buildTitle(theme, videoDetail),
|
||||
expanded: _buildTitle(theme, videoDetail, isExpand: true),
|
||||
theme: expandTheme,
|
||||
Obx(
|
||||
() => ExpandablePanel(
|
||||
collapsed: _buildTitle(theme, videoDetail),
|
||||
expanded: _buildTitle(
|
||||
theme,
|
||||
videoDetail,
|
||||
isExpand: true,
|
||||
),
|
||||
expand: introController.expand.value,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Stack(
|
||||
@@ -236,15 +234,16 @@ class _UgcIntroPanelState extends State<UgcIntroPanel> {
|
||||
if (isHorizontal && PlatformUtils.isDesktop)
|
||||
..._infos(theme, videoDetail)
|
||||
else
|
||||
ExpandablePanel(
|
||||
controller: introController.expandableCtr,
|
||||
collapsed: const SizedBox.shrink(),
|
||||
expanded: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: _infos(theme, videoDetail),
|
||||
Obx(
|
||||
() => ExpandablePanel(
|
||||
collapsed: const SizedBox(width: .infinity, height: 0),
|
||||
expanded: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: _infos(theme, videoDetail),
|
||||
),
|
||||
expand: introController.expand.value,
|
||||
),
|
||||
theme: expandTheme,
|
||||
),
|
||||
Obx(
|
||||
() => introController.status.value
|
||||
|
||||
@@ -54,8 +54,7 @@ class _ViewPointsPageState extends State<ViewPointsPage>
|
||||
scale: 0.8,
|
||||
child: Switch(
|
||||
value: videoDetailController.showVP.value,
|
||||
onChanged: (value) =>
|
||||
videoDetailController.showVP.value = value,
|
||||
onChanged: videoDetailController.showVP.call,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user