Skip to content

CupertinoButton in CupertinoNavigationBar as trailing gets cut #32701

Closed

Description

@bierbaumtim

Adding a CupertinoButton with Text to CupertinoNavigationBar as trailing cuts of the Text on its half height.

Steps to Reproduce

https://gist.github.com/tb2761/567623b671e5d15cfadfb1a27248fcf4

Logs

[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.475], locale de-DE)
    • Flutter version 1.5.4-hotfix.2 at C:\Users\Tim\Flutter\src\flutter
    • Framework revision 7a4c33425d (2 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Tim\AppData\Local\Android\Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = C:\Users\Tim\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code (version 1.33.1)
    • VS Code at C:\Users\Tim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.0.2

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

Activity

  1. added
    p: cupertino_uicupertino_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    on May 14, 2019
  2. alphatroya commented on May 29, 2019

    @alphatroya

    Yes, it is cutting by half like on screenshot
    Снимок экрана 2019-05-29 в 17 10 02

    Leading position have simular issue.

  3. ykorzikowski commented on Jun 23, 2019

    @ykorzikowski

    still an issue.

    Workaround:

    Add padding: EdgeInsets.all(10), to CUpertinoButton

  4. bierbaumtim commented on Jun 23, 2019

    @bierbaumtim
    Author

    okay, thanks for the workaround

  5. ameyer117 commented on Mar 25, 2020

    @ameyer117

    Yes this is still a problem.

  6. xster commented on Apr 30, 2020

    @xster
    Member

    We should make it somehow clearer in the doc. There's a default padding for CupertinoButton but we should prompt users to use a smaller padding when inserting into fixed sized parents like the nav bar.

  7. glockhart8 commented on May 9, 2020

    @glockhart8

    CupertinoButton(
    padding: EdgeInsets.all(0.0),
    ...
    )

    If you surround the button in padding, i think that it somehow moves where the touch point is on the button, but if you change the padding inside the button to zero, works well.

  8. self-assigned this
    on Jul 2, 2020
  9. added this to the 1.21 - July 2020 milestone on Jul 2, 2020
  10. tiklup11 commented on Nov 16, 2020

    @tiklup11

    Still this is not fixed

  11. casvanluijtelaar commented on Feb 1, 2021

    @casvanluijtelaar

    still an issue in 1.22.6

  12. quickdashapp commented on Feb 12, 2021

    @quickdashapp

    Still an Issue!! haha

  13. Akhu commented on Mar 21, 2021

    @Akhu

    Still an issue here with the latest version of Flutter

    Flutter 2.0.3 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 4d7946a68d (3 days ago) • 2021-03-18 17:24:33 -0700
    Engine • revision 3459eb2436
    Tools • Dart 2.12.2
    
  14. Piinks commented on Mar 22, 2021

    @Piinks
    Contributor

    I think this is expected, please refer to the documentation for CupertinoButton:

    The [padding] defaults to 16.0 pixels. When using a [CupertinoButton] within
    a fixed height parent, like a [CupertinoNavigationBar], a smaller, or even
    [EdgeInsets.zero], should be used to prevent clipping larger [child]
    widgets.

    If there is a bug around this, please file a new issue with a reproducible code sample and the output of flutter doctor.

  15. lvyandev commented on Mar 23, 2021

    @lvyandev

    So what kind of widget is supposed to be in the trailing?

  16. haashem commented on Apr 20, 2021

    @haashem

    @Ivyandev mostly buttons that user can interact with like submitting a form.
    Screen Shot 2021-04-20 at 11 40 29

  17. talamaska commented on Jun 22, 2021

    @talamaska
    Contributor

    No, just documenting the behavior doesn't solve the issue itself.
    Changing the padding to zero is a workaround, not a fix. If we can't use CupertinoButton as is in the navigation bar, then there should be a separate widget just for that. I don't get how can I put a simple IconButton or TextButton or any other button in AppBar and don't have any problems, but for Cupertino I have to deal with this? I think there should be CupertinoNavigationBarButton or something alike. Should we just do that as a wrapper of CupertinoButton and submit a PR?

  18. github-actions commented on Jul 31, 2021

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

  19. locked as resolved and limited conversation to collaborators on Jul 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

d: api docsIssues with https://api.flutter.dev/frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packageswaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions