Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-05 12:47:44 +08:00
parent 52373dc540
commit f93753ccfd
4 changed files with 17 additions and 24 deletions

View File

@@ -88,7 +88,9 @@ abstract class CommonDynPageState<T extends StatefulWidget> extends State<T>
@override @override
void dispose() { void dispose() {
scrollController.dispose(); scrollController
..removeListener(listener)
..dispose();
super.dispose(); super.dispose();
} }

View File

@@ -170,8 +170,7 @@ class _MusicDetailPageState extends CommonDynPageState<MusicDetailPage> {
body: refreshIndicator( body: refreshIndicator(
onRefresh: controller.onRefresh, onRefresh: controller.onRefresh,
child: CustomScrollView( child: CustomScrollView(
controller: controller controller: scrollController,
.scrollController, // debug: The provided ScrollController is attached to more than one ScrollPosition.
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
slivers: [ slivers: [
buildReplyHeader(theme), buildReplyHeader(theme),

View File

@@ -981,31 +981,27 @@ List<SettingsModel> get extraSettings => [
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
const SizedBox(height: 6), const SizedBox(height: 6),
TextField( TextFormField(
decoration: InputDecoration( initialValue: systemProxyHost,
decoration: const InputDecoration(
isDense: true, isDense: true,
labelText: systemProxyHost.isNotEmpty labelText: '请输入Host使用 . 分割',
? systemProxyHost border: OutlineInputBorder(
: '请输入Host使用 . 分割',
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
), ),
hintText: systemProxyHost,
), ),
onChanged: (e) => systemProxyHost = e, onChanged: (e) => systemProxyHost = e,
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
TextField( TextFormField(
initialValue: systemProxyPort,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: const InputDecoration(
isDense: true, isDense: true,
labelText: systemProxyPort.isNotEmpty labelText: '请输入Port',
? systemProxyPort border: OutlineInputBorder(
: '请输入Port',
border: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
), ),
hintText: systemProxyPort,
), ),
inputFormatters: [FilteringTextInputFormatter.digitsOnly], inputFormatters: [FilteringTextInputFormatter.digitsOnly],
onChanged: (e) => systemProxyPort = e, onChanged: (e) => systemProxyPort = e,

View File

@@ -1108,7 +1108,8 @@ class PlPlayerController {
} else if (event.startsWith('Could not open codec')) { } else if (event.startsWith('Could not open codec')) {
SmartDialog.showToast('无法加载解码器, $event,可能会切换至软解'); SmartDialog.showToast('无法加载解码器, $event,可能会切换至软解');
} else if (!onlyPlayAudio.value) { } else if (!onlyPlayAudio.value) {
if (event.startsWith("Failed to open .") || if (event.startsWith("error running") ||
event.startsWith("Failed to open .") ||
event.startsWith("Cannot open") || event.startsWith("Cannot open") ||
event.startsWith("Can not open")) { event.startsWith("Can not open")) {
return; return;
@@ -1442,14 +1443,9 @@ class PlPlayerController {
} }
} }
int _durationInSeconds(Duration duration) {
return (duration.inMilliseconds / 1000).round();
}
bool get _isCompleted => bool get _isCompleted =>
videoPlayerController!.state.completed || videoPlayerController!.state.completed ||
(_durationInSeconds(position.value) == (duration.value - position.value).inMilliseconds <= 50;
_durationInSeconds(duration.value));
// 双击播放、暂停 // 双击播放、暂停
Future<void> onDoubleTapCenter() async { Future<void> onDoubleTapCenter() async {