Android Keyboard causes Status Bar to reappear

1,004

Please share some code. I tried adding SystemChrome.setEnabledSystemUIOverlays([]); in initState() and I have a text field, It is working fine.

Share:
1,004
Admin
Author by

Admin

Updated on December 09, 2022

Comments

  • Admin
    Admin over 1 year

    I need to hide the Android Status bar in my app so i am using the following code

    import 'package:flutter/material.dart';
    import 'package:flutter/services.dart';
    
    main() {
      SystemChrome.setEnabledSystemUIOverlays([]);
      runApp(MyApp());
    }
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
            home: Scaffold(
                body: Center(child: TextField()), backgroundColor: Colors.orange));
      }
    }
    

    I have a textfield in the screen so whenever the Android Keyboard opens the status bar reappears. I have tried with multiple Android devices and i am getting the same bug.

    Is this really a bug in the framework or am i doing something wrong?

    I have attached a short video link below to show the bug

    https://drive.google.com/file/d/19qs5Rsrfc_G1oN5kbxgKvYQAXpTr8RZx/view?usp=sharing

    I have not tested in iOS

  • Admin
    Admin over 5 years
    I have added code in the question, please have a look
  • Admin
    Admin over 5 years
    Check on a real device
  • Keerti Purswani
    Keerti Purswani over 5 years
    Checked your code on real device. Working fine for me. Sharing video to show
  • Keerti Purswani
    Keerti Purswani over 5 years
  • Admin
    Admin over 5 years
    which device are you using and android version. I am using Redmi with Android Marshmallow
  • Keerti Purswani
    Keerti Purswani over 5 years
    I am using MiA1 - Android Version 9. You said you tried on multiple devices right? Which ones?
  • Admin
    Admin over 5 years
    I also tried on Redmi - Lollipop, Coolpad - Marshmallow
  • Admin
    Admin over 5 years
    I guess then the issue is because of Android's Fragmentation