title: How to change status bar icon and text color in flutter based on theme been set?
body: <p>How to update color for status bar icon without any third party plugin ?</p>
  
  <p>in my theme class I have a function in which i am trying below code but not results achieved as of yet:</p>
  
  <p>CODE FOR THEME AS OF NOW:</p>
  
  <pre><code>
  // custom light theme for app
    static final customLightTheme = ThemeData.light().copyWith(
      brightness: Brightness.light,
      primaryColor: notWhite,
      accentColor: Colors.amberAccent,
      scaffoldBackgroundColor: notWhite,
      primaryTextTheme: TextTheme(
        title: TextStyle(
          color: Colors.black
        ),
  
      ),
      appBarTheme: AppBarTheme(
        iconTheme: IconThemeData(color: Colors.black),
        elevation: 0.0,
      )
    );
  
    // custom dark theme for app
    static final customDarkTheme = ThemeData.dark().copyWith(
      brightness: Brightness.dark,
      primaryColor: Colors.black,
        accentColor: Colors.orange,
        scaffoldBackgroundColor: Colors.black87,
        primaryTextTheme: TextTheme(
          title: TextStyle(
              color: Colors.white
          ),
  
        ),
        appBarTheme: AppBarTheme(
          iconTheme: IconThemeData(color: Colors.white),
          elevation: 0.0,
        ),
  
    );
  
  </code></pre>
  
  <hr>
  
  <p>CODE FOR THEME CHANGER:</p>
  
  <pre><code>
  // set theme for the app
     setTheme(ThemeData theme) {
       _themeData = theme;
  
       if(_themeData == ThemeChanger.customLightTheme){
         SystemChrome.setSystemUIOverlayStyle(
           const SystemUiOverlayStyle(
             statusBarColor: Colors.white,
             systemNavigationBarColor: Colors.white,
             systemNavigationBarDividerColor: Colors.black,
             systemNavigationBarIconBrightness: Brightness.dark,
           ),
         );
       } else {
         SystemChrome.setSystemUIOverlayStyle(
           const SystemUiOverlayStyle(
             statusBarColor: Colors.blue,
             systemNavigationBarColor: Colors.blue,
             systemNavigationBarDividerColor: Colors.red,
             systemNavigationBarIconBrightness: Brightness.light,
           ),
         );
       }
  
       notifyListeners();
     }
  
  
  </code></pre>
  
  <p>This is not what I want as I don't want the third party solution.</p>
  
  <p><a href="https://stackoverflow.com/questions/57974569/icons-color-in-status-bar-flutter">Icon&#39;s color in status bar (Flutter)</a></p>
  
  <p>currently I am getting black icons in white / light theme and also black icons ( which should be white icons ) in dark / black theme on theme change. rest is all working well.</p>