mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-08-03 01:00:14 +08:00
fix statusbar brightness
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -7,12 +7,14 @@ class SimpleAppBar extends StatelessWidget {
|
|||||||
super.key,
|
super.key,
|
||||||
required this.height,
|
required this.height,
|
||||||
required this.brightness,
|
required this.brightness,
|
||||||
Brightness? statusBarIconBrightness,
|
this.statusBarBrightness = .dark,
|
||||||
|
this.statusBarIconBrightness = .light,
|
||||||
this.backgroundColor = Colors.black,
|
this.backgroundColor = Colors.black,
|
||||||
}) : statusBarIconBrightness = statusBarIconBrightness ?? .light;
|
});
|
||||||
|
|
||||||
final double height;
|
final double height;
|
||||||
final Brightness brightness;
|
final Brightness brightness;
|
||||||
|
final Brightness statusBarBrightness;
|
||||||
final Brightness statusBarIconBrightness;
|
final Brightness statusBarIconBrightness;
|
||||||
final Color backgroundColor;
|
final Color backgroundColor;
|
||||||
|
|
||||||
@@ -20,9 +22,9 @@ class SimpleAppBar extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
value: SystemUiOverlayStyle(
|
value: SystemUiOverlayStyle(
|
||||||
statusBarBrightness: .light,
|
statusBarBrightness: statusBarBrightness,
|
||||||
statusBarColor: Colors.transparent,
|
|
||||||
statusBarIconBrightness: statusBarIconBrightness,
|
statusBarIconBrightness: statusBarIconBrightness,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
systemStatusBarContrastEnforced: false,
|
systemStatusBarContrastEnforced: false,
|
||||||
systemNavigationBarColor: Colors.transparent,
|
systemNavigationBarColor: Colors.transparent,
|
||||||
systemNavigationBarIconBrightness: brightness.reverse,
|
systemNavigationBarIconBrightness: brightness.reverse,
|
||||||
|
|||||||
@@ -494,12 +494,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
: Obx(
|
: Obx(
|
||||||
() {
|
() {
|
||||||
final scrollRatio = videoDetailController.scrollRatio.value;
|
final scrollRatio = videoDetailController.scrollRatio.value;
|
||||||
Brightness? statusBarIconBrightness;
|
final brightness = colorScheme.brightness;
|
||||||
if (Platform.isAndroid) {
|
final Brightness statusBarBrightness;
|
||||||
statusBarIconBrightness = isPortrait && scrollRatio >= 0.5
|
final Brightness statusBarIconBrightness;
|
||||||
? colorScheme.brightness.reverse
|
|
||||||
: .light;
|
|
||||||
}
|
|
||||||
final backgroundColor = isPortrait && scrollRatio > 0
|
final backgroundColor = isPortrait && scrollRatio > 0
|
||||||
? Color.lerp(
|
? Color.lerp(
|
||||||
Colors.black,
|
Colors.black,
|
||||||
@@ -507,10 +504,18 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
scrollRatio,
|
scrollRatio,
|
||||||
)!
|
)!
|
||||||
: Colors.black;
|
: Colors.black;
|
||||||
|
if (isPortrait && scrollRatio >= 0.5) {
|
||||||
|
statusBarBrightness = brightness;
|
||||||
|
statusBarIconBrightness = brightness.reverse;
|
||||||
|
} else {
|
||||||
|
statusBarBrightness = .dark;
|
||||||
|
statusBarIconBrightness = .light;
|
||||||
|
}
|
||||||
return SimpleAppBar(
|
return SimpleAppBar(
|
||||||
height: padding.top,
|
height: padding.top,
|
||||||
backgroundColor: backgroundColor,
|
backgroundColor: backgroundColor,
|
||||||
brightness: colorScheme.brightness,
|
brightness: brightness,
|
||||||
|
statusBarBrightness: statusBarBrightness,
|
||||||
statusBarIconBrightness: statusBarIconBrightness,
|
statusBarIconBrightness: statusBarIconBrightness,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user