fix stale fullscreen button icon and system UI mode not reacting to settings

Wrap fullScreenButton in Observer so icon/tooltip update immediately
when toggling fullscreen. Move system UI immersive mode sync into the
videoChat Observer so it reacts to landscapeForceVerticalChat changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tommy Chow 2026-03-07 23:46:41 -08:00
parent 820e563516
commit f07fe621bc
2 changed files with 21 additions and 19 deletions

View file

@ -293,11 +293,6 @@ class _VideoChatState extends State<VideoChat>
Widget build(BuildContext context) {
final settingsStore = _chatTabsStore.settingsStore;
_scheduleSystemUiModeSync(
immersive:
context.isLandscape && !settingsStore.landscapeForceVerticalChat,
);
final player = GestureDetector(
onLongPress: _videoStore.handleToggleOverlay,
child: Video(key: _videoKey, videoStore: _videoStore),
@ -400,6 +395,11 @@ class _VideoChatState extends State<VideoChat>
final videoChat = Observer(
builder: (context) {
_scheduleSystemUiModeSync(
immersive:
context.isLandscape && !settingsStore.landscapeForceVerticalChat,
);
// Build a blurred AppBar when in chat-only mode (no video)
PreferredSizeWidget? chatOnlyBlurredAppBar;
if (!settingsStore.showVideo) {

View file

@ -139,21 +139,23 @@ class VideoOverlay extends StatelessWidget {
),
);
final fullScreenButton = Tooltip(
message: videoStore.settingsStore.fullScreen
? 'Exit fullscreen mode'
: 'Enter fullscreen mode',
preferBelow: false,
child: IconButton(
icon: Icon(
videoStore.settingsStore.fullScreen
? Icons.fullscreen_exit_rounded
: Icons.fullscreen_rounded,
color: surfaceColor,
shadows: kOverlayShadow,
final fullScreenButton = Observer(
builder: (_) => Tooltip(
message: videoStore.settingsStore.fullScreen
? 'Exit fullscreen mode'
: 'Enter fullscreen mode',
preferBelow: false,
child: IconButton(
icon: Icon(
videoStore.settingsStore.fullScreen
? Icons.fullscreen_exit_rounded
: Icons.fullscreen_rounded,
color: surfaceColor,
shadows: kOverlayShadow,
),
onPressed: () => videoStore.settingsStore.fullScreen =
!videoStore.settingsStore.fullScreen,
),
onPressed: () => videoStore.settingsStore.fullScreen =
!videoStore.settingsStore.fullScreen,
),
);