Lucas
ย ยทย https://lucasnocode.gumroad.com/

Status Bar icon brightness - Can't force app to keep white icons.

Resolved

Hi all,

I'm trying to force the app on my feed page to display white icons of my status bar.
I figured out that if I add nav bar with black background this will determine which colour of the icons will be. If background is light icons are dark, and when background is black icons are white (brightness .light).

So on this page i do not use safe areas or any navbars because I want to keep full hight of the image displayed on page. So image does not determine the colour of the navbar icons. They keep being dark and it looks shit.

I've tried everything I even add custom action which should in general force 9on page load) icon brightness in the system - but doesn't.

Here is the action:

// Automatic FlutterFlow imports
import '/backend/backend.dart';
import '/backend/schema/structs/index.dart';
import '/flutter_flow/flutter_flow_theme.dart';
import '/flutter_flow/flutter_flow_util.dart';
import '/custom_code/actions/index.dart'; // Imports other custom actions
import '/flutter_flow/custom_functions.dart'; // Imports custom functions
import 'package:flutter/material.dart';
// Begin custom action code
// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

import 'package:flutter/services.dart';

Future<void> setWhiteStatusBarIcons() async {
  await setStatusBarIconBrightness();
}

Future<void> setStatusBarIconBrightness() async {
  SystemChrome.setSystemUIOverlayStyle(
    SystemUiOverlayStyle(
      statusBarBrightness: Brightness.dark,
      statusBarIconBrightness: Brightness.light,
    ),
  );
}

// End custom action code
// DO NOT REMOVE OR MODIFY THE CODE BELOW!


Did anyone here has similar problem and was there any solution?
Ive added this action on page load and in main.dart too... no luck.

I appreciate your help

1
22 replies