Skip to content

Edge-To-Edge by default on android #86248

Closed

Description

@LasseRosenow

Use case

Recently flutter got official android edge-to-edge support for android (#81303). But its not enabled by default even though edge-to-edge is considered to be the new default way of developing modern android applications.
Changing edge-to-edge to be the default behaviour would make all flutter applications look much more modern without the need of specifically opting in, which is something many people would forget to do, or don't even know about.

Proposal

Make this the new default:

SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);

Activity

  1. LasseRosenow commented on Jul 11, 2021

    @LasseRosenow
    ContributorAuthor

    @Piinks I guess you would be the correct person to ping regarding this demand :)

  2. changed the title [-]Edge-To-Edge by default[/-] [+]Edge-To-Edge by default on android[/+] on Jul 11, 2021
  3. added
    in triagePresently being triaged by the triage team
    a: layoutSystemChrome and Framework's Layout Issues
    platform-androidAndroid applications specifically
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    a: qualityA truly polished experience
    and removed
    in triagePresently being triaged by the triage team
    on Jul 12, 2021
  4. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jul 12, 2021
  5. Piinks commented on Jul 12, 2021

    @Piinks
    Contributor

    Thanks for reporting! I did not know edge to edge was the default. We'll just need to see if making that change is breaking first. :)

  6. hectorAguero commented on Jul 13, 2021

    @hectorAguero

    @Piinks I have two problems with the implementation of Edge to Edge support.

    1. In addition to set SystemUiMode.edgeToEdge I need to set systemNavigationBarColor: Colors.transparent, because without that EdgetoEdge don't work
    import 'package:flutter/material.dart';
    import 'package:flutter/services.dart';
    
    void main() => runApp(MyApp());
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(
            systemNavigationBarColor: Colors.transparent));
        SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
        return MaterialApp(
            title: 'Material App',
            home: Scaffold(
              appBar: AppBar(
                title: Text('Material App Bar'),
              ),
              body: ListView.builder(
                  itemCount: 50,
                  itemBuilder: (context, index) => Container(
                      height: 100,
                      color: index % 2 == 0 ? Colors.white : Colors.grey.shade900)),
            ));
      }
    }
    1. EdgeToEdge broke in some way Android Native Splash Screen in xml, I create a new project and set a flutter logo image in the center, when I enable edgeToEdge on flutter side the logo go down, this not happen more in flutter 2.5 if I delete the io.flutter.embedding.android.SplashScreenDrawable from the androidmanifest as said here at the end https://flutter.dev/docs/development/ui/advanced/splash-screen#migrating-from-manifest--activity-defined-custom-splash-screens

    But this issue #64001 still happens.

  7. NaikSoftware commented on Jul 28, 2021

    @NaikSoftware

    Also viewInsets.bottom animated with lags when keyboard start showing and this cause lags on all screens with text fields in bottom of the screen (chat, etc)

  8. TheJulianJES commented on Sep 9, 2021

    @TheJulianJES

    Did anyone try SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge); on Android SDK 16 - 19?
    For me, a BottomNavigationBar completely merges underneath the Android navigation bar.
    I'd assume that (like in SDK 21+) the navigation bar renders on top but the "SafeArea" padding at the bottom is increased to accommodate the Android navigation bar.

  9. 20 remaining items

  10. added
    P3Issues that are less important to the Flutter project
    on Apr 22, 2024
  11. removed their assignment
    on Apr 22, 2024
  12. added
    P2Important issues not at the top of the work list
    and removed
    P3Issues that are less important to the Flutter project
    on Jun 13, 2024
  13. camsim99 commented on Jun 13, 2024

    @camsim99
    Contributor

    Bumping this in priority as this will round out the work to support changes coming to edge-to-edge in Android 15.

  14. camsim99 commented on Jun 17, 2024

    @camsim99
    Contributor

    FYI to the iOS team because edge-to-edge mode is used by default on iOS and completing this to better align with iOS and Android moving forward will make this consistent across the two platforms.

  15. camsim99 commented on Sep 11, 2024

    @camsim99
    Contributor

    Some updates here...

    What has been done

    Android is enforcing edge-to-edge mode by default for Android apps that target Android 15+. Flutter updated the default target SDK version to 35 in #153795, effectively opting in apps running on Android 15+ devices into edge-to-edge by default. In this way, we have aligned Flutter Android apps on devices running Android 15+ with Flutter iOS apps by making edge-to-edge the default mode, effectively addressing this issue.

    What we also considered

    We considered enforcing edge-to-edge modes on devices it is available on (API 29+), but this would make it hard for developers to also design for API < 29 devices where it is not available.

    We also considered enforcing edge-to-edge mode for devices running some API >= 29, but having edge-to-edge be the default and still allowing for opt outs (see migration guide) keeps us aligned with Android's timeline for edge-to-edge, which notably is allowing opt outs to give developers time to migrate.

    What's left to do

    cc @reidbaker if you have any further thoughts from our offline discussion

  16. camsim99 commented on Oct 2, 2024

    @camsim99
    Contributor

    What's left to do

    After talking with the team, we've decided that the priority for this task was publishing a migration guide for folks wishing to use a non edge-to-edge mode (done, see https://docs.flutter.dev/release/breaking-changes/default-systemuimode-edge-to-edge). Documentation on how to migrate design-wise is a nice to have and this issue shouldn't depend on it, so I'm going to close this issue as complete!

  17. github-actions commented on Oct 16, 2024

    @github-actions

    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 flutter doctor -v and a minimal reproduction of the issue.

  18. locked as resolved and limited conversation to collaborators on Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: layoutSystemChrome and Framework's Layout Issuesa: qualityA truly polished experiencec: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions