Skip to content

CupertinoNavigationBar leading is too high #18536

Closed

Description

@lukepighetti

For some reason the leading in CupertinoNavigationBar is too high. Any ideas?

screen shot 2018-06-16 at 6 10 46 pm

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: 'Flutter Demo',
      theme: new ThemeData(
        primarySwatch: Colors.blueGrey,
      ),
      home: CupertinoPageScaffold(
        navigationBar: new CupertinoNavigationBar(
      leading: Text("lead"),
      middle: Text("Title"),
      trailing: Text("Trailing")
    ),
        child: Center(child: Text("Test!")),

      )
    );
  }
}

Activity

  1. jonahwilliams commented on Jun 17, 2018

    @jonahwilliams
    Contributor

    (cc @xster)
    While it looks okay with the iOS style back button it is a little weird that with text it aligns so strangely. Comparison:

  2. lukepighetti commented on Jun 18, 2018

    @lukepighetti
    ContributorAuthor

    Yes I can confirm that with the back arrow it looks fine, but with text it is too high.

    Somewhat unrelated, where can I find tools that show information on widgets such as bounding boxes, hitbox, etc. I did find profiler for framerate which is really nice.

  3. added
    a: fidelityMatching the OEM platforms better
    p: cupertino_uicupertino_ui package in flutter/packages
    on Jul 5, 2018
  4. self-assigned this
    on Jul 7, 2018
  5. xster commented on Jul 7, 2018

    @xster
    Member

    This seems consistent with the Material AppBar API as well where the leading widget is forced to take the full height of the leading position slot.

    The easiest workaround is to wrap your leading widget with

    leading: Align(
      widthFactor: 1.0,
      alignment: Alignment.center,
      child: Text('lead'),
    ),

    I'll see if we can make it more convenient

  6. removed their assignment
    on Jul 7, 2018
  7. lukepighetti commented on Jul 7, 2018

    @lukepighetti
    ContributorAuthor

    THIS. IS. SPARTA. Cupertino!

  8. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jul 22, 2018
  9. zoechi commented on Jan 28, 2019

    @zoechi
  10. lukepighetti commented on Jan 28, 2019

    @lukepighetti
    Author
  11. zoechi commented on Jan 28, 2019

    @zoechi
    Contributor

    This seems consistent with the Material AppBar API as well where the leading widget is forced to take the full height of the leading position slot.

    The easiest workaround is to wrap your leading widget with ... Align

    I interpreted it as working as intended.

    I'll see if we can make it more convenient

    Ok, I missed that. I'll reopen.

  12. reopened this on Jan 28, 2019
  13. added this to the milestone on Jan 28, 2019
  14. 27 remaining items

  15. Piinks commented on Aug 14, 2024

    @Piinks
    Contributor

    What is interesting to me here is that trailing does not have the same behavior as leading. Looking at leading and trailing together definitely looks like a bug. AppBar does not have trailing to compare to (like leading discussed above), but maybe we should check AppBar.actions, which is sort of the same as CupertinoNavigationBar.trailing?

  16. victorsanni commented on Aug 14, 2024

    @victorsanni
    Contributor

    What is interesting to me here is that trailing does not have the same behavior as leading. Looking at leading and trailing together definitely looks like a bug. AppBar does not have trailing to compare to (like leading discussed above), but maybe we should check AppBar.actions, which is sort of the same as CupertinoNavigationBar.trailing?

    AppBar.actions behaves like CupertinoNavigationBar.trailing, only that it allows for multiple trailings.

  17. victorsanni commented on May 15, 2025

    @victorsanni
    Contributor

    Part of #91715

  18. victorsanni commented on Jun 5, 2025

    @victorsanni
    Contributor

    minHeight: size.height, // The height should be exactly the height of the bar.

  19. added a commit that references this issue on Jun 9, 2025
  20. github-actions commented on Jun 20, 2025

    @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.

  21. locked as resolved and limited conversation to collaborators on Jun 20, 2025
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

    P3Issues that are less important to the Flutter projecta: fidelityMatching the OEM platforms betterfound in release: 3.16Found to occur in 3.16found in release: 3.19Found to occur in 3.19frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: cupertino_uicupertino_ui package in flutter/packagesteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamworkaround availableThere is a workaround available to overcome the issue

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions