New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flutter problem full-screen on android #23913
Comments
@zoechi .. |
Please add the output of |
Done, added to description issue . |
Thanks for detailing this. The root cause is how we treat the padding for safe areas. When going full-screen, the safe area padding around the edges are reduced to make use of the new space. However, when the multitasking button is pressed, the navbar reappears, and Flutter responds by changing the padding to accommodate the newly appearing navbar, even though it does not need to. We should add some smarter logic to distinguish between actual safe-area changes and temporary changes such as those made by the multitasker. |
Hello. I can confirm the same behavior for point 4. (hide the bottom navbar). We would like to hide the bottom controls in our app, but keep the status bar visible. However, the described behavior (tapping anywhere in the screen opens the black bottom navbar, overlapping the app UI, and no way to hide it) prevents us from doing that. At the same time if we hide both nav and status bars, the app works as expected - system controls appear just on the swipe from bottom to top or from top to bottom. |
I have the same problem showed in the point 4. I'd like to create a fullscreen app (that keeps the status bar but not the bottom navbar) but it is impossible to accomplish because every time a user taps (anywhere) on the screen the bottom navbar is opened and it can be closed only by going in the apps manager section of Android and returning to the app. |
Hi, the problem is already more than six months, will there be any solutions? Since the creation of normal full-screen applications is not possible |
Hi, any update with the related bug? |
I have a very strange problem and I don't know if they are connected... Somehow when I only show the top system overlay, the rest of the screen becomes inactive. I can't scroll or press anything. But when I go to full screen, display both overlays or only the bottom one this doesn't seem to be the case. |
this might not seem obvious but couldn't I abuse the safe areas align widget as a workaround for android as set the values to top and bottom to false just for android? |
Hi, any update with the related bug ? |
Same currently facing case # 4 issue, any updates? |
## Description Not totally happy with this: it seems Flutter and Android have issues with fullscreen mode: flutter/flutter#23913 To get out of spinned mode: hold back and overviews buttons. This only work on Android 5 and later. ## Warning This still need work, orientation changes seem to be broken
Why this issue is not solved yet? |
I feel like this issue deserves a P3 label: https://github.com/flutter/flutter/wiki/Issue-hygiene#priorities There is a fix/hack that works for the keyboard problem (wanting the keyboard to push up the scaffold body, but also wanting to hide the bottom overlay and having the scaffold extend to the bottom of the screen). If you have a FocusNode attached to the text input widget you use, you can listen to it. Keep a local boolean which you attach to the resizeToAvoidBottomInset parameter of the scaffold. And now when the FocusNode has focus (this is of course not the same as the keyboard showing, but it works) set the parameter to true. Code
It's not perfect. The user can still dismiss the keyboard without tapping in the app and then the FocusNode doesn't lose focus. So you need to use a package like https://pub.dev/packages/flutter_keyboard_visibility to also listen for that. Of course if that package works well enough you might not need to listen to the FocusNode anymore which will make this easier. |
Hi @1AlexFix1 codeimport 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(const MyApp(key: Key('app')));
class MyApp extends StatelessWidget {
const MyApp({Key key}) : super(key: key);
@override
Widget build(BuildContext context) => MaterialApp(
home: const MyHomePage(
key: Key('home'),
),
);
}
class MyHomePage extends StatefulWidget {
const MyHomePage({Key key}) : super(key: key);
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _value;
@override
void initState() {
super.initState();
_value = 0;
}
static const List<String> _values = [
'normal',
'fullscreen',
'hide bottom bar',
'hide status bar'
];
void _onChanged(int i) {
switch (i) {
case 1:
SystemChrome.setEnabledSystemUIOverlays([]);
break;
case 2:
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.top]);
break;
case 3:
SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);
break;
default:
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
}
setState(() => _value = i);
}
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
backgroundColor: Colors.yellow,
title: DropdownButton<int>(
value: _value,
icon: Icon(Icons.arrow_downward),
iconSize: 24,
elevation: 16,
onChanged: _onChanged,
items: [
for (String s in _values)
DropdownMenuItem(
value: _values.indexOf(s),
child: Text(s),
)
],
),
),
floatingActionButton: FloatingActionButton(
child: const Icon(Icons.arrow_forward),
backgroundColor: Colors.yellow,
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const SecondRoute(key: Key('second')),
),
),
),
);
}
class SecondRoute extends StatelessWidget {
const SecondRoute({Key key}) : super(key: key);
@override
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
title: const Text('second route'),
),
body: const Center(
child: Text('nothing to see here'),
),
);
}
doctor[✓] Flutter (Channel master, 1.21.0-6.0.pre.37, on Mac OS X 10.15.5 19F101, locale en-GB)
• Flutter version 1.21.0-6.0.pre.37 at /Users/nevercode/development/flutter_master
• Framework revision 35e7005184 (2 days ago), 2020-07-25 09:44:17 -0700
• Engine revision 626244a72c
• Dart version 2.9.0 (build 2.9.0-21.0.dev a3815b6590)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/nevercode/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 46.0.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] VS Code
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.2
[✓] Connected device (4 available)
• Pixel 3a (mobile) • 965AY0WP5C • android-arm64 • Android 10 (API 29)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.5 19F101
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 84.0.4147.89
• No issues found! the SystemOverlay doesn't appear to work as intended video |
I am also having the problem described by @ErcinDedeoglu and @Fleximex. |
Is there any update? I am having issues with the fullscreen too. |
The linked video showing the expected behavior is not available at this link anymore. This bug does not appear to be actionable in its current state, as there are a couple of different bugs described here. We did recently land new Android fullscreen support (flutter/engine#25785, #81303), which deprecates the old If there is still an issue here, please update the bug. If there is more than one issue, please file a separate bug for each and feel free to tag me. :) |
upgraded to 2.5.0-5.1.pre. |
Hi @Lukiya, that is expected behavior. I do not believe Android will allow you to permanently hide the UI navigation from the user. In your case, tapping the screen brings the overlays back into view. You can listen for this change and respond using This also sounds the same as #62412, see the latest comments there (like this) for more context. |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Hello! I found problems with the
SystemChrome.setEnabledSystemUIOverlays ([])
method.I will try to describe in as much detail as possible.
So, let's begin
I created an empty project and replaced it with this one.
Code
Code taken from here https://flutter.io/cookbook/navigation/navigation-basics/
1. Normal State
Code unchanged.
Check the logs for comparing with the following items and note the movement of the contents inside the window when it is in the tray.
2. Full Screen on
Changes in the code.
SystemChrome.setEnabledSystemUIOverlays ([]);
Screen()
Please note that the widget that started the application does not start the assembly after minimizing the application. However, if you go to the second screen, and then to the third, it will call the build function on all the following screens, except the first, when we return to the application.
Note: In the following paragraph, we consider the option with
Navigator.pushReplacement
.3. Full Screen on and change logic next Screen
Changes in the code. The
Navigator.push
method has been replaced byNavigator.pushReplacement
, the second screen is now the main screen, but when we return from the tray, it still calls the build method.Also note that the second screen is the main one, and when the “Back” button is pressed, the application is hidden and the widget calls the
build
method !!!!!! What for????? According to the logic of the android, by pressing back button on the root activity, the activity is killed4. Hide bottom bar
Code changes instead of
SystemChrome.setEnabledSystemUIOverlays ([]);
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.bottom]);
When you open the application, everything is in order, the bottom panel is hidden, but if you tap the screen in any area, it will appear and disappear only after the application goes to the tray and back. The build method is still called after the tray.
5. Hide status bar
Code changes instead of
SystemChrome.setEnabledSystemUIOverlays ([]);
SystemChrome.setEnabledSystemUIOverlays ([SystemUiOverlay.top]);
The top pane does not appear when you tap the screen (everything is fine), and not like in the previous example. The assembly method is still called when you go to the tray and back.
6. Full screen mode is enabled using native Android code.
Added the following code
This is the most interesting case.
Flutter doctor -v
Conclusion
It turns out that at the moment it is impossible to use the usual full-screen mode for Android.
The native flutter method calls assembly methods for all screens, except for the first after returning to the applications from the tray.
In addition, the flutter somehow does not allow the native Android code to hide the lower bar, which would be a quick decision to remove the call for the assembly function on all screens, except for the first after the tray in full screen mode
I hope I somehow helped, because I really liked the flutter.
The text was updated successfully, but these errors were encountered: