mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-16 06:03:54 +08:00
tweaks (#2100)
* mod: pgc episode title * opt: ColorScheme.of * mod: mpv api version * opt: log handler * opt: ext
This commit is contained in:
committed by
GitHub
parent
24769e144f
commit
b33fdf14af
@@ -16,7 +16,7 @@ class ToolbarIconButton extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
return SizedBox(
|
||||
width: 36,
|
||||
height: 36,
|
||||
@@ -24,14 +24,14 @@ class ToolbarIconButton extends StatelessWidget {
|
||||
tooltip: tooltip,
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
highlightColor: theme.colorScheme.secondaryContainer,
|
||||
highlightColor: colorScheme.secondaryContainer,
|
||||
color: selected
|
||||
? theme.colorScheme.onSecondaryContainer
|
||||
: theme.colorScheme.outline,
|
||||
? colorScheme.onSecondaryContainer
|
||||
: colorScheme.outline,
|
||||
style: ButtonStyle(
|
||||
padding: const WidgetStatePropertyAll(EdgeInsets.zero),
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
selected ? theme.colorScheme.secondaryContainer : null,
|
||||
selected ? colorScheme.secondaryContainer : null,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -69,12 +69,12 @@ Future<void> importFromClipBoard<T>(
|
||||
executeImport = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
final theme = Theme.of(context);
|
||||
final isDark = theme.brightness.isDark;
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
final isDark = colorScheme.isDark;
|
||||
if (isDark != isDarkMode) {
|
||||
isDarkMode = isDark;
|
||||
renderer = TextSpanRenderer(
|
||||
const TextStyle(),
|
||||
null,
|
||||
isDark ? githubDarkTheme : githubTheme,
|
||||
);
|
||||
result.render(renderer);
|
||||
@@ -87,12 +87,7 @@ Future<void> importFromClipBoard<T>(
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
child: Text('取消', style: TextStyle(color: colorScheme.outline)),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get.back(result: true),
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
|
||||
abstract final class DownloadHttp {
|
||||
static const String referer = "https://www.bilibili.com/";
|
||||
|
||||
@@ -18,7 +18,6 @@ import 'package:PiliPlus/utils/cache_manager.dart';
|
||||
import 'package:PiliPlus/utils/calc_window_position.dart';
|
||||
import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/device_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/theme_ext.dart';
|
||||
import 'package:PiliPlus/utils/json_file_handler.dart';
|
||||
import 'package:PiliPlus/utils/max_screen_size.dart';
|
||||
@@ -31,6 +30,7 @@ import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/theme_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:catcher_2/catcher_2.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
@@ -192,9 +192,13 @@ void main() async {
|
||||
if (Pref.enableLog) {
|
||||
// 异常捕获 logo记录
|
||||
final customParameters = {
|
||||
'BuildConfig':
|
||||
'\nBuild Time: ${DateFormatUtils.format(BuildConfig.buildTime, format: DateFormatUtils.longFormatDs)}\n'
|
||||
'Commit Hash: ${BuildConfig.commitHash}',
|
||||
'Build Time': DateFormatUtils.format(
|
||||
BuildConfig.buildTime,
|
||||
format: DateFormatUtils.longFormatDs,
|
||||
),
|
||||
'Commit Hash': BuildConfig.commitHash,
|
||||
'MPV Api Version':
|
||||
'${NativePlayer.apiVersion >> 16}.${NativePlayer.apiVersion & 0xFFFF}',
|
||||
};
|
||||
final fileHandler = await JsonFileHandler.init();
|
||||
final Catcher2Options debugConfig = Catcher2Options(
|
||||
|
||||
@@ -58,7 +58,7 @@ class BiliDownloadEntryInfo with MultiSelectData {
|
||||
return title;
|
||||
}
|
||||
|
||||
Widget moreBtn(ThemeData theme) => SizedBox(
|
||||
Widget moreBtn(ColorScheme colorScheme) => SizedBox(
|
||||
width: 29,
|
||||
height: 29,
|
||||
child: PopupMenuButton(
|
||||
@@ -66,7 +66,7 @@ class BiliDownloadEntryInfo with MultiSelectData {
|
||||
position: PopupMenuPosition.under,
|
||||
icon: Icon(
|
||||
Icons.more_vert_outlined,
|
||||
color: theme.colorScheme.outline,
|
||||
color: colorScheme.outline,
|
||||
size: 18,
|
||||
),
|
||||
itemBuilder: (_) => [
|
||||
|
||||
@@ -633,7 +633,7 @@ class OpusContent extends StatelessWidget {
|
||||
);
|
||||
case 7 when (element.code != null):
|
||||
final renderer = TextSpanRenderer(
|
||||
const TextStyle(),
|
||||
null,
|
||||
isDarkMode ? githubDarkTheme : githubTheme,
|
||||
);
|
||||
highlight
|
||||
|
||||
@@ -12,13 +12,13 @@ import 'package:PiliPlus/models_new/video/video_tag/data.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/ugc/widgets/triple_mixin.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -5,8 +5,8 @@ import 'package:PiliPlus/models_new/download/download_info.dart';
|
||||
import 'package:PiliPlus/pages/common/multi_select/base.dart'
|
||||
show BaseMultiSelectMixin;
|
||||
import 'package:PiliPlus/services/download/download_service.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/widgets.dart' show Text;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -11,9 +11,9 @@ import 'package:PiliPlus/pages/common/multi_select/base.dart'
|
||||
import 'package:PiliPlus/pages/download/controller.dart';
|
||||
import 'package:PiliPlus/pages/download/detail/widgets/item.dart';
|
||||
import 'package:PiliPlus/services/download/download_service.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart'
|
||||
hide SliverGridDelegateWithMaxCrossAxisExtent;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -346,7 +346,7 @@ class DetailItem extends StatelessWidget {
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: entry.moreBtn(theme),
|
||||
child: entry.moreBtn(theme.colorScheme),
|
||||
),
|
||||
] else
|
||||
Positioned(
|
||||
|
||||
@@ -17,10 +17,10 @@ import 'package:PiliPlus/pages/download/detail/widgets/item.dart';
|
||||
import 'package:PiliPlus/pages/download/search/view.dart';
|
||||
import 'package:PiliPlus/services/download/download_service.dart';
|
||||
import 'package:PiliPlus/utils/cache_manager.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart' show IterableExt;
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart'
|
||||
hide SliverGridDelegateWithMaxCrossAxisExtent, LayoutBuilder;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -385,7 +385,7 @@ class _DownloadPageState extends State<DownloadPage> {
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
pageInfo.entries.first.moreBtn(theme),
|
||||
pageInfo.entries.first.moreBtn(theme.colorScheme),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -13,11 +13,11 @@ import 'package:PiliPlus/models/dynamics/vote_model.dart';
|
||||
import 'package:PiliPlus/models_new/followee_votes/vote.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/num_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart' hide LayoutBuilder;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
|
||||
@@ -28,9 +28,9 @@ import 'package:PiliPlus/pages/emote/view.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/context_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/grid.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart' hide showTimePicker;
|
||||
import 'package:flutter/services.dart' show LengthLimitingTextInputFormatter;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -654,10 +654,10 @@ class _CreateDynPanelState extends CommonRichTextPubPageState<CreateDynPanel> {
|
||||
Widget get voteBtn => ToolbarIconButton(
|
||||
onPressed: () async {
|
||||
controller.keepChatPanel();
|
||||
RichTextItem? voteItem = editController.items.firstWhereOrNull(
|
||||
final voteItem = editController.items.firstWhereOrNull(
|
||||
(e) => e.type == RichTextType.vote,
|
||||
);
|
||||
final VoteInfo? voteInfo = await Navigator.of(context).push(
|
||||
final voteInfo = await Navigator.of(context).push<VoteInfo>(
|
||||
GetPageRoute(
|
||||
page: () => CreateVotePage(
|
||||
voteId: voteItem?.id == null ? null : int.parse(voteItem!.id!),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:PiliPlus/models_new/space/space_opus/data.dart';
|
||||
import 'package:PiliPlus/models_new/space/space_opus/item.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/pages/member/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class MemberOpusController
|
||||
|
||||
@@ -480,14 +480,14 @@ class _EditProfilePageState extends State<EditProfilePage> {
|
||||
imageQuality: 100,
|
||||
);
|
||||
if (pickedFile != null && mounted) {
|
||||
String? mimeType = lookupMimeType(
|
||||
pickedFile.path,
|
||||
)?.split('/').elementAtOrNull(1);
|
||||
String? imagePath = pickedFile.path;
|
||||
String? mimeType = (pickedFile.mimeType ?? lookupMimeType(imagePath))
|
||||
?.split('/')
|
||||
.elementAtOrNull(1);
|
||||
if (mimeType == 'gif') {
|
||||
SmartDialog.showToast('不能选GIF');
|
||||
return;
|
||||
}
|
||||
String? imagePath = pickedFile.path;
|
||||
if (PlatformUtils.isMobile) {
|
||||
final croppedFile = await ImageCropper.platform.cropImage(
|
||||
sourcePath: imagePath,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart' show PlatformException;
|
||||
|
||||
@@ -53,7 +53,7 @@ class _LogsPageState extends State<LogsPage> {
|
||||
logsContent = (await logsPath.readAsLines()).reversed.map((i) {
|
||||
try {
|
||||
final log = Report.fromJson(jsonDecode(i));
|
||||
latestLog ??= log.copyWith();
|
||||
latestLog ??= log;
|
||||
return log;
|
||||
} catch (e, s) {
|
||||
return Report(
|
||||
@@ -464,30 +464,7 @@ class Report extends catcher.Report {
|
||||
null,
|
||||
);
|
||||
|
||||
Report copyWith({
|
||||
dynamic error,
|
||||
dynamic stackTrace,
|
||||
DateTime? dateTime,
|
||||
Map<String, dynamic>? deviceParameters,
|
||||
Map<String, dynamic>? applicationParameters,
|
||||
Map<String, dynamic>? customParameters,
|
||||
FlutterErrorDetails? errorDetails,
|
||||
PlatformType? platformType,
|
||||
}) {
|
||||
return Report(
|
||||
error ?? this.error,
|
||||
stackTrace ?? this.stackTrace,
|
||||
dateTime ?? this.dateTime,
|
||||
deviceParameters ?? this.deviceParameters,
|
||||
applicationParameters ?? this.applicationParameters,
|
||||
customParameters ?? this.customParameters,
|
||||
errorDetails ?? this.errorDetails,
|
||||
platformType ?? this.platformType,
|
||||
null,
|
||||
);
|
||||
}
|
||||
|
||||
String _params2String(Map<String, dynamic> params) {
|
||||
static String _params2String(Map<String, dynamic> params) {
|
||||
return params.entries
|
||||
.map((entry) => '${entry.key}: ${entry.value}\n')
|
||||
.join();
|
||||
|
||||
@@ -66,6 +66,7 @@ import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/theme_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -185,7 +185,7 @@ class _LocalIntroPanelState extends State<LocalIntroPanel>
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomRight,
|
||||
child: entry.moreBtn(theme),
|
||||
child: entry.moreBtn(theme.colorScheme),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -20,7 +20,6 @@ import 'package:PiliPlus/pages/video/pay_coins/view.dart';
|
||||
import 'package:PiliPlus/pages/video/reply/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_repeat.dart';
|
||||
import 'package:PiliPlus/services/service_locator.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/id_utils.dart';
|
||||
@@ -28,6 +27,7 @@ import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/share_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
@@ -181,8 +181,14 @@ class PgcIntroController extends CommonIntroController {
|
||||
style: TextStyle(fontSize: 14),
|
||||
),
|
||||
onTap: () {
|
||||
final item = pgcItem.episodes?.firstWhereOrNull(
|
||||
(item) => item.epId == epId,
|
||||
);
|
||||
Get.back();
|
||||
ShareUtils.shareText(videoUrl);
|
||||
ShareUtils.shareText(
|
||||
'${pgcItem.title}${item != null ? ' ${item.showTitle}' : ''}'
|
||||
' - $videoUrl',
|
||||
);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
@@ -193,7 +199,7 @@ class PgcIntroController extends CommonIntroController {
|
||||
),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
EpisodeItem? item = pgcItem.episodes?.firstWhereOrNull(
|
||||
final item = pgcItem.episodes?.firstWhereOrNull(
|
||||
(item) => item.epId == epId,
|
||||
);
|
||||
showModalBottomSheet(
|
||||
|
||||
@@ -9,7 +9,6 @@ import 'package:PiliPlus/common/widgets/image_viewer/hero.dart';
|
||||
import 'package:PiliPlus/common/widgets/stat/stat.dart';
|
||||
import 'package:PiliPlus/models/common/image_preview_type.dart';
|
||||
import 'package:PiliPlus/models/common/image_type.dart';
|
||||
import 'package:PiliPlus/models/common/stat_type.dart';
|
||||
import 'package:PiliPlus/models_new/pgc/pgc_info_model/result.dart';
|
||||
import 'package:PiliPlus/pages/video/controller.dart';
|
||||
import 'package:PiliPlus/pages/video/introduction/pgc/controller.dart';
|
||||
@@ -60,7 +59,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
final item = introController.pgcItem;
|
||||
final isLandscape = widget.isLandscape;
|
||||
Widget sliver = SliverToBoxAdapter(
|
||||
@@ -71,13 +70,13 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 10,
|
||||
children: [
|
||||
_buildCover(theme, isLandscape, item),
|
||||
Expanded(child: _buildInfoPanel(isLandscape, theme, item)),
|
||||
_buildCover(colorScheme, isLandscape, item),
|
||||
Expanded(child: _buildInfoPanel(isLandscape, colorScheme, item)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
// 点赞收藏转发 布局样式2
|
||||
if (introController.isPgc) actionGrid(theme, item, introController),
|
||||
if (introController.isPgc) actionGrid(item, introController),
|
||||
// 番剧分集
|
||||
if (item.episodes?.isNotEmpty == true)
|
||||
PgcPanel(
|
||||
@@ -94,18 +93,16 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
if (!introController.isPgc) {
|
||||
final brief = _buildBrief(item);
|
||||
if (brief != null) {
|
||||
sliver = SliverMainAxisGroup(
|
||||
slivers: [
|
||||
sliver,
|
||||
brief,
|
||||
],
|
||||
);
|
||||
sliver = SliverMainAxisGroup(slivers: [sliver, brief]);
|
||||
}
|
||||
}
|
||||
return SliverPadding(
|
||||
padding:
|
||||
const EdgeInsets.all(Style.safeSpace) +
|
||||
const EdgeInsets.only(bottom: 50),
|
||||
padding: const .fromLTRB(
|
||||
Style.safeSpace,
|
||||
Style.safeSpace,
|
||||
Style.safeSpace,
|
||||
Style.safeSpace + 50,
|
||||
),
|
||||
sliver: sliver,
|
||||
);
|
||||
}
|
||||
@@ -118,11 +115,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
final imgWidth = maxWidth - padding;
|
||||
padding = padding / 2;
|
||||
return SliverPadding(
|
||||
padding: EdgeInsetsGeometry.only(
|
||||
top: 10,
|
||||
left: padding,
|
||||
right: padding,
|
||||
),
|
||||
padding: .only(top: 10, left: padding, right: padding),
|
||||
sliver: SliverMainAxisGroup(
|
||||
slivers: img.map((e) {
|
||||
return SliverToBoxAdapter(
|
||||
@@ -140,7 +133,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
return null;
|
||||
}
|
||||
|
||||
Widget _buildCover(ThemeData theme, bool isLandscape, PgcInfoModel item) {
|
||||
Widget _buildCover(
|
||||
ColorScheme colorScheme,
|
||||
bool isLandscape,
|
||||
PgcInfoModel item,
|
||||
) {
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
@@ -180,11 +177,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
? const Icon(Icons.star_rounded)
|
||||
: const Icon(Icons.star_border_rounded),
|
||||
bgColor: isFav
|
||||
? theme.colorScheme.secondaryContainer
|
||||
: theme.colorScheme.onInverseSurface,
|
||||
? colorScheme.secondaryContainer
|
||||
: colorScheme.onInverseSurface,
|
||||
iconColor: isFav
|
||||
? theme.colorScheme.onSecondaryContainer
|
||||
: theme.colorScheme.onSurfaceVariant,
|
||||
? colorScheme.onSecondaryContainer
|
||||
: colorScheme.onSurfaceVariant,
|
||||
);
|
||||
}),
|
||||
),
|
||||
@@ -192,7 +189,11 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoPanel(bool isLandscape, ThemeData theme, PgcInfoModel item) {
|
||||
Widget _buildInfoPanel(
|
||||
bool isLandscape,
|
||||
ColorScheme colorScheme,
|
||||
PgcInfoModel item,
|
||||
) {
|
||||
if (introController.isPgc) {
|
||||
Widget subBtn() => Obx(
|
||||
() {
|
||||
@@ -206,10 +207,8 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
vertical: 10,
|
||||
),
|
||||
visualDensity: VisualDensity.compact,
|
||||
foregroundColor: isFollowed ? theme.colorScheme.outline : null,
|
||||
backgroundColor: isFollowed
|
||||
? theme.colorScheme.onInverseSurface
|
||||
: null,
|
||||
foregroundColor: isFollowed ? colorScheme.outline : null,
|
||||
backgroundColor: isFollowed ? colorScheme.onInverseSurface : null,
|
||||
),
|
||||
onPressed: followStatus == -1
|
||||
? null
|
||||
@@ -259,10 +258,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
List<Widget> desc() => [
|
||||
Text(
|
||||
item.newEp!.desc!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
style: TextStyle(fontSize: 12, color: colorScheme.outline),
|
||||
),
|
||||
Text.rich(
|
||||
TextSpan(
|
||||
@@ -274,24 +270,15 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
style: TextStyle(fontSize: 12, color: colorScheme.outline),
|
||||
),
|
||||
];
|
||||
Widget stat() => Wrap(
|
||||
spacing: 6,
|
||||
runSpacing: 2,
|
||||
children: [
|
||||
StatWidget(
|
||||
type: StatType.play,
|
||||
value: item.stat!.view,
|
||||
),
|
||||
StatWidget(
|
||||
type: StatType.danmaku,
|
||||
value: item.stat!.danmaku,
|
||||
),
|
||||
StatWidget(type: .play, value: item.stat!.view),
|
||||
StatWidget(type: .danmaku, value: item.stat!.danmaku),
|
||||
if (isLandscape) ...desc(),
|
||||
],
|
||||
);
|
||||
@@ -314,10 +301,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
Expanded(
|
||||
child: Text(
|
||||
'简介:${item.evaluate}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
style: TextStyle(fontSize: 13, color: colorScheme.outline),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -351,7 +335,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
role,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.outline,
|
||||
color: colorScheme.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -391,7 +375,7 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
item.subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
color: colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -400,7 +384,6 @@ class _PgcIntroPageState extends State<PgcIntroPage> {
|
||||
}
|
||||
|
||||
Widget actionGrid(
|
||||
ThemeData theme,
|
||||
PgcInfoModel item,
|
||||
PgcIntroController introController,
|
||||
) {
|
||||
|
||||
@@ -41,7 +41,6 @@ import 'package:PiliPlus/services/shutdown_timer_service.dart'
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/connectivity_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
@@ -55,6 +54,7 @@ import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:PiliPlus/utils/video_utils.dart';
|
||||
import 'package:battery_plus/battery_plus.dart';
|
||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
|
||||
@@ -25,8 +25,8 @@ class ImSettingsItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
const titleStyle = TextStyle(fontSize: 14);
|
||||
final theme = Theme.of(context);
|
||||
final outline = theme.colorScheme.outline;
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
final outline = colorScheme.outline;
|
||||
final subtitleStyle = TextStyle(fontSize: 13, color: outline);
|
||||
|
||||
if (item.hasSwitch_1()) {
|
||||
@@ -156,11 +156,7 @@ class ImSettingsItem extends StatelessWidget {
|
||||
},
|
||||
title: Text(e.text, style: titleStyle),
|
||||
trailing: e.selected
|
||||
? Icon(
|
||||
size: 20,
|
||||
Icons.check,
|
||||
color: theme.colorScheme.primary,
|
||||
)
|
||||
? Icon(size: 20, Icons.check, color: colorScheme.primary)
|
||||
: null,
|
||||
);
|
||||
},
|
||||
|
||||
@@ -9,11 +9,11 @@ import 'package:PiliPlus/models_new/video/video_detail/data.dart';
|
||||
import 'package:PiliPlus/models_new/video/video_detail/page.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/controller.dart';
|
||||
import 'package:PiliPlus/plugin/pl_player/models/play_status.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/image_utils.dart';
|
||||
import 'package:PiliPlus/utils/path_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:audio_service/audio_service.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
Future<VideoPlayerServiceHandler> initAudioService() {
|
||||
|
||||
@@ -31,47 +31,8 @@ abstract final class Accounts {
|
||||
return deletedEntries > 2;
|
||||
},
|
||||
);
|
||||
// await _migrate();
|
||||
}
|
||||
|
||||
// static Future<void> _migrate() async {
|
||||
// final Directory tempDir = await getApplicationSupportDirectory();
|
||||
// final String tempPath = "${tempDir.path}/.plpl/";
|
||||
// final Directory dir = Directory(tempPath);
|
||||
// if (dir.existsSync()) {
|
||||
// if (kDebugMode) debugPrint('migrating...');
|
||||
// final cookieJar = PersistCookieJar(
|
||||
// ignoreExpires: true,
|
||||
// storage: FileStorage(tempPath),
|
||||
// );
|
||||
// await cookieJar.forceInit();
|
||||
// final cookies = DefaultCookieJar(ignoreExpires: true)
|
||||
// ..domainCookies.addAll(cookieJar.domainCookies);
|
||||
// final localAccessKey = GStorage.localCache.get(
|
||||
// 'accessKey',
|
||||
// defaultValue: {},
|
||||
// );
|
||||
|
||||
// final isLogin =
|
||||
// cookies.domainCookies['bilibili.com']?['/']?['SESSDATA'] != null;
|
||||
|
||||
// await Future.wait([
|
||||
// GStorage.localCache.delete('accessKey'),
|
||||
// GStorage.localCache.delete('danmakuFilterRule'),
|
||||
// GStorage.localCache.delete('blackMidsList'),
|
||||
// dir.delete(recursive: true),
|
||||
// if (isLogin)
|
||||
// LoginAccount(
|
||||
// cookies,
|
||||
// localAccessKey['value'],
|
||||
// localAccessKey['refresh'],
|
||||
// AccountType.values.toSet(),
|
||||
// ).onChange(),
|
||||
// ]);
|
||||
// if (kDebugMode) debugPrint('migrated successfully');
|
||||
// }
|
||||
// }
|
||||
|
||||
static Future<void> refresh() {
|
||||
for (final a in account.values) {
|
||||
for (final t in a.type) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/rendering.dart' show Offset, Size;
|
||||
import 'package:screen_retriever/screen_retriever.dart';
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import 'dart:io' show FileSystemEntity, Directory;
|
||||
|
||||
extension FileSystemEntityExt on FileSystemEntity {
|
||||
Future<void> tryDel({bool recursive = false}) async {
|
||||
try {
|
||||
await delete(recursive: recursive);
|
||||
} catch (_) {}
|
||||
}
|
||||
Future<void> tryDel({bool recursive = false}) =>
|
||||
delete(recursive: recursive).catchError((_) => this);
|
||||
}
|
||||
|
||||
extension DirectoryExt on Directory {
|
||||
|
||||
@@ -14,13 +14,6 @@ extension IterableExt<T> on Iterable<T> {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
T? firstWhereOrNull(bool Function(T element) test) {
|
||||
for (final element in this) {
|
||||
if (test(element)) return element;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
extension ListExt<T> on List<T> {
|
||||
@@ -69,6 +62,6 @@ extension ListExt<T> on List<T> {
|
||||
|
||||
T? getOrNull(int index) {
|
||||
if (index < 0 || index >= length) return null;
|
||||
return elementAt(index);
|
||||
return this[index];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import 'package:PiliPlus/pages/share/view.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
import 'package:PiliPlus/utils/extension/context_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/extension.dart';
|
||||
import 'package:PiliPlus/utils/extension/iterable_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/size_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/string_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
@@ -30,6 +29,7 @@ import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/url_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract final class Update {
|
||||
SmartDialog.show(
|
||||
animationType: SmartAnimationType.centerFade_otherSlide,
|
||||
builder: (context) {
|
||||
final ThemeData theme = Theme.of(context);
|
||||
final colorScheme = ColorScheme.of(context);
|
||||
Widget downloadBtn(String text, {String? ext}) => TextButton(
|
||||
onPressed: () => onDownload(data, ext: ext),
|
||||
child: Text(text),
|
||||
@@ -70,9 +70,7 @@ abstract final class Update {
|
||||
),
|
||||
child: Text(
|
||||
"点此查看完整更新(即commit)内容",
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
style: TextStyle(color: colorScheme.primary),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -88,18 +86,14 @@ abstract final class Update {
|
||||
},
|
||||
child: Text(
|
||||
'不再提醒',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
style: TextStyle(color: colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: SmartDialog.dismiss,
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: theme.colorScheme.outline,
|
||||
),
|
||||
style: TextStyle(color: colorScheme.outline),
|
||||
),
|
||||
),
|
||||
if (Platform.isWindows) ...[
|
||||
|
||||
Reference in New Issue
Block a user