Coder Social home page Coder Social logo

Comments (8)

amitkhairnar44 avatar amitkhairnar44 commented on May 27, 2024 1

@jfdeveloper92 I had same issue and it was solved when i used

SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(statusBarColor: Colors.transparent));

from flutter_statusbarcolor.

jfdeveloper92 avatar jfdeveloper92 commented on May 27, 2024

@amitkhairnar44 are you using the white status bar? I did this and my icons are also white for some reason. I am using

FlutterStatusbarcolor.setNavigationBarColor(Colors.white);
FlutterStatusbarcolor.setNavigationBarWhiteForeground(false);
FlutterStatusbarcolor.setStatusBarColor(Colors.white);
FlutterStatusbarcolor.setStatusBarWhiteForeground(false);

from flutter_statusbarcolor.

amitkhairnar44 avatar amitkhairnar44 commented on May 27, 2024

@jfdeveloper92 I'm not using white status bar. If your AppBar's color is white then no need to set white background in status bar. Just set it transparent using

FlutterStatusbarcolor.setStatusBarWhiteForeground(false);

from flutter_statusbarcolor.

amitkhairnar44 avatar amitkhairnar44 commented on May 27, 2024

Or see this example code

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_statusbarcolor/flutter_statusbarcolor.dart';

main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
  Key key = new UniqueKey();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      key: key,
      title: 'Example',
      home: new HomePage(),
    );
  }

  @override
  didChangeAppLifecycleState(AppLifecycleState state) {
    if (state == AppLifecycleState.resumed) {
      _changeStatusBarColor();
    }
    super.didChangeAppLifecycleState(state);
  }

  @override
  dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
    _changeStatusBarColor();
  }
  _changeStatusBarColor() async {
    await FlutterStatusbarcolor.setStatusBarWhiteForeground(false);
    SystemChrome.setSystemUIOverlayStyle(
        SystemUiOverlayStyle(statusBarColor: Colors.transparent));
  }
}

from flutter_statusbarcolor.

jfdeveloper92 avatar jfdeveloper92 commented on May 27, 2024

@amitkhairnar44 Thanks. Do you know of a way to set the screen fullscreen while keeping these settings? Im currently using the below code to make the screen full screen while on landscape. However with this code it is ignoring the status bar color.

if (MediaQuery
.of(context)
.orientation == Orientation.landscape) {
SystemChrome.setEnabledSystemUIOverlays([]);
} else {
SystemChrome.setEnabledSystemUIOverlays(
[SystemUiOverlay.bottom, SystemUiOverlay.top]);
}

from flutter_statusbarcolor.

amitkhairnar44 avatar amitkhairnar44 commented on May 27, 2024

@jfdeveloper92 In portrait or landscape?

from flutter_statusbarcolor.

jfdeveloper92 avatar jfdeveloper92 commented on May 27, 2024

@amitkhairnar44 well im wanting the app to go full screen in landscape then go back to normal on in portrait. Its a video app so im wanting the video to go full screen when you go landscape.

from flutter_statusbarcolor.

jfdeveloper92 avatar jfdeveloper92 commented on May 27, 2024

also while keeping the statusbar color

from flutter_statusbarcolor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.