Merge branch 'main' into fix-seasonChange
This commit is contained in:
@ -411,17 +411,29 @@ class TitleBar extends StatelessWidget {
|
||||
toolbarHeight: 45,
|
||||
automaticallyImplyLeading: false,
|
||||
centerTitle: false,
|
||||
title: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
elevation: 1,
|
||||
scrolledUnderElevation: 1,
|
||||
title: Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Text(
|
||||
title,
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
),
|
||||
),
|
||||
actions: !isFullScreen
|
||||
? [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
style: ButtonStyle(
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => Navigator.pop(context),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 14),
|
||||
const SizedBox(width: 8),
|
||||
]
|
||||
: null,
|
||||
);
|
||||
@ -482,7 +494,7 @@ class EpisodeListItem extends StatelessWidget {
|
||||
dense: false,
|
||||
leading: isCurrentIndex
|
||||
? Image.asset(
|
||||
'assets/images/live.gif',
|
||||
'assets/images/live.png',
|
||||
color: primary,
|
||||
height: 12,
|
||||
)
|
||||
|
||||
126
lib/common/skeleton/video_intro.dart
Normal file
126
lib/common/skeleton/video_intro.dart
Normal file
@ -0,0 +1,126 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../constants.dart';
|
||||
import 'skeleton.dart';
|
||||
|
||||
class VideoIntroSkeleton extends StatelessWidget {
|
||||
const VideoIntroSkeleton({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Color bgColor = Theme.of(context).colorScheme.onInverseSurface;
|
||||
return Skeleton(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: StyleString.safeSpace),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SizedBox(height: 18),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 20,
|
||||
margin: const EdgeInsets.only(bottom: 6),
|
||||
color: bgColor,
|
||||
),
|
||||
Container(
|
||||
width: 220,
|
||||
height: 20,
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
color: bgColor,
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 45,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 35,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
LayoutBuilder(builder: (context, constraints) {
|
||||
// 并列5个正方形
|
||||
double width = (constraints.maxWidth - 30) / 5;
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: List.generate(5, (index) {
|
||||
return Container(
|
||||
width: width - 24,
|
||||
height: width - 24,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
);
|
||||
}),
|
||||
);
|
||||
}),
|
||||
const SizedBox(height: 20),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 30,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 6),
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
children: [
|
||||
ClipOval(
|
||||
child: Container(
|
||||
width: 44,
|
||||
height: 44,
|
||||
color: bgColor,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Container(
|
||||
width: 50,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Container(
|
||||
width: 35,
|
||||
height: 14,
|
||||
color: bgColor,
|
||||
),
|
||||
const Spacer(),
|
||||
Container(
|
||||
width: 55,
|
||||
height: 30,
|
||||
decoration: BoxDecoration(
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 2)
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:pilipala/utils/storage.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class CustomToast extends StatelessWidget {
|
||||
const CustomToast({super.key, required this.msg});
|
||||
|
||||
25
lib/common/widgets/drag_handle.dart
Normal file
25
lib/common/widgets/drag_handle.dart
Normal file
@ -0,0 +1,25 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DragHandle extends StatelessWidget {
|
||||
const DragHandle({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: Navigator.of(context).pop,
|
||||
child: SizedBox(
|
||||
height: 36,
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 4,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,8 @@ import 'package:pilipala/plugin/pl_gallery/hero_dialog_route.dart';
|
||||
import 'package:pilipala/plugin/pl_gallery/interactiveviewer_gallery.dart';
|
||||
import 'package:pilipala/utils/highlight.dart';
|
||||
|
||||
import '../../utils/global_data_cache.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class HtmlRender extends StatelessWidget {
|
||||
const HtmlRender({
|
||||
@ -41,6 +43,8 @@ class HtmlRender extends StatelessWidget {
|
||||
TagExtension(
|
||||
tagsToExtend: <String>{'img'},
|
||||
builder: (ExtensionContext extensionContext) {
|
||||
int defaultImgQuality = 10;
|
||||
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||
try {
|
||||
final Map<String, dynamic> attributes =
|
||||
extensionContext.attributes;
|
||||
@ -99,13 +103,13 @@ class HtmlRender extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
},
|
||||
child: CachedNetworkImage(imageUrl: imgUrl),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: '$imgUrl@${defaultImgQuality}q.webp',
|
||||
),
|
||||
),
|
||||
);
|
||||
// return NetworkImgLayer(
|
||||
// width: isEmote ? 22 : Get.size.width - 24,
|
||||
// height: isEmote ? 22 : 200,
|
||||
// src: imgUrl,
|
||||
// );
|
||||
} catch (err) {
|
||||
return const SizedBox();
|
||||
}
|
||||
@ -138,6 +142,14 @@ class HtmlRender extends StatelessWidget {
|
||||
textAlign: TextAlign.justify,
|
||||
),
|
||||
'img': Style(margin: Margins.only(top: 4, bottom: 4)),
|
||||
'figcaption': Style(
|
||||
textAlign: TextAlign.center,
|
||||
margin: Margins.only(top: 8, bottom: 20),
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
),
|
||||
'figure': Style(
|
||||
margin: Margins.zero,
|
||||
),
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -6,7 +6,7 @@ import 'package:pilipala/utils/global_data_cache.dart';
|
||||
import '../../utils/storage.dart';
|
||||
import '../constants.dart';
|
||||
|
||||
Box<dynamic> setting = GStrorage.setting;
|
||||
Box<dynamic> setting = GStorage.setting;
|
||||
|
||||
class NetworkImgLayer extends StatelessWidget {
|
||||
const NetworkImgLayer({
|
||||
@ -48,7 +48,7 @@ class NetworkImgLayer extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
int defaultImgQuality = 10;
|
||||
try {
|
||||
defaultImgQuality = GlobalDataCache().imgQuality;
|
||||
defaultImgQuality = GlobalDataCache.imgQuality;
|
||||
} catch (_) {}
|
||||
|
||||
if (src == '' || src == null) {
|
||||
|
||||
@ -12,6 +12,7 @@ import '../../http/video.dart';
|
||||
import '../../utils/utils.dart';
|
||||
import '../constants.dart';
|
||||
import 'badge.dart';
|
||||
import 'drag_handle.dart';
|
||||
import 'network_img_layer.dart';
|
||||
import 'stat/danmu.dart';
|
||||
import 'stat/view.dart';
|
||||
@ -373,27 +374,12 @@ class MorePanel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
ListTile(
|
||||
onTap: () async => await menuActionHandler('block'),
|
||||
minLeadingWidth: 0,
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:pilipala/utils/feed_back.dart';
|
||||
import 'package:pilipala/utils/image_save.dart';
|
||||
import 'package:pilipala/utils/route_push.dart';
|
||||
import '../../models/model_rec_video_item.dart';
|
||||
import 'drag_handle.dart';
|
||||
import 'stat/danmu.dart';
|
||||
import 'stat/view.dart';
|
||||
import '../../http/dynamics.dart';
|
||||
@ -368,27 +369,12 @@ class MorePanel extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () => Get.back(),
|
||||
child: Container(
|
||||
height: 35,
|
||||
padding: const EdgeInsets.only(bottom: 2),
|
||||
child: Center(
|
||||
child: Container(
|
||||
width: 32,
|
||||
height: 3,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.outline,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(3))),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const DragHandle(),
|
||||
ListTile(
|
||||
onTap: () async => await menuActionHandler('block'),
|
||||
minLeadingWidth: 0,
|
||||
|
||||
Reference in New Issue
Block a user