getx icon indicating copy to clipboard operation
getx copied to clipboard

iOS - StatusBar Color is not working when i use GetMaterialApp

Open ravitejaavv opened this issue 2 years ago • 9 comments

StatusBar Color is not working when i use GetMaterialApp in iOS. It is working fine in Android. Please find attached screenshots

Version Details: get: ^4.1.4

Code: SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: ColorConstants.primaryColorDark, statusBarIconBrightness: Brightness.light, statusBarBrightness: Brightness.dark, ));

Even i have tried app bar theme but no use.

Screenshot 2022-09-07 at 11 23 11 AM image

flutter doctor -v [✓] Flutter (Channel stable, 3.0.3, on macOS 12.4 21F79 darwin-arm, locale en-IN) • Flutter version 3.0.3 at /Users/raviteja/mobile/flutter-sdk/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 676cefaaff (3 months ago), 2022-06-22 11:34:49 -0700 • Engine revision ffe7b86a1e • Dart version 2.17.5 • DevTools version 2.12.2

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/raviteja/Library/Android/sdk ✗ cmdline-tools component is missing Run path/to/sdkmanager --install "cmdline-tools;latest" See https://developer.android.com/studio/command-line for more details. ✗ Android license status unknown. Run flutter doctor --android-licenses to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.71.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension can be installed from: 🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 31) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101

[✓] HTTP Host Availability • All required HTTP hosts are available

ravitejaavv avatar Sep 07 '22 05:09 ravitejaavv

I got the same issue. Pls, help me.

SaowaluckT avatar Sep 12 '22 09:09 SaowaluckT

/// The color of top status bar. /// /// Only honored in Android version M and greater. final Color? statusBarColor;

if you wrap Scaffold with SafeArea Widget, you may set top to false, or just use SafeArea in Scaffold body.

N0Noorz avatar Sep 13 '22 02:09 N0Noorz

/// The color of top status bar. /// /// Only honored in Android version M and greater. final Color? statusBarColor;

if you wrap Scaffold with SafeArea Widget, you may set top to false, or just use SafeArea in Scaffold body.

The issue is happening in iOS.. is this solution working in ios also?

ravitejaavv avatar Sep 13 '22 02:09 ravitejaavv

/// The color of top status bar. /// /// Only honored in Android version M and greater. final Color? statusBarColor;

if you wrap Scaffold with SafeArea Widget, you may set top to false, or just use SafeArea in Scaffold body.

This solution is not working.

SaowaluckT avatar Sep 13 '22 03:09 SaowaluckT

I can fix this issue. Try to check info.plist file and remove key UIStatusBarHidden

SaowaluckT avatar Sep 13 '22 04:09 SaowaluckT

I can fix this issue. Try to check info.plist file and remove key UIStatusBarHidden

Tried this. But unable to change statusbar color

Code: SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( statusBarColor: ColorConstants.primaryColorDark, statusBarIconBrightness: Brightness.light, statusBarBrightness: Brightness.dark, ));

Tried setting from AppBar also. But no use. Same is working fine in android

image image

ravitejaavv avatar Sep 13 '22 05:09 ravitejaavv

/// The color of top status bar. /// /// Only honored in Android version M and greater. final Color? statusBarColor; if you wrap Scaffold with SafeArea Widget, you may set top to false, or just use SafeArea in Scaffold body.

The issue is happening in iOS.. is this solution working in ios also?

it work for me(Getx version is 4.6.5). in iOS, statusBarColor may be is AppBar or Scaffold backgroudColor.

N0Noorz avatar Sep 14 '22 06:09 N0Noorz

backgroudColor

/// The color of top status bar. /// /// Only honored in Android version M and greater. final Color? statusBarColor; if you wrap Scaffold with SafeArea Widget, you may set top to false, or just use SafeArea in Scaffold body.

The issue is happening in iOS.. is this solution working in ios also?

it work for me(Getx version is 4.6.5). in iOS, statusBarColor may be is AppBar or Scaffold backgroudColor.

Tried with GetX 4.6.5 Tried both AppBar backgroundColor & Scaffold backgroudColor but both are not effecting statusbar color in iOS.

I am using GetMaterialApp in runApp. But same functionality is working fine with MaterialApp.

ravitejaavv avatar Sep 15 '22 05:09 ravitejaavv

@N0Noorz Could you please share working example with GetMaterialApp

ravitejaavv avatar Sep 19 '22 04:09 ravitejaavv