重构全屏逻辑,修复全屏弹幕与横屏错位问题
不再使用showDialog覆盖并传递对象的方式实现全屏,改用原控件调整高度(用Obx包裹SliverAppBar)、safeArea切换上下边距、构建detail页时根据屏幕方向切换状态栏可见性的方式实现全屏。 以上方式既能兼容屏幕旋转,也能绕过弹幕不加载的问题,还可以保留播放器上的弹幕避免旋屏时清空。 另外添加了两处针对全屏或旋屏状态的返回处理。
This commit is contained in:
@ -95,9 +95,9 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
// 根据position判断是否有已缓存弹幕。没有则请求对应段
|
||||
int segIndex = (currentPosition / (6 * 60 * 1000)).ceil();
|
||||
segIndex = segIndex < 1 ? 1 : segIndex;
|
||||
print('🌹🌹: ${segIndex}');
|
||||
print('🌹🌹: ${ctr.dmSegList.length}');
|
||||
print('🌹🌹: ${ctr.hasrequestSeg.contains(segIndex - 1)}');
|
||||
// print('🌹🌹: ${segIndex}');
|
||||
// print('🌹🌹: ${ctr.dmSegList.length}');
|
||||
// print('🌹🌹: ${ctr.hasrequestSeg.contains(segIndex - 1)}');
|
||||
if (segIndex - 1 >= ctr.dmSegList.length ||
|
||||
(ctr.dmSegList[segIndex - 1].elems.isEmpty &&
|
||||
!ctr.hasrequestSeg.contains(segIndex - 1))) {
|
||||
|
Reference in New Issue
Block a user