use `useEffect` instead of just plainly changing systemChrome

This commit is contained in:
krawieck 2020-09-10 15:16:45 +02:00
parent 704c7de2e6
commit 4ca8e96e97
1 changed files with 7 additions and 3 deletions

View File

@ -46,9 +46,13 @@ class CommunityPage extends HookWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( useEffect(() {
statusBarColor: Colors.white, SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.dark)); statusBarColor: Colors.white,
statusBarIconBrightness: Brightness.dark));
return SystemChrome.restoreSystemUIOverlays;
});
final theme = Theme.of(context); final theme = Theme.of(context);
var fullCommunitySnap = useFuture(_fullCommunityFuture); var fullCommunitySnap = useFuture(_fullCommunityFuture);