diff --git a/lib/pages/after_loading/afterloading_page.dart b/lib/pages/after_loading/afterloading_page.dart index 370ce8e74..69c72f3f4 100644 --- a/lib/pages/after_loading/afterloading_page.dart +++ b/lib/pages/after_loading/afterloading_page.dart @@ -6,6 +6,7 @@ import 'dart:io'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:fluttertoast/fluttertoast.dart'; import 'package:material_design_icons_flutter/material_design_icons_flutter.dart'; import 'package:uni_links/uni_links.dart'; @@ -342,26 +343,31 @@ class AfterLoadingPageState extends State ? _buildBottomNavigationBar(context) : null, drawer: _usesDrawer ? _buildDrawer(context) : null, - body: Stack( - children: [ - if (kReleaseMode) const ScriptWebView(), - PageView( - controller: _pageController, - physics: - _usesDrawer ? const NeverScrollableScrollPhysics() : null, - onPageChanged: (newPage) { - setState(() {}); - }, - children: [ - if (!Settings.liteMode) MainPage(key: _widgetKeys[0]), - SearchPage(key: _widgetKeys[1]), - if (Settings.liteMode) HotPage(key: _widgetKeys[2]), - BookmarkPage(key: _widgetKeys[3]), - DownloadPage(key: _widgetKeys[4]), - SettingsPage(key: _widgetKeys[5]), - ], - ), - ], + body: AnnotatedRegion( + value: Settings.themeWhat + ? SystemUiOverlayStyle.dark + : SystemUiOverlayStyle.light, + child: Stack( + children: [ + if (kReleaseMode) const ScriptWebView(), + PageView( + controller: _pageController, + physics: + _usesDrawer ? const NeverScrollableScrollPhysics() : null, + onPageChanged: (newPage) { + setState(() {}); + }, + children: [ + if (!Settings.liteMode) MainPage(key: _widgetKeys[0]), + SearchPage(key: _widgetKeys[1]), + if (Settings.liteMode) HotPage(key: _widgetKeys[2]), + BookmarkPage(key: _widgetKeys[3]), + DownloadPage(key: _widgetKeys[4]), + SettingsPage(key: _widgetKeys[5]), + ], + ), + ], + ), ), ), ); diff --git a/lib/pages/settings/settings_page.dart b/lib/pages/settings/settings_page.dart index 4c2f0866f..346387703 100644 --- a/lib/pages/settings/settings_page.dart +++ b/lib/pages/settings/settings_page.dart @@ -811,30 +811,30 @@ class _SettingsPageState extends State }, ), if (!Settings.liteMode) _buildDivider(), - // if (!Settings.liteMode) - InkWell( - child: ListTile( - leading: Icon(Mdi.compassOutline, color: Settings.majorColor), - title: const Text('Pure Search'), - trailing: Switch( - value: Settings.searchPure, - onChanged: (newValue) async { - await Settings.setSearchPure(newValue); - setState(() { - _shouldReload = true; - }); - }, - activeTrackColor: Settings.majorColor, - activeColor: Settings.majorAccentColor, + if (!Settings.liteMode) + InkWell( + child: ListTile( + leading: Icon(Mdi.compassOutline, color: Settings.majorColor), + title: const Text('Pure Search'), + trailing: Switch( + value: Settings.searchPure, + onChanged: (newValue) async { + await Settings.setSearchPure(newValue); + setState(() { + _shouldReload = true; + }); + }, + activeTrackColor: Settings.majorColor, + activeColor: Settings.majorAccentColor, + ), ), + onTap: () async { + await Settings.setSearchPure(!Settings.searchPure); + setState(() { + _shouldReload = true; + }); + }, ), - onTap: () async { - await Settings.setSearchPure(!Settings.searchPure); - setState(() { - _shouldReload = true; - }); - }, - ), _buildDivider(), InkWell( customBorder: const RoundedRectangleBorder( diff --git a/lib/pages/viewer/viewer_controller.dart b/lib/pages/viewer/viewer_controller.dart index a6231c92d..c10360235 100644 --- a/lib/pages/viewer/viewer_controller.dart +++ b/lib/pages/viewer/viewer_controller.dart @@ -1,8 +1,6 @@ // This source code is a part of Project Violet. // Copyright (C) 2020-2023. violet-team. Licensed under the Apache-2.0 License. -import 'dart:io'; - import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -40,7 +38,7 @@ class ViewerController extends GetxController { var animation = Settings.animation.obs; var rightToLeft = Settings.rightToLeft.obs; var imgQuality = Settings.imageQuality.obs; - var fullscreen = (!Settings.disableFullScreen || Platform.isIOS).obs; + var fullscreen = (!Settings.disableFullScreen).obs; /// horizontal viewer option var viewScrollType = @@ -216,14 +214,14 @@ class ViewerController extends GetxController { if (!overlay.value) { overlay.value = !overlay.value; opacity.value = 1.0; - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [ SystemUiOverlay.top, SystemUiOverlay.bottom, ]); } } else { - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); } opacity.value = 0.0; diff --git a/lib/pages/viewer/viewer_page.dart b/lib/pages/viewer/viewer_page.dart index 71a096b76..52de9f42d 100644 --- a/lib/pages/viewer/viewer_page.dart +++ b/lib/pages/viewer/viewer_page.dart @@ -131,7 +131,7 @@ class _ViewerPageState extends State { _initProvider = CallOnce(_initAfterProvider); _startsTime = DateTime.now(); - if (!Settings.disableFullScreen || Platform.isIOS) { + if (!Settings.disableFullScreen) { SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: []); }