mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 避开OrientationBuilder对未开启横屏适配的影响
This commit is contained in:
@@ -822,6 +822,15 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
if (!horizontalScreen) {
|
||||||
|
if (Platform.isAndroid) {
|
||||||
|
return PiPSwitcher(
|
||||||
|
childWhenEnabled: childWhenEnabled,
|
||||||
|
childWhenDisabled: childWhenDisabled,
|
||||||
|
floating: floating,);
|
||||||
|
}
|
||||||
|
return childWhenDisabled;
|
||||||
|
}
|
||||||
return OrientationBuilder(
|
return OrientationBuilder(
|
||||||
builder: (BuildContext context, Orientation orientation) {
|
builder: (BuildContext context, Orientation orientation) {
|
||||||
if (orientation == Orientation.landscape) {
|
if (orientation == Orientation.landscape) {
|
||||||
@@ -829,22 +838,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
}
|
}
|
||||||
if (Platform.isAndroid) {
|
if (Platform.isAndroid) {
|
||||||
return PiPSwitcher(
|
return PiPSwitcher(
|
||||||
childWhenDisabled: Container(
|
childWhenDisabled: orientation == Orientation.portrait
|
||||||
key: UniqueKey(),
|
|
||||||
child: !horizontalScreen || orientation == Orientation.portrait
|
|
||||||
? childWhenDisabled
|
? childWhenDisabled
|
||||||
: childWhenDisabledLandscape,
|
: childWhenDisabledLandscape,
|
||||||
),
|
|
||||||
childWhenEnabled: childWhenEnabled,
|
childWhenEnabled: childWhenEnabled,
|
||||||
floating: floating,
|
floating: floating,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return Container(
|
return orientation == Orientation.portrait
|
||||||
key: UniqueKey(),
|
|
||||||
child: !horizontalScreen || orientation == Orientation.portrait
|
|
||||||
? childWhenDisabled
|
? childWhenDisabled
|
||||||
: childWhenDisabledLandscape,
|
: childWhenDisabledLandscape;
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user