mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-16 06:03:54 +08:00
Compare commits
5 Commits
1.1.5-pre7
...
1.1.5-pre8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54b26d20fa | ||
|
|
ad2bc78ebd | ||
|
|
c4aca389a8 | ||
|
|
cb8333d4c0 | ||
|
|
2f5eed6998 |
@@ -399,12 +399,12 @@ class _MarqueeSimulation extends Simulation {
|
||||
class ContextSingleTicker implements TickerProvider {
|
||||
Ticker? _ticker;
|
||||
BuildContext context;
|
||||
final bool autoStart;
|
||||
final bool Function()? autoStart;
|
||||
|
||||
ContextSingleTicker(this.context, {this.autoStart = true});
|
||||
ContextSingleTicker(this.context, {this.autoStart});
|
||||
|
||||
void initStart() {
|
||||
if (autoStart) {
|
||||
if (autoStart?.call() ?? true) {
|
||||
_ticker?.start();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ class VideoPopupMenu extends StatelessWidget {
|
||||
return Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 280,
|
||||
maxWidth: 420,
|
||||
),
|
||||
child: Padding(
|
||||
|
||||
@@ -249,6 +249,7 @@ class MyApp extends StatelessWidget {
|
||||
variant: variant,
|
||||
// dynamicSchemeVariant: dynamicSchemeVariant,
|
||||
// tones: FlexTones.soft(Brightness.light),
|
||||
useExpressiveOnContainerColors: false,
|
||||
);
|
||||
darkColorScheme = SeedColorScheme.fromSeeds(
|
||||
primaryKey: brandColor,
|
||||
@@ -256,6 +257,7 @@ class MyApp extends StatelessWidget {
|
||||
variant: variant,
|
||||
// dynamicSchemeVariant: dynamicSchemeVariant,
|
||||
// tones: FlexTones.soft(Brightness.dark),
|
||||
useExpressiveOnContainerColors: false,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ Widget addWidget(
|
||||
builder: (context) {
|
||||
final btn = reserve.button!;
|
||||
final isReserved = btn.status == btn.type;
|
||||
final bool canJump = btn.jumpUrl != null;
|
||||
final bool canJump = btn.jumpUrl?.isNotEmpty == true;
|
||||
return FilledButton.tonal(
|
||||
style: FilledButton.styleFrom(
|
||||
foregroundColor: canJump
|
||||
|
||||
@@ -234,7 +234,7 @@ class _VotePanelState extends State<VotePanel> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_enabled)
|
||||
if (_enabled || selected)
|
||||
Positioned(
|
||||
right: 4,
|
||||
top: 4,
|
||||
@@ -436,18 +436,19 @@ Future showVoteDialog(
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => Dialog(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 625),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: VotePanel(
|
||||
voteInfo: voteInfo.data,
|
||||
callback: (votes, anonymity) => DynamicsHttp.doVote(
|
||||
voteId: voteId,
|
||||
votes: votes.toList(),
|
||||
anonymity: anonymity,
|
||||
dynamicId: dynamicId,
|
||||
),
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 280,
|
||||
maxWidth: 625,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: VotePanel(
|
||||
voteInfo: voteInfo.data,
|
||||
callback: (votes, anonymity) => DynamicsHttp.doVote(
|
||||
voteId: voteId,
|
||||
votes: votes.toList(),
|
||||
anonymity: anonymity,
|
||||
dynamicId: dynamicId,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -54,6 +54,7 @@ class _LiveHeaderControlState extends State<LiveHeaderControl>
|
||||
Widget child;
|
||||
if (widget.title case final title?) {
|
||||
child = MarqueeText(
|
||||
key: titleKey,
|
||||
title,
|
||||
spacing: 30,
|
||||
velocity: 30,
|
||||
|
||||
@@ -273,7 +273,9 @@ class VideoDetailController extends GetxController
|
||||
|
||||
late final watchProgress = GStorage.watchProgress;
|
||||
void cacheLocalProgress() {
|
||||
if (playedTime case final playedTime?) {
|
||||
if (plPlayerController.playerStatus.completed) {
|
||||
watchProgress.put(cid.value.toString(), entry.totalTimeMilli);
|
||||
} else if (playedTime case final playedTime?) {
|
||||
watchProgress.put(cid.value.toString(), playedTime.inMilliseconds);
|
||||
}
|
||||
}
|
||||
@@ -1185,7 +1187,7 @@ class VideoDetailController extends GetxController
|
||||
);
|
||||
|
||||
if (!isFileSource) {
|
||||
if (plPlayerController.enableSponsorBlock) {
|
||||
if (plPlayerController.enableBlock) {
|
||||
initSkip();
|
||||
}
|
||||
|
||||
@@ -1707,7 +1709,7 @@ class VideoDetailController extends GetxController
|
||||
}
|
||||
|
||||
// sponsor block
|
||||
if (plPlayerController.enableSponsorBlock) {
|
||||
if (plPlayerController.enableBlock) {
|
||||
_lastPos = null;
|
||||
positionSubscription?.cancel();
|
||||
positionSubscription = null;
|
||||
@@ -1799,7 +1801,7 @@ class VideoDetailController extends GetxController
|
||||
@pragma('vm:notify-debugger-on-exception')
|
||||
bool onSkipSegment() {
|
||||
try {
|
||||
if (plPlayerController.enableSponsorBlock) {
|
||||
if (plPlayerController.enableBlock) {
|
||||
if (listData.lastOrNull case SegmentModel item) {
|
||||
onSkip(item, isSeek: false);
|
||||
onRemoveItem(listData.indexOf(item), item);
|
||||
|
||||
@@ -190,10 +190,10 @@ class _HorizontalMemberPageState extends State<HorizontalMemberPage> {
|
||||
LoadingState<List<SpaceArchiveItem>?> loadingState,
|
||||
) {
|
||||
return switch (loadingState) {
|
||||
Loading() => SliverPrototypeExtentList.builder(
|
||||
Loading() => SliverFixedExtentList.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (_, _) => const VideoCardHSkeleton(),
|
||||
prototypeItem: const VideoCardHSkeleton(),
|
||||
itemExtent: 100,
|
||||
),
|
||||
Success(:var response) =>
|
||||
response?.isNotEmpty == true
|
||||
|
||||
@@ -1028,12 +1028,19 @@ class ReplyItemGrpc extends StatelessWidget {
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return Dialog(
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 280,
|
||||
maxWidth: 425,
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 20,
|
||||
vertical: 16,
|
||||
),
|
||||
child: SelectableText(message),
|
||||
child: SelectableText(
|
||||
message,
|
||||
style: const TextStyle(fontSize: 15, height: 1.7),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -1613,7 +1613,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
}),
|
||||
manualPlayerWidget,
|
||||
|
||||
if (videoDetailController.plPlayerController.enableSponsorBlock ||
|
||||
if (videoDetailController.plPlayerController.enableBlock ||
|
||||
videoDetailController.continuePlayingPart)
|
||||
Positioned(
|
||||
left: 16,
|
||||
|
||||
@@ -61,9 +61,15 @@ import 'package:intl/intl.dart' show DateFormat;
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
|
||||
mixin TimeBatteryMixin<T extends StatefulWidget> on State<T> {
|
||||
PlPlayerController get plPlayerController;
|
||||
late final titleKey = GlobalKey();
|
||||
ContextSingleTicker? provider;
|
||||
ContextSingleTicker get effectiveProvider =>
|
||||
provider ??= ContextSingleTicker(context, autoStart: false);
|
||||
ContextSingleTicker get effectiveProvider => provider ??= ContextSingleTicker(
|
||||
context,
|
||||
autoStart: () =>
|
||||
plPlayerController.showControls.value &&
|
||||
!plPlayerController.controlsLock.value,
|
||||
);
|
||||
|
||||
bool get isPortrait;
|
||||
bool get isFullScreen;
|
||||
@@ -102,10 +108,7 @@ mixin TimeBatteryMixin<T extends StatefulWidget> on State<T> {
|
||||
bool _showCurrTime = false;
|
||||
void showCurrTimeIfNeeded(bool isFullScreen) {
|
||||
_showCurrTime = !isPortrait && (isFullScreen || !horizontalScreen);
|
||||
if (_showCurrTime) {
|
||||
now.value = _format.format(DateTime.now());
|
||||
getBatteryLevelIfNeeded();
|
||||
} else {
|
||||
if (!_showCurrTime) {
|
||||
stopClock();
|
||||
}
|
||||
}
|
||||
@@ -1420,7 +1423,10 @@ class HeaderControlState extends State<HeaderControl>
|
||||
return AlertDialog(
|
||||
title: const Text('播放信息'),
|
||||
contentPadding: const EdgeInsets.only(top: 16),
|
||||
constraints: const BoxConstraints(maxWidth: 425),
|
||||
constraints: const BoxConstraints(
|
||||
minWidth: 280,
|
||||
maxWidth: 425,
|
||||
),
|
||||
content: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: ListTileTheme(
|
||||
@@ -2449,6 +2455,7 @@ class HeaderControlState extends State<HeaderControl>
|
||||
videoDetail.title!;
|
||||
}
|
||||
return MarqueeText(
|
||||
key: titleKey,
|
||||
title,
|
||||
spacing: 30,
|
||||
velocity: 30,
|
||||
@@ -2581,7 +2588,7 @@ class HeaderControlState extends State<HeaderControl>
|
||||
),
|
||||
),
|
||||
],
|
||||
if (plPlayerController.enableSponsorBlock == true)
|
||||
if (plPlayerController.enableSponsorBlock)
|
||||
SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
|
||||
@@ -399,7 +399,8 @@ class PlPlayerController {
|
||||
late final pgcSkipType = Pref.pgcSkipType;
|
||||
late final enablePgcSkip = Pref.pgcSkipType != SkipType.disable;
|
||||
// sponsor block
|
||||
late final bool enableSponsorBlock = Pref.enableSponsorBlock || enablePgcSkip;
|
||||
late final bool enableSponsorBlock = Pref.enableSponsorBlock;
|
||||
late final bool enableBlock = enableSponsorBlock || enablePgcSkip;
|
||||
late final double blockLimit = Pref.blockLimit;
|
||||
late final blockSettings = Pref.blockSettings;
|
||||
late final List<Color> blockColor = Pref.blockColor;
|
||||
|
||||
@@ -1787,7 +1787,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
0,
|
||||
),
|
||||
),
|
||||
if (plPlayerController.enableSponsorBlock &&
|
||||
if (plPlayerController.enableBlock &&
|
||||
videoDetailController.segmentProgressList.isNotEmpty)
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
@@ -132,7 +132,7 @@ class BottomControl extends StatelessWidget {
|
||||
alignment: Alignment.bottomCenter,
|
||||
children: [
|
||||
progressBar(),
|
||||
if (controller.enableSponsorBlock &&
|
||||
if (controller.enableBlock &&
|
||||
videoDetailController.segmentProgressList.isNotEmpty)
|
||||
Positioned(
|
||||
left: 0,
|
||||
|
||||
@@ -586,10 +586,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flex_seed_scheme
|
||||
sha256: "828291a5a4d4283590541519d8b57821946660ac61d2e07d955f81cfcab22e5d"
|
||||
sha256: a3183753bbcfc3af106224bff3ab3e1844b73f58062136b7499919f49f3667e7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.6.1"
|
||||
version: "4.0.1"
|
||||
floating:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -2046,4 +2046,4 @@ packages:
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.10.0 <4.0.0"
|
||||
flutter: "3.38.2"
|
||||
flutter: "3.38.3"
|
||||
|
||||
@@ -21,7 +21,7 @@ version: 1.1.5+1
|
||||
|
||||
environment:
|
||||
sdk: ">=3.10.0"
|
||||
flutter: 3.38.2 # update `.fvmrc` config
|
||||
flutter: 3.38.3 # update `.fvmrc` config
|
||||
|
||||
# Dependencies specify other packages that your package needs in order to work.
|
||||
# To automatically upgrade your package dependencies to the latest versions
|
||||
@@ -190,7 +190,7 @@ dependencies:
|
||||
#解压直播消息
|
||||
brotli: ^0.6.0
|
||||
expandable: ^5.0.1
|
||||
flex_seed_scheme: ^3.4.1
|
||||
flex_seed_scheme: ^4.0.1
|
||||
live_photo_maker: ^0.0.6
|
||||
fl_chart: ^1.0.0
|
||||
synchronized: ^3.3.0
|
||||
|
||||
Reference in New Issue
Block a user