Skip to content

CupertinoSliverNavigationBar and CupertinoNavigationBar should support background colors #78607

Closed

Description

@campovski

Both CupertinoSliverNavigationBar and CupertinoNavigationBar should support background colors for the expanded and collapsed states. These colors could also be lerped when those states are in transition.

The second part of the original issue should be followed up on in #53788


OP:

Use case

Currently, CupertinoSliverNavigationBar does not support the following two things.

  1. Different background colors for expanded and collapsed state.
  2. Different titles for expanded and collapsed state. The use case could be using largeTitle: 'Profile' and middle: username for example. Currently, in expanded state both largeTitle and middle are shown, which I think is incorrect.

Proposal

I propose that CupertinoSliverNavigationBar supports the following two things:

  1. different background colors for expanded and collapsed state with possibility to animate the color change on scroll, and
  2. different titles for expanded and collapsed state by either:

The following video shows an example of animated color transition I would like to achieve.

example.MP4

Note

I am willing to implement this if it receives a green light, however details whether color change should be animated or not and which of the three options for point 2. is the best have to be discussed first.

Activity

  1. darshankawar commented on Mar 19, 2021

    @darshankawar
    Member

    @campovski Hi,
    Does this open issue sound similar to yours ?

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 19, 2021
  3. campovski commented on Mar 19, 2021

    @campovski
    ContributorAuthor

    @darshankawar Hm, it seems similar to my proposal but I think it is a different bug. I checked thi issue database and could not find a similar issue. On one side, implementing my proposal could, but not necessarily, fix the mentioned issue. However, fixing the mentioned issue cannot fix mine. If requested, I can fix the mentioned issue as I implement mine.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Mar 19, 2021
  5. darshankawar commented on Mar 22, 2021

    @darshankawar
    Member

    Thanks @campovski for clarifying. Feel free to send a PR to fix your and the mentioned issue.

  6. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    c: new featureNothing broken; request for a new capability
    and removed
    in triagePresently being triaged by the triage team
    on Mar 22, 2021
  7. campovski commented on Mar 22, 2021

    @campovski
    ContributorAuthor

    @darshankawar Probably this should have "f: cupertino" instead of "f: material design"?

  8. added
    p: cupertino_uicupertino_ui package in flutter/packages
    and removed
    p: material_uimaterial_ui package in flutter/packages
    on Apr 12, 2021
  9. 8 remaining items

  10. changed the title [-]`CupertinoSliverNavigationBar` improvements[/-] [+]`CupertinoSliverNavigationBar` and `CupertinoNavigationBar` should support background colors[/+] on Aug 22, 2024
  11. added
    P3Issues that are less important to the Flutter project
    on Aug 22, 2024
  12. Piinks commented on Aug 22, 2024

    @Piinks
    Contributor

    I've updated this issue to reflect the first feature request, to make the issue singular and actionable. The second feature request is now reflected in:

  13. victorsanni commented on Sep 27, 2024

    @victorsanni
    Contributor

    Hi @campovski, @meg4cyberc4t, is this still an issue? If I set a background color for the CupertinoPageScaffold (for the expanded state), and a background color for the CupertinoSliverNavigationBar (for the collapsed state), the nav bar is able to lerp between both colors:

    nav.bar.background.colors.mov
  14. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Oct 12, 2024
  15. victorsanni commented on Oct 26, 2024

    @victorsanni
    Contributor

    The first part of this issue was resolved in #149102, while the second part was resolved in #113544.

  16. added
    r: fixedIssue is closed as already fixed in a newer version
    on Oct 28, 2024
  17. github-actions commented on Nov 11, 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 Nov 11, 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

    P3Issues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions