Skip to content

Commit

Permalink
MediaView restores system style (#475)
Browse files Browse the repository at this point in the history
Avoids the system area using the wrong colours after MediaView closes.

Co-authored-by: @mykdavies <[email protected]>
  • Loading branch information
mykdavies and limbo-app-dev authored Aug 7, 2023
1 parent 8d7a447 commit 787d7f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/pages/media_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ class MediaViewPage extends HookWidget {
);
}

// Keep a record of the default style and reset it once we're done here.
final originalStyle = Theme.of(context).appBarTheme.systemOverlayStyle!;
useEffect(() {
return () => SystemChrome.setSystemUIOverlayStyle(originalStyle);
});

return Scaffold(
extendBodyBehindAppBar: true,
extendBody: true,
Expand Down

0 comments on commit 787d7f9

Please sign in to comment.