Fix SystemUI not showing on Android in fullscreen

This commit is contained in:
Tommy Chow 2021-12-27 02:47:29 -05:00
parent f5dd85f5de
commit a2c97cc1e5
3 changed files with 21 additions and 21 deletions

View file

@ -48,7 +48,7 @@ abstract class _SettingsStoreBase with Store {
reaction(
(_) => fullScreen,
(bool newValue) => newValue == true
? SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive)
? SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky)
: SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: [SystemUiOverlay.bottom, SystemUiOverlay.top]));
}
}

View file

@ -35,7 +35,7 @@ class VideoOverlay extends StatelessWidget {
children: [
Row(
children: [
if (portrait)
if (!context.read<SettingsStore>().fullScreen)
IconButton(
icon: Icon(
Icons.adaptive.arrow_back,

View file

@ -65,15 +65,15 @@ class VideoChat extends StatelessWidget {
child: OrientationBuilder(
builder: (context, orientation) {
if (orientation == Orientation.landscape) {
if (context.read<SettingsStore>().fullScreen) SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
if (context.read<SettingsStore>().fullScreen) SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
return Observer(
builder: (context) {
if (context.read<SettingsStore>().videoEnabled) {
return WillPopScope(
onWillPop: () async => false,
child: Observer(
builder: (context) => context.read<SettingsStore>().fullScreen
? Stack(
return Observer(
builder: (context) => context.read<SettingsStore>().fullScreen
? WillPopScope(
onWillPop: () async => false,
child: Stack(
children: [
Visibility(
visible: false,
@ -82,20 +82,20 @@ class VideoChat extends StatelessWidget {
),
Center(child: video),
],
)
: Row(
children: [
Flexible(
flex: 2,
child: video,
),
Flexible(
flex: 1,
child: chat,
),
],
),
),
)
: Row(
children: [
Flexible(
flex: 2,
child: video,
),
Flexible(
flex: 1,
child: chat,
),
],
),
);
}
return Column(