mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -6,15 +6,16 @@ import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:media_kit/media_kit.dart';
|
||||
import 'package:media_kit_video/media_kit_video.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:status_bar_control/status_bar_control.dart';
|
||||
import 'interactive_viewer_boundary.dart';
|
||||
import 'interactive_viewer.dart' as custom;
|
||||
|
||||
@@ -142,17 +143,21 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
_transformationController!.value = _animation?.value ?? Matrix4.identity();
|
||||
}
|
||||
|
||||
SystemUiMode? mode;
|
||||
setStatusBar() async {
|
||||
if (Platform.isIOS || Platform.isAndroid) {
|
||||
await StatusBarControl.setHidden(
|
||||
true,
|
||||
animation: StatusBarAnimation.FADE,
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
);
|
||||
}
|
||||
if (Platform.isAndroid &&
|
||||
(await DeviceInfoPlugin().androidInfo).version.sdkInt < 29) {
|
||||
mode = SystemUiMode.manual;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
void dispose() {
|
||||
widget.onClose?.call(true);
|
||||
_player?.dispose();
|
||||
_pageController?.dispose();
|
||||
@@ -160,7 +165,10 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
_animationController.dispose();
|
||||
if (widget.setStatusBar != false) {
|
||||
if (Platform.isIOS || Platform.isAndroid) {
|
||||
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||
SystemChrome.setEnabledSystemUIMode(
|
||||
mode ?? SystemUiMode.edgeToEdge,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
}
|
||||
}
|
||||
for (int index = 0; index < widget.sources.length; index++) {
|
||||
|
||||
@@ -41,7 +41,9 @@ class VideoCardH extends StatelessWidget {
|
||||
try {
|
||||
type = videoItem.type;
|
||||
} catch (_) {}
|
||||
return Stack(
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: Stack(
|
||||
children: [
|
||||
Semantics(
|
||||
label: Utils.videoItemSemantics(videoItem),
|
||||
@@ -169,6 +171,7 @@ class VideoCardH extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ abstract class CommonPublishPageState<T extends CommonPublishPage>
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
void dispose() {
|
||||
focusNode.dispose();
|
||||
editController.dispose();
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
|
||||
@@ -37,7 +37,6 @@ class _HomePageState extends State<HomePage>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(toolbarHeight: 0),
|
||||
body: Column(
|
||||
@@ -45,12 +44,12 @@ class _HomePageState extends State<HomePage>
|
||||
if (!_homeController.useSideBar &&
|
||||
context.orientation == Orientation.portrait)
|
||||
customAppBar,
|
||||
if (_homeController.tabs.length > 1) ...[
|
||||
const SizedBox(height: 4),
|
||||
if (_homeController.tabs.length > 1)
|
||||
Material(
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: SizedBox(
|
||||
child: Container(
|
||||
height: 42,
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: TabBar(
|
||||
controller: _homeController.tabController,
|
||||
tabs: [
|
||||
@@ -69,8 +68,8 @@ class _HomePageState extends State<HomePage>
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
] else
|
||||
)
|
||||
else
|
||||
const SizedBox(height: 6),
|
||||
Expanded(
|
||||
child: tabBarView(
|
||||
|
||||
@@ -157,11 +157,10 @@ class _MainAppState extends State<MainApp>
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() async {
|
||||
void dispose() {
|
||||
MainApp.routeObserver.unsubscribe(this);
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
// await GrpcClient.instance.shutdown();
|
||||
await GStorage.close();
|
||||
GStorage.close();
|
||||
EventBus().off(EventName.loginEvent);
|
||||
PiliScheme.listener?.cancel();
|
||||
super.dispose();
|
||||
|
||||
@@ -75,9 +75,9 @@ class _SearchResultPageState extends State<SearchResultPage>
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
const SizedBox(height: 4),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: Theme(
|
||||
data: ThemeData(
|
||||
|
||||
@@ -213,7 +213,6 @@ List<SettingsModel> get styleSettings => [
|
||||
leading: Icon(Icons.fit_screen_outlined),
|
||||
setKey: SettingBoxKey.videoPlayerRemoveSafeArea,
|
||||
defaultVal: false,
|
||||
needReboot: true,
|
||||
),
|
||||
SettingsModel(
|
||||
settingsType: SettingsType.sw1tch,
|
||||
|
||||
@@ -637,7 +637,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
toolbarHeight: 0,
|
||||
),
|
||||
if (videoDetailController.scrollRatio.value != 0 &&
|
||||
videoDetailController.scrollCtr.offset != 0)
|
||||
videoDetailController.scrollCtr.offset != 0 &&
|
||||
context.orientation == Orientation.portrait)
|
||||
AppBar(
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
@@ -846,7 +847,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
),
|
||||
);
|
||||
return videoDetailController.scrollRatio.value == 0 ||
|
||||
videoDetailController.scrollCtr.offset == 0
|
||||
videoDetailController.scrollCtr.offset == 0 ||
|
||||
context.orientation != Orientation.portrait
|
||||
? const SizedBox.shrink()
|
||||
: Positioned.fill(
|
||||
bottom: -2,
|
||||
@@ -1807,6 +1809,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
|
||||
Widget videoIntro([bool needRelated = true, bool needCtr = true]) {
|
||||
Widget introPanel() => Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
body: CustomScrollView(
|
||||
key: const PageStorageKey<String>('简介'),
|
||||
|
||||
@@ -1379,7 +1379,6 @@ class PlPlayerController {
|
||||
bool removeSafeArea = setting.get(SettingBoxKey.videoPlayerRemoveSafeArea,
|
||||
defaultValue: false);
|
||||
if (!isFullScreen.value && status) {
|
||||
// StatusBarControl.setHidden(true, animation: StatusBarAnimation.FADE);
|
||||
hideStatusBar();
|
||||
|
||||
/// 按照视频宽高比决定全屏方向
|
||||
@@ -1403,7 +1402,6 @@ class PlPlayerController {
|
||||
await landScape();
|
||||
}
|
||||
} else if (isFullScreen.value && !status) {
|
||||
// StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
|
||||
if (!removeSafeArea) showStatusBar();
|
||||
toggleFullScreen(false);
|
||||
if (mode == FullScreenMode.none) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:auto_orientation/auto_orientation.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:status_bar_control/status_bar_control.dart';
|
||||
|
||||
import '../../../utils/storage.dart';
|
||||
|
||||
@@ -75,7 +74,6 @@ Future<void> hideStatusBar() async {
|
||||
await SystemChrome.setEnabledSystemUIMode(
|
||||
SystemUiMode.immersiveSticky,
|
||||
);
|
||||
StatusBarControl.setHidden(true);
|
||||
}
|
||||
|
||||
//退出全屏显示
|
||||
@@ -94,7 +92,6 @@ Future<void> showStatusBar() async {
|
||||
mode,
|
||||
overlays: SystemUiOverlay.values,
|
||||
);
|
||||
StatusBarControl.setHidden(false);
|
||||
} else if (Platform.isMacOS || Platform.isWindows || Platform.isLinux) {
|
||||
await const MethodChannel('com.alexmercerind/media_kit_video')
|
||||
.invokeMethod(
|
||||
|
||||
@@ -1741,14 +1741,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.1"
|
||||
status_bar_control:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: status_bar_control
|
||||
sha256: "7f2c1f3f7fd13b85ed284eb7ca3f74ceb8dcfdd25636d3a84186d0a687d36693"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.1"
|
||||
stream_channel:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -139,7 +139,7 @@ dependencies:
|
||||
url: https://github.com/bggRGjQaUbCoE/canvas_danmaku.git
|
||||
ref: main
|
||||
# 状态栏图标控制
|
||||
status_bar_control: ^3.2.1
|
||||
# status_bar_control: ^3.2.1
|
||||
# 代理
|
||||
system_proxy: ^0.1.0
|
||||
# pip
|
||||
|
||||
Reference in New Issue
Block a user