mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: video appbar
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:PiliPlus/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPlus/common/widgets/tabs.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
@@ -186,9 +187,7 @@ class _MainAppState extends State<MainApp>
|
||||
value: SystemUiOverlayStyle(
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness:
|
||||
Theme.of(context).brightness == Brightness.light
|
||||
? Brightness.dark
|
||||
: Brightness.light, // 设置虚拟按键图标颜色
|
||||
Theme.of(context).brightness.reverse, // 设置虚拟按键图标颜色
|
||||
),
|
||||
child: Scaffold(
|
||||
resizeToAvoidBottomInset: false,
|
||||
|
||||
@@ -28,6 +28,7 @@ import 'package:easy_debounce/easy_throttle.dart';
|
||||
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
@@ -636,25 +637,42 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
: PreferredSize(
|
||||
preferredSize: Size.fromHeight(0),
|
||||
child: Obx(
|
||||
() => Stack(
|
||||
children: [
|
||||
AppBar(
|
||||
backgroundColor: Colors.black,
|
||||
toolbarHeight: 0,
|
||||
),
|
||||
if (videoDetailController.scrollRatio.value != 0 &&
|
||||
videoDetailController.scrollCtr.offset != 0 &&
|
||||
context.orientation == Orientation.portrait)
|
||||
() {
|
||||
bool shouldShow =
|
||||
videoDetailController.scrollRatio.value != 0 &&
|
||||
videoDetailController.scrollCtr.offset != 0 &&
|
||||
context.orientation == Orientation.portrait;
|
||||
return Stack(
|
||||
children: [
|
||||
AppBar(
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.surface
|
||||
.withOpacity(
|
||||
videoDetailController.scrollRatio.value),
|
||||
backgroundColor: Colors.black,
|
||||
toolbarHeight: 0,
|
||||
systemOverlayStyle: shouldShow
|
||||
? null
|
||||
: SystemUiOverlayStyle(
|
||||
statusBarIconBrightness: Brightness.light,
|
||||
systemNavigationBarIconBrightness:
|
||||
Theme.of(context).brightness.reverse,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
if (shouldShow)
|
||||
AppBar(
|
||||
backgroundColor: Theme.of(context)
|
||||
.colorScheme
|
||||
.surface
|
||||
.withOpacity(
|
||||
videoDetailController.scrollRatio.value),
|
||||
toolbarHeight: 0,
|
||||
systemOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarIconBrightness:
|
||||
Theme.of(context).brightness.reverse,
|
||||
systemNavigationBarIconBrightness:
|
||||
Theme.of(context).brightness.reverse,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
body: ExtendedNestedScrollView(
|
||||
|
||||
@@ -115,3 +115,8 @@ extension ColorExtension on Color {
|
||||
return Color.fromARGB(blendedAlpha, blendedRed, blendedGreen, blendedBlue);
|
||||
}
|
||||
}
|
||||
|
||||
extension BrightnessExt on Brightness {
|
||||
Brightness get reverse =>
|
||||
this == Brightness.light ? Brightness.dark : Brightness.light;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user