Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-08-30 14:50:54 +08:00
parent 80fa0240e9
commit 8d94c0405f
115 changed files with 3150 additions and 1438 deletions

View File

@@ -6,14 +6,14 @@ class CustomSliverPersistentHeaderDelegate
required this.child,
required this.bgColor,
double extent = 45,
this.needRebuild,
this.needRebuild = false,
}) : _minExtent = extent,
_maxExtent = extent;
final double _minExtent;
final double _maxExtent;
final Widget child;
final Color? bgColor;
final bool? needRebuild;
final bool needRebuild;
@override
Widget build(
@@ -26,15 +26,7 @@ class CustomSliverPersistentHeaderDelegate
//overlapsContentSliverPersistentHeader覆盖其他子组件返回true否则返回false
return bgColor != null
? DecoratedBox(
decoration: BoxDecoration(
color: bgColor,
boxShadow: [
BoxShadow(
color: bgColor!,
offset: const Offset(0, -2),
),
],
),
decoration: BoxDecoration(color: bgColor),
child: child,
)
: child;
@@ -51,6 +43,6 @@ class CustomSliverPersistentHeaderDelegate
@override
bool shouldRebuild(CustomSliverPersistentHeaderDelegate oldDelegate) {
return oldDelegate.bgColor != bgColor ||
(needRebuild == true && oldDelegate.child != child);
(needRebuild && oldDelegate.child != child);
}
}

View File

@@ -1,13 +1,13 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
void showConfirmDialog({
Future<void> showConfirmDialog({
required BuildContext context,
required String title,
dynamic content,
required VoidCallback onConfirm,
}) {
showDialog(
return showDialog(
context: context,
builder: (context) {
return AlertDialog(

View File

@@ -113,18 +113,14 @@ class _DynamicSliverAppBarMediumState extends State<DynamicSliverAppBarMedium> {
});
}
Orientation? _orientation;
late Size size;
double? _width;
@override
void didChangeDependencies() {
super.didChangeDependencies();
size = MediaQuery.sizeOf(context);
final orientation = size.width > size.height
? Orientation.landscape
: Orientation.portrait;
if (orientation != _orientation) {
_orientation = orientation;
final width = MediaQuery.widthOf(context);
if (_width != width) {
_width = width;
_height = 0;
_updateHeight();
}
@@ -139,7 +135,7 @@ class _DynamicSliverAppBarMediumState extends State<DynamicSliverAppBarMedium> {
alignment: Alignment.topLeft,
child: SizedBox(
key: _childKey,
width: size.width,
width: _width,
child: widget.flexibleSpace,
),
),

View File

@@ -11,7 +11,6 @@ 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:get/get.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart';
@@ -48,7 +47,6 @@ class InteractiveviewerGallery extends StatefulWidget {
this.minScale = 1.0,
this.onPageChanged,
this.onDismissed,
this.setStatusBar = true,
this.onClose,
required this.quality,
});
@@ -57,8 +55,6 @@ class InteractiveviewerGallery extends StatefulWidget {
final ValueChanged<bool>? onClose;
final bool setStatusBar;
/// The sources to show.
final List<SourceModel> sources;
@@ -114,10 +110,6 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
duration: const Duration(milliseconds: 300),
)..addListener(listener);
if (widget.setStatusBar) {
setStatusBar();
}
var item = widget.sources[currentIndex.value];
if (item.sourceType == SourceType.livePhoto) {
_onPlay(item.liveUrl!);
@@ -128,18 +120,6 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_transformationController!.value = _animation?.value ?? Matrix4.identity();
}
SystemUiMode? mode;
Future<void> setStatusBar() async {
if (Platform.isIOS || Platform.isAndroid) {
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.immersiveSticky,
);
}
if (Platform.isAndroid && (await Utils.sdkInt < 29)) {
mode = SystemUiMode.manual;
}
}
@override
void dispose() {
widget.onClose?.call(true);
@@ -148,14 +128,6 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_animationController
..removeListener(listener)
..dispose();
if (widget.setStatusBar) {
if (Platform.isIOS || Platform.isAndroid) {
SystemChrome.setEnabledSystemUIMode(
mode ?? SystemUiMode.edgeToEdge,
overlays: SystemUiOverlay.values,
);
}
}
for (var item in widget.sources) {
if (item.sourceType == SourceType.networkImage) {
CachedNetworkImageProvider(_getActualUrl(item.url)).evict();

File diff suppressed because it is too large Load Diff

View File

@@ -19,10 +19,7 @@ class HttpError extends StatelessWidget {
Widget build(BuildContext context) {
return isSliver
? SliverToBoxAdapter(child: content(context))
: SizedBox(
width: double.infinity,
child: content(context),
);
: content(context);
}
Widget content(BuildContext context) {

View File

@@ -22,13 +22,13 @@ class PendantAvatar extends StatelessWidget {
required this.avatar,
this.size = 80,
double? badgeSize,
bool? isVip,
bool isVip = false,
int? officialType,
this.garbPendantImage,
this.roomId,
this.onTap,
}) : _badgeType = officialType == null || officialType < 0
? isVip == true
? isVip
? BadgeType.vip
: BadgeType.none
: officialType == 0

View File

@@ -18,6 +18,26 @@ class Segment {
this.from,
this.to,
]);
@override
bool operator ==(Object other) {
if (identical(this, other)) {
return true;
}
if (other is Segment) {
return start == other.start &&
end == other.end &&
color == other.color &&
title == other.title &&
url == other.url &&
from == other.from &&
to == other.to;
}
return false;
}
@override
int get hashCode => Object.hash(start, end, color, title, url, from, to);
}
class SegmentProgressBar extends CustomPainter {
@@ -126,7 +146,7 @@ class SegmentProgressBar extends CustomPainter {
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) {
return false;
bool shouldRepaint(SegmentProgressBar oldDelegate) {
return segmentColors != oldDelegate.segmentColors;
}
}