diff --git a/lib/main.dart b/lib/main.dart index 0bb42d79..5c5b511e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -25,9 +25,6 @@ void main() async { .then((_) async { await GStrorage.init(); runApp(const MyApp()); - await Request.setCookie(); - await Data.init(); - await GStrorage.lazyInit(); // 小白条、导航栏沉浸 SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( @@ -35,6 +32,9 @@ void main() async { systemNavigationBarDividerColor: Colors.transparent, statusBarColor: Colors.transparent, )); + await Request.setCookie(); + Data.init(); + GStrorage.lazyInit(); }); } diff --git a/lib/pages/video/detail/view.dart b/lib/pages/video/detail/view.dart index d45bcfb9..2bf53cf0 100644 --- a/lib/pages/video/detail/view.dart +++ b/lib/pages/video/detail/view.dart @@ -149,7 +149,7 @@ class _VideoDetailPageState extends State key: videoDetailController.scaffoldKey, // fix 1px black line // backgroundColor: Colors.transparent, - backgroundColor: Theme.of(context).colorScheme.background, + backgroundColor: Colors.black, body: ExtendedNestedScrollView( controller: _extendNestCtr, headerSliverBuilder: @@ -162,11 +162,7 @@ class _VideoDetailPageState extends State scrolledUnderElevation: 0, forceElevated: innerBoxIsScrolled, expandedHeight: videoHeight, - backgroundColor: - MediaQuery.of(Get.context!).platformBrightness == - Brightness.dark - ? Colors.black - : Theme.of(context).colorScheme.background, + backgroundColor: Colors.black, flexibleSpace: FlexibleSpaceBar( background: Padding( padding: EdgeInsets.only(top: statusBarHeight), diff --git a/lib/plugin/pl_player/utils/fullscreen.dart b/lib/plugin/pl_player/utils/fullscreen.dart index 46540bbd..6d36c409 100644 --- a/lib/plugin/pl_player/utils/fullscreen.dart +++ b/lib/plugin/pl_player/utils/fullscreen.dart @@ -1,5 +1,6 @@ import 'dart:io'; +import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; @@ -48,12 +49,17 @@ Future enterFullScreen() async { //退出全屏显示 Future exitFullScreen() async { dynamic document; + late SystemUiMode mode = SystemUiMode.edgeToEdge; try { if (kIsWeb) { document.exitFullscreen(); } else if (Platform.isAndroid || Platform.isIOS) { + if (Platform.isAndroid && + (await DeviceInfoPlugin().androidInfo).version.sdkInt < 29) { + mode = SystemUiMode.manual; + } await SystemChrome.setEnabledSystemUIMode( - SystemUiMode.manual, + mode, overlays: SystemUiOverlay.values, ); await SystemChrome.setPreferredOrientations([]);