mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: lint
mod: tweaks opt: publish page Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -29,28 +29,28 @@ class Constants {
|
||||
static const urlPattern =
|
||||
r'https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]';
|
||||
|
||||
static get goodsUrlPrefix => "https://gaoneng.bilibili.com/tetris";
|
||||
static const goodsUrlPrefix = "https://gaoneng.bilibili.com/tetris";
|
||||
|
||||
// 超分辨率滤镜
|
||||
static List<String> get mpvAnime4KShaders => [
|
||||
'Anime4K_Clamp_Highlights.glsl',
|
||||
'Anime4K_Restore_CNN_VL.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_VL.glsl',
|
||||
'Anime4K_AutoDownscalePre_x2.glsl',
|
||||
'Anime4K_AutoDownscalePre_x4.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_M.glsl'
|
||||
];
|
||||
static const List<String> mpvAnime4KShaders = [
|
||||
'Anime4K_Clamp_Highlights.glsl',
|
||||
'Anime4K_Restore_CNN_VL.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_VL.glsl',
|
||||
'Anime4K_AutoDownscalePre_x2.glsl',
|
||||
'Anime4K_AutoDownscalePre_x4.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_M.glsl'
|
||||
];
|
||||
|
||||
// 超分辨率滤镜 (轻量)
|
||||
static List<String> get mpvAnime4KShadersLite => [
|
||||
'Anime4K_Clamp_Highlights.glsl',
|
||||
'Anime4K_Restore_CNN_M.glsl',
|
||||
'Anime4K_Restore_CNN_S.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_M.glsl',
|
||||
'Anime4K_AutoDownscalePre_x2.glsl',
|
||||
'Anime4K_AutoDownscalePre_x4.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_S.glsl'
|
||||
];
|
||||
static const mpvAnime4KShadersLite = [
|
||||
'Anime4K_Clamp_Highlights.glsl',
|
||||
'Anime4K_Restore_CNN_M.glsl',
|
||||
'Anime4K_Restore_CNN_S.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_M.glsl',
|
||||
'Anime4K_AutoDownscalePre_x2.glsl',
|
||||
'Anime4K_AutoDownscalePre_x4.glsl',
|
||||
'Anime4K_Upscale_CNN_x2_S.glsl'
|
||||
];
|
||||
|
||||
//内容来自 https://passport.bilibili.com/web/generic/country/list
|
||||
static List<Map<String, dynamic>> get internationalDialingPrefix => [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class DynamicCardSkeleton extends StatelessWidget {
|
||||
const DynamicCardSkeleton({super.key});
|
||||
@@ -28,7 +28,7 @@ class DynamicCardSkeleton extends StatelessWidget {
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class FavPgcItemSkeleton extends StatelessWidget {
|
||||
const FavPgcItemSkeleton({super.key});
|
||||
@@ -25,7 +25,7 @@ class FavPgcItemSkeleton extends StatelessWidget {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(4)),
|
||||
),
|
||||
width: boxConstraints.maxWidth,
|
||||
height: boxConstraints.maxHeight,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class MediaBangumiSkeleton extends StatefulWidget {
|
||||
const MediaBangumiSkeleton({super.key});
|
||||
@@ -24,8 +24,9 @@ class _MediaBangumiSkeletonState extends State<MediaBangumiSkeleton> {
|
||||
width: 111,
|
||||
height: 148,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
color: bgColor),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(6)),
|
||||
color: bgColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class MsgFeedSysMsgSkeleton extends StatelessWidget {
|
||||
const MsgFeedSysMsgSkeleton({super.key});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class MsgFeedTopSkeleton extends StatelessWidget {
|
||||
const MsgFeedTopSkeleton({super.key});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class VideoCardHSkeleton extends StatelessWidget {
|
||||
const VideoCardHSkeleton({super.key});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class VideoCardVSkeleton extends StatelessWidget {
|
||||
const VideoCardVSkeleton({super.key});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class VideoReplySkeleton extends StatelessWidget {
|
||||
const VideoReplySkeleton({super.key});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'skeleton.dart';
|
||||
import 'package:PiliPlus/common/skeleton/skeleton.dart';
|
||||
|
||||
class WhisperItemSkeleton extends StatelessWidget {
|
||||
const WhisperItemSkeleton({super.key});
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import 'image/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/image/network_img_layer.dart';
|
||||
|
||||
class Avatar extends StatelessWidget {
|
||||
final _BadgeType _badgeType;
|
||||
@@ -73,10 +73,10 @@ class Avatar extends StatelessWidget {
|
||||
Get.toNamed('/liveRoom?roomid=$roomId');
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 5, vertical: 1),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 1),
|
||||
decoration: BoxDecoration(
|
||||
color: colorScheme.secondaryContainer,
|
||||
borderRadius: BorderRadius.circular(36),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(36)),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -106,7 +106,7 @@ class Avatar extends StatelessWidget {
|
||||
}
|
||||
|
||||
Widget _buildAvatar(ColorScheme colorScheme) => size == 80
|
||||
? Container(
|
||||
? DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 2,
|
||||
@@ -114,11 +114,14 @@ class Avatar extends StatelessWidget {
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: NetworkImgLayer(
|
||||
src: avatar,
|
||||
width: size,
|
||||
height: size,
|
||||
type: 'avatar',
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(2),
|
||||
child: NetworkImgLayer(
|
||||
src: avatar,
|
||||
width: size,
|
||||
height: size,
|
||||
type: 'avatar',
|
||||
),
|
||||
),
|
||||
)
|
||||
: NetworkImgLayer(
|
||||
|
||||
@@ -64,12 +64,12 @@ class PBadge extends StatelessWidget {
|
||||
late EdgeInsets paddingStyle =
|
||||
const EdgeInsets.symmetric(vertical: 2, horizontal: 3);
|
||||
double fontSize = 11;
|
||||
BorderRadius br = BorderRadius.circular(4);
|
||||
BorderRadius br = const BorderRadius.all(Radius.circular(4));
|
||||
|
||||
if (size == 'small') {
|
||||
paddingStyle = const EdgeInsets.symmetric(vertical: 2, horizontal: 3);
|
||||
fontSize = 11;
|
||||
br = BorderRadius.circular(3);
|
||||
br = const BorderRadius.all(Radius.circular(3));
|
||||
}
|
||||
|
||||
Widget content = Container(
|
||||
|
||||
@@ -17,7 +17,7 @@ class CustomToast extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 17, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.primaryContainer.withOpacity(toastOpacity),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(20)),
|
||||
),
|
||||
child: Text(
|
||||
msg,
|
||||
@@ -44,7 +44,7 @@ class LoadingWidget extends StatelessWidget {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 20),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.dialogBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(15)),
|
||||
),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
//loading animation
|
||||
|
||||
@@ -30,7 +30,7 @@ void showConfirmDialog({
|
||||
Get.back();
|
||||
onConfirm();
|
||||
},
|
||||
child: Text('确认'),
|
||||
child: const Text('确认'),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -89,10 +89,10 @@ void showPgcFollowDialog({
|
||||
ListTile(
|
||||
dense: true,
|
||||
title: Padding(
|
||||
padding: EdgeInsets.only(left: 10),
|
||||
padding: const EdgeInsets.only(left: 10),
|
||||
child: Text(
|
||||
'取消$type',
|
||||
style: TextStyle(fontSize: 14),
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
|
||||
@@ -7,7 +7,8 @@ import 'package:get/get.dart';
|
||||
void autoWrapReportDialog(
|
||||
BuildContext context,
|
||||
Map<String, Map<int, String>> options,
|
||||
Future<Map> Function(int, String?, bool) onSuccess,
|
||||
Future<Map> Function(int reasonType, String? reasonDesc, bool banUid)
|
||||
onSuccess,
|
||||
) {
|
||||
int? reasonType;
|
||||
String? reasonDesc;
|
||||
@@ -211,7 +212,7 @@ class _CheckBoxTextState extends State<CheckBoxText> {
|
||||
|
||||
class ReportOptions {
|
||||
// from https://s1.hdslb.com/bfs/seed/jinkela/comment-h5/static/js/605.chunks.js
|
||||
static Map<String, Map<int, String>> get commentReport => {
|
||||
static Map<String, Map<int, String>> get commentReport => const {
|
||||
'违反法律法规': {9: '违法违规', 2: '色情', 10: '低俗', 12: '赌博诈骗', 23: '违法信息外链'},
|
||||
'谣言类不实信息': {19: '涉政谣言', 22: '虚假不实信息', 20: '涉社会事件谣言'},
|
||||
'侵犯个人权益': {7: '人身攻击', 15: '侵犯隐私'},
|
||||
@@ -227,7 +228,7 @@ class ReportOptions {
|
||||
'其他': {0: '其他'},
|
||||
};
|
||||
|
||||
static Map<String, Map<int, String>> get dynamicReport => {
|
||||
static Map<String, Map<int, String>> get dynamicReport => const {
|
||||
'': {
|
||||
4: '垃圾广告',
|
||||
8: '引战',
|
||||
|
||||
@@ -71,9 +71,9 @@ class RenderMaskedIcon extends RenderProxyBox {
|
||||
..lineTo(rect.right, rect.bottom - sqrt2Width)
|
||||
..lineTo(rect.left + sqrt2Width, rect.top));
|
||||
|
||||
canvas.save();
|
||||
|
||||
canvas.clipPath(path, doAntiAlias: false);
|
||||
canvas
|
||||
..save()
|
||||
..clipPath(path, doAntiAlias: false);
|
||||
super.paint(context, offset);
|
||||
|
||||
context.canvas.restore();
|
||||
|
||||
@@ -132,7 +132,7 @@ class _DynamicSliverAppBarState extends State<DynamicSliverAppBar> {
|
||||
return SliverToBoxAdapter(
|
||||
child: SizedBox(
|
||||
key: _childKey,
|
||||
child: widget.flexibleSpace ?? SizedBox(height: kToolbarHeight),
|
||||
child: widget.flexibleSpace ?? const SizedBox(height: kToolbarHeight),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void imageSaveDialog({
|
||||
margin: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||
decoration: BoxDecoration(
|
||||
color: theme.colorScheme.surface,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
borderRadius: StyleString.mdRadius,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
||||
@@ -61,32 +61,22 @@ Widget imageView(
|
||||
}
|
||||
final int row = picArr.length == 4 ? 2 : 3;
|
||||
return BorderRadius.only(
|
||||
topLeft: Radius.circular(
|
||||
(index - row >= 0 ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row))
|
||||
? 0
|
||||
: 10,
|
||||
),
|
||||
topRight: Radius.circular(
|
||||
(index - row >= 0 ||
|
||||
((index + 1) < picArr.length &&
|
||||
(index + 1) % row > index % row))
|
||||
? 0
|
||||
: 10,
|
||||
),
|
||||
bottomLeft: Radius.circular(
|
||||
(index + row < picArr.length ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row))
|
||||
? 0
|
||||
: 10,
|
||||
),
|
||||
bottomRight: Radius.circular(
|
||||
(index + row < picArr.length ||
|
||||
((index + 1) < picArr.length &&
|
||||
(index + 1) % row > index % row))
|
||||
? 0
|
||||
: 10,
|
||||
),
|
||||
topLeft: index - row >= 0 ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row)
|
||||
? Radius.zero
|
||||
: StyleString.imgRadius,
|
||||
topRight: index - row >= 0 ||
|
||||
((index + 1) < picArr.length && (index + 1) % row > index % row)
|
||||
? Radius.zero
|
||||
: StyleString.imgRadius,
|
||||
bottomLeft: index + row < picArr.length ||
|
||||
((index - 1) >= 0 && (index - 1) % row < index % row)
|
||||
? Radius.zero
|
||||
: StyleString.imgRadius,
|
||||
bottomRight: index + row < picArr.length ||
|
||||
((index + 1) < picArr.length && (index + 1) % row > index % row)
|
||||
? Radius.zero
|
||||
: StyleString.imgRadius,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
: radius == 0 || type == 'emote'
|
||||
? _buildImage(context)
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(
|
||||
radius ?? StyleString.imgRadius.x,
|
||||
),
|
||||
borderRadius: radius != null
|
||||
? BorderRadius.circular(radius!)
|
||||
: StyleString.mdRadius,
|
||||
child: _buildImage(context),
|
||||
)
|
||||
: getPlaceHolder?.call() ?? placeholder(context);
|
||||
@@ -90,9 +90,9 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
color: Theme.of(context).colorScheme.onInverseSurface.withOpacity(0.4),
|
||||
borderRadius: type == 'avatar' || type == 'emote' || radius == 0
|
||||
? null
|
||||
: BorderRadius.circular(
|
||||
radius ?? StyleString.imgRadius.x,
|
||||
),
|
||||
: radius != null
|
||||
? BorderRadius.circular(radius!)
|
||||
: StyleString.mdRadius,
|
||||
),
|
||||
child: type == 'bg'
|
||||
? const SizedBox.shrink()
|
||||
|
||||
@@ -486,7 +486,7 @@ class _ImageUtil {
|
||||
}
|
||||
},
|
||||
);
|
||||
imageStream = image.image.resolve(const ImageConfiguration());
|
||||
imageStream = image.image.resolve(ImageConfiguration.empty);
|
||||
imageStream.addListener(listener);
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
@@ -771,14 +771,16 @@ class _InteractiveViewerState extends State<InteractiveViewer>
|
||||
widget.onInteractionStart?.call(details);
|
||||
|
||||
if (_controller.isAnimating) {
|
||||
_controller.stop();
|
||||
_controller.reset();
|
||||
_controller
|
||||
..stop()
|
||||
..reset();
|
||||
_animation?.removeListener(_onAnimate);
|
||||
_animation = null;
|
||||
}
|
||||
if (_scaleController.isAnimating) {
|
||||
_scaleController.stop();
|
||||
_scaleController.reset();
|
||||
_scaleController
|
||||
..stop()
|
||||
..reset();
|
||||
_scaleAnimation?.removeListener(_onScaleAnimate);
|
||||
_scaleAnimation = null;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'interactive_viewer.dart' as custom;
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactive_viewer.dart'
|
||||
as custom;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// https://github.com/qq326646683/interactiveviewer_gallery
|
||||
|
||||
@@ -11,8 +11,9 @@ 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';
|
||||
import 'interactive_viewer_boundary.dart';
|
||||
import 'interactive_viewer.dart' as custom;
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactive_viewer_boundary.dart';
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactive_viewer.dart'
|
||||
as custom;
|
||||
|
||||
/// https://github.com/qq326646683/interactiveviewer_gallery
|
||||
|
||||
@@ -136,7 +137,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
}
|
||||
|
||||
SystemUiMode? mode;
|
||||
setStatusBar() async {
|
||||
Future<void> setStatusBar() async {
|
||||
if (Platform.isIOS || Platform.isAndroid) {
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
@@ -153,8 +154,9 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
widget.onClose?.call(true);
|
||||
_player?.dispose();
|
||||
_pageController?.dispose();
|
||||
_animationController.removeListener(listener);
|
||||
_animationController.dispose();
|
||||
_animationController
|
||||
..removeListener(listener)
|
||||
..dispose();
|
||||
if (widget.setStatusBar != false) {
|
||||
if (Platform.isIOS || Platform.isAndroid) {
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
@@ -403,7 +405,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
.toList(),
|
||||
);
|
||||
},
|
||||
child: const Text("保存全部图片"),
|
||||
child: const Text("保存全部"),
|
||||
),
|
||||
if (widget.sources[currentIndex.value].sourceType ==
|
||||
SourceType.livePhoto)
|
||||
@@ -470,7 +472,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
);
|
||||
}
|
||||
|
||||
onDoubleTap() {
|
||||
void onDoubleTap() {
|
||||
Matrix4 matrix = _transformationController!.value.clone();
|
||||
double currentScale = matrix.row0.x;
|
||||
|
||||
@@ -517,7 +519,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
.whenComplete(() => _onScaleChanged(targetScale));
|
||||
}
|
||||
|
||||
onLongPress() {
|
||||
void onLongPress() {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:PiliPlus/common/widgets/loading_widget/http_error.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
Widget get loadingWidget => Center(child: CircularProgressIndicator());
|
||||
Widget get loadingWidget => const Center(child: CircularProgressIndicator());
|
||||
|
||||
Widget errorWidget({errMsg, onReload}) => HttpError(
|
||||
isSliver: false,
|
||||
|
||||
@@ -320,43 +320,42 @@ class ProgressBar extends LeafRenderObjectWidget {
|
||||
@override
|
||||
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
|
||||
super.debugFillProperties(properties);
|
||||
properties.add(StringProperty('progress', progress.toString()));
|
||||
properties.add(StringProperty('total', total.toString()));
|
||||
properties.add(StringProperty('buffered', buffered.toString()));
|
||||
properties.add(ObjectFlagProperty<ValueChanged<Duration>>('onSeek', onSeek,
|
||||
ifNull: 'unimplemented'));
|
||||
properties.add(ObjectFlagProperty<ThumbDragStartCallback>(
|
||||
'onDragStart', onDragStart,
|
||||
ifNull: 'unimplemented'));
|
||||
properties.add(ObjectFlagProperty<ThumbDragUpdateCallback>(
|
||||
'onDragUpdate', onDragUpdate,
|
||||
ifNull: 'unimplemented'));
|
||||
properties.add(ObjectFlagProperty<VoidCallback>('onDragEnd', onDragEnd,
|
||||
ifNull: 'unimplemented'));
|
||||
properties.add(DoubleProperty('barHeight', barHeight));
|
||||
properties.add(ColorProperty('baseBarColor', baseBarColor));
|
||||
properties.add(ColorProperty('progressBarColor', progressBarColor));
|
||||
properties.add(ColorProperty('bufferedBarColor', bufferedBarColor));
|
||||
properties.add(StringProperty('barCapShape', barCapShape.toString()));
|
||||
properties.add(DoubleProperty('thumbRadius', thumbRadius));
|
||||
properties.add(ColorProperty('thumbColor', thumbColor));
|
||||
properties.add(ColorProperty('thumbGlowColor', thumbGlowColor));
|
||||
properties.add(DoubleProperty('thumbGlowRadius', thumbGlowRadius));
|
||||
properties.add(
|
||||
FlagProperty(
|
||||
'thumbCanPaintOutsideBar',
|
||||
value: thumbCanPaintOutsideBar,
|
||||
ifTrue: 'true',
|
||||
ifFalse: 'false',
|
||||
showName: true,
|
||||
),
|
||||
);
|
||||
properties
|
||||
.add(StringProperty('timeLabelLocation', timeLabelLocation.toString()));
|
||||
properties.add(StringProperty('timeLabelType', timeLabelType.toString()));
|
||||
properties
|
||||
.add(DiagnosticsProperty('timeLabelTextStyle', timeLabelTextStyle));
|
||||
properties.add(DoubleProperty('timeLabelPadding', timeLabelPadding));
|
||||
..add(StringProperty('progress', progress.toString()))
|
||||
..add(StringProperty('total', total.toString()))
|
||||
..add(StringProperty('buffered', buffered.toString()))
|
||||
..add(ObjectFlagProperty<ValueChanged<Duration>>('onSeek', onSeek,
|
||||
ifNull: 'unimplemented'))
|
||||
..add(ObjectFlagProperty<ThumbDragStartCallback>(
|
||||
'onDragStart', onDragStart,
|
||||
ifNull: 'unimplemented'))
|
||||
..add(ObjectFlagProperty<ThumbDragUpdateCallback>(
|
||||
'onDragUpdate', onDragUpdate,
|
||||
ifNull: 'unimplemented'))
|
||||
..add(ObjectFlagProperty<VoidCallback>('onDragEnd', onDragEnd,
|
||||
ifNull: 'unimplemented'))
|
||||
..add(DoubleProperty('barHeight', barHeight))
|
||||
..add(ColorProperty('baseBarColor', baseBarColor))
|
||||
..add(ColorProperty('progressBarColor', progressBarColor))
|
||||
..add(ColorProperty('bufferedBarColor', bufferedBarColor))
|
||||
..add(StringProperty('barCapShape', barCapShape.toString()))
|
||||
..add(DoubleProperty('thumbRadius', thumbRadius))
|
||||
..add(ColorProperty('thumbColor', thumbColor))
|
||||
..add(ColorProperty('thumbGlowColor', thumbGlowColor))
|
||||
..add(DoubleProperty('thumbGlowRadius', thumbGlowRadius))
|
||||
..add(
|
||||
FlagProperty(
|
||||
'thumbCanPaintOutsideBar',
|
||||
value: thumbCanPaintOutsideBar,
|
||||
ifTrue: 'true',
|
||||
ifFalse: 'false',
|
||||
showName: true,
|
||||
),
|
||||
)
|
||||
..add(StringProperty('timeLabelLocation', timeLabelLocation.toString()))
|
||||
..add(StringProperty('timeLabelType', timeLabelType.toString()))
|
||||
..add(DiagnosticsProperty('timeLabelTextStyle', timeLabelTextStyle))
|
||||
..add(DoubleProperty('timeLabelPadding', timeLabelPadding));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -619,11 +618,10 @@ class _RenderProgressBar extends RenderBox {
|
||||
|
||||
TextPainter _layoutText(String text) {
|
||||
TextPainter textPainter = TextPainter(
|
||||
text: TextSpan(text: text, style: _timeLabelTextStyle),
|
||||
textDirection: TextDirection.ltr,
|
||||
textScaleFactor: textScaleFactor,
|
||||
);
|
||||
textPainter.layout(minWidth: 0, maxWidth: double.infinity);
|
||||
text: TextSpan(text: text, style: _timeLabelTextStyle),
|
||||
textDirection: TextDirection.ltr,
|
||||
textScaler: TextScaler.linear(textScaleFactor))
|
||||
..layout(minWidth: 0, maxWidth: double.infinity);
|
||||
return textPainter;
|
||||
}
|
||||
|
||||
@@ -919,9 +917,9 @@ class _RenderProgressBar extends RenderBox {
|
||||
|
||||
@override
|
||||
void paint(PaintingContext context, Offset offset) {
|
||||
final canvas = context.canvas;
|
||||
canvas.save();
|
||||
canvas.translate(offset.dx, offset.dy);
|
||||
final canvas = context.canvas
|
||||
..save()
|
||||
..translate(offset.dx, offset.dy);
|
||||
|
||||
switch (_timeLabelLocation) {
|
||||
case TimeLabelLocation.above:
|
||||
@@ -1013,8 +1011,9 @@ class _RenderProgressBar extends RenderBox {
|
||||
}
|
||||
|
||||
void _drawProgressBar(Canvas canvas, Offset offset, Size localSize) {
|
||||
canvas.save();
|
||||
canvas.translate(offset.dx, offset.dy);
|
||||
canvas
|
||||
..save()
|
||||
..translate(offset.dx, offset.dy);
|
||||
_drawBaseBar(canvas, localSize);
|
||||
_drawBufferedBar(canvas, localSize);
|
||||
_drawCurrentProgressBar(canvas, localSize);
|
||||
@@ -1109,17 +1108,19 @@ class _RenderProgressBar extends RenderBox {
|
||||
super.describeSemanticsConfiguration(config);
|
||||
|
||||
// description
|
||||
config.textDirection = TextDirection.ltr;
|
||||
config.label = '进度条'; //'Progress bar';
|
||||
config.value = '${(_thumbValue * 100).round()}%';
|
||||
config
|
||||
..textDirection = TextDirection.ltr
|
||||
..label = '进度条' //'Progress bar';
|
||||
..value = '${(_thumbValue * 100).round()}%'
|
||||
|
||||
// increase action
|
||||
config.onIncrease = increaseAction;
|
||||
// increase action
|
||||
..onIncrease = increaseAction;
|
||||
final increased = _thumbValue + _semanticActionUnit;
|
||||
config.increasedValue = '${((increased).clamp(0.0, 1.0) * 100).round()}%';
|
||||
config
|
||||
..increasedValue = '${((increased).clamp(0.0, 1.0) * 100).round()}%'
|
||||
|
||||
// decrease action
|
||||
config.onDecrease = decreaseAction;
|
||||
// decrease action
|
||||
..onDecrease = decreaseAction;
|
||||
final decreased = _thumbValue - _semanticActionUnit;
|
||||
config.decreasedValue = '${((decreased).clamp(0.0, 1.0) * 100).round()}%';
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
||||
Widget videoProgressIndicator(double progress) => ClipRect(
|
||||
clipper: ProgressClipper(),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
borderRadius: const BorderRadius.only(
|
||||
bottomLeft: StyleString.imgRadius,
|
||||
bottomRight: StyleString.imgRadius,
|
||||
),
|
||||
|
||||
@@ -534,8 +534,7 @@ class RefreshIndicatorState extends State<RefreshIndicator>
|
||||
_mode = _RefreshIndicatorMode.refresh;
|
||||
});
|
||||
|
||||
final Future<void> refreshResult = widget.onRefresh();
|
||||
refreshResult.whenComplete(() {
|
||||
widget.onRefresh().whenComplete(() {
|
||||
if (mounted && _mode == _RefreshIndicatorMode.refresh) {
|
||||
completer.complete();
|
||||
_dismiss(_RefreshIndicatorMode.done);
|
||||
|
||||
@@ -32,7 +32,7 @@ class VideoCardHGrpc extends StatelessWidget {
|
||||
String type = 'video';
|
||||
final String heroTag = Utils.makeHeroTag(aid);
|
||||
return InkWell(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(12)),
|
||||
onLongPress: () => imageSaveDialog(
|
||||
title: videoItem.smallCoverV5.base.title,
|
||||
cover: videoItem.smallCoverV5.base.cover,
|
||||
|
||||
@@ -86,14 +86,14 @@ class VideoCardHMemberVideo extends StatelessWidget {
|
||||
height: maxHeight,
|
||||
),
|
||||
if (fromViewAid == videoItem.param)
|
||||
Positioned.fill(
|
||||
const Positioned.fill(
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: StyleString.mdRadius,
|
||||
color: Colors.black54,
|
||||
),
|
||||
child: Center(
|
||||
child: const Text(
|
||||
child: Text(
|
||||
'上次观看',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
|
||||
@@ -31,7 +31,7 @@ class VideoCardV extends StatelessWidget {
|
||||
return numericRegex.hasMatch(str);
|
||||
}
|
||||
|
||||
void onPushDetail(heroTag) async {
|
||||
Future<void> onPushDetail(heroTag) async {
|
||||
String? goto = videoItem.goto;
|
||||
switch (goto) {
|
||||
case 'bangumi':
|
||||
|
||||
@@ -19,7 +19,7 @@ class VideoCardVMemberHome extends StatelessWidget {
|
||||
required this.videoItem,
|
||||
});
|
||||
|
||||
void onPushDetail(heroTag) async {
|
||||
Future<void> onPushDetail(heroTag) async {
|
||||
String? goto = videoItem.goto;
|
||||
switch (goto) {
|
||||
case 'bangumi':
|
||||
|
||||
@@ -116,7 +116,7 @@ class VideoCustomActions {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if (tp.dislikeReasons != null) ...[
|
||||
Text('我不想看'),
|
||||
const Text('我不想看'),
|
||||
const SizedBox(height: 5),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
@@ -128,7 +128,7 @@ class VideoCustomActions {
|
||||
],
|
||||
if (tp.feedbacks != null) ...[
|
||||
const SizedBox(height: 5),
|
||||
Text('反馈'),
|
||||
const Text('反馈'),
|
||||
const SizedBox(height: 5),
|
||||
Wrap(
|
||||
spacing: 8.0,
|
||||
@@ -153,10 +153,7 @@ class VideoCustomActions {
|
||||
Get.back();
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -2,
|
||||
vertical: -2,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
child: const Text("撤销"),
|
||||
),
|
||||
@@ -197,10 +194,7 @@ class VideoCustomActions {
|
||||
}
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -2,
|
||||
vertical: -2,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
child: const Text("点踩"),
|
||||
),
|
||||
@@ -216,10 +210,7 @@ class VideoCustomActions {
|
||||
res['status'] ? "取消踩" : res['msg']);
|
||||
},
|
||||
style: FilledButton.styleFrom(
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -2,
|
||||
vertical: -2,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
),
|
||||
child: const Text("撤销"),
|
||||
),
|
||||
@@ -288,7 +279,7 @@ class VideoCustomActions {
|
||||
class VideoPopupMenu extends StatelessWidget {
|
||||
final double? size;
|
||||
final double? iconSize;
|
||||
final double menuItemHeight = 45;
|
||||
final double menuItemHeight;
|
||||
final dynamic videoItem;
|
||||
final VoidCallback? onRemove;
|
||||
|
||||
@@ -298,6 +289,7 @@ class VideoPopupMenu extends StatelessWidget {
|
||||
required this.iconSize,
|
||||
required this.videoItem,
|
||||
this.onRemove,
|
||||
this.menuItemHeight = 45,
|
||||
});
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user