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/common/widgets/tabs.dart';
|
||||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||||
import 'package:PiliPlus/utils/app_scheme.dart';
|
import 'package:PiliPlus/utils/app_scheme.dart';
|
||||||
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
import 'package:PiliPlus/utils/utils.dart';
|
import 'package:PiliPlus/utils/utils.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
@@ -186,9 +187,7 @@ class _MainAppState extends State<MainApp>
|
|||||||
value: SystemUiOverlayStyle(
|
value: SystemUiOverlayStyle(
|
||||||
systemNavigationBarColor: Colors.transparent,
|
systemNavigationBarColor: Colors.transparent,
|
||||||
systemNavigationBarIconBrightness:
|
systemNavigationBarIconBrightness:
|
||||||
Theme.of(context).brightness == Brightness.light
|
Theme.of(context).brightness.reverse, // 设置虚拟按键图标颜色
|
||||||
? Brightness.dark
|
|
||||||
: Brightness.light, // 设置虚拟按键图标颜色
|
|
||||||
),
|
),
|
||||||
child: Scaffold(
|
child: Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
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:extended_nested_scroll_view/extended_nested_scroll_view.dart';
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/rendering.dart';
|
import 'package:flutter/rendering.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:flutter_svg/svg.dart';
|
import 'package:flutter_svg/svg.dart';
|
||||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
@@ -636,25 +637,42 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
: PreferredSize(
|
: PreferredSize(
|
||||||
preferredSize: Size.fromHeight(0),
|
preferredSize: Size.fromHeight(0),
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Stack(
|
() {
|
||||||
children: [
|
bool shouldShow =
|
||||||
AppBar(
|
videoDetailController.scrollRatio.value != 0 &&
|
||||||
backgroundColor: Colors.black,
|
videoDetailController.scrollCtr.offset != 0 &&
|
||||||
toolbarHeight: 0,
|
context.orientation == Orientation.portrait;
|
||||||
),
|
return Stack(
|
||||||
if (videoDetailController.scrollRatio.value != 0 &&
|
children: [
|
||||||
videoDetailController.scrollCtr.offset != 0 &&
|
|
||||||
context.orientation == Orientation.portrait)
|
|
||||||
AppBar(
|
AppBar(
|
||||||
backgroundColor: Theme.of(context)
|
backgroundColor: Colors.black,
|
||||||
.colorScheme
|
|
||||||
.surface
|
|
||||||
.withOpacity(
|
|
||||||
videoDetailController.scrollRatio.value),
|
|
||||||
toolbarHeight: 0,
|
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(
|
body: ExtendedNestedScrollView(
|
||||||
|
|||||||
@@ -115,3 +115,8 @@ extension ColorExtension on Color {
|
|||||||
return Color.fromARGB(blendedAlpha, blendedRed, blendedGreen, blendedBlue);
|
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