Repository navigation
CupertinoSliverNavigationBar and CupertinoNavigationBar should support background colors #78607
Copy link
Copy link
Closed
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
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.
- Different background colors for expanded and collapsed state.
- Different titles for expanded and collapsed state. The use case could be using
largeTitle: 'Profile'andmiddle: usernamefor example. Currently, in expanded state bothlargeTitleandmiddleare shown, which I think is incorrect.- this second request is reflected in CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for
largeTitleandmiddle#53788
- this second request is reflected in CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for
Proposal
I propose that CupertinoSliverNavigationBar supports the following two things:
- different background colors for expanded and collapsed state with possibility to animate the color change on scroll, and
- different titles for expanded and collapsed state by either:
- not showing
middleproperty on expanded state (which I think should be the way to go), or - adding a
bool showMiddleWhenExpandedproperty denoting whethermiddleshould be present in expanded state as well (probably even better than the first option), or - adding another property
titlethat is showed instead oflargeTitlein collapsed state. This would mean thatmiddleis only showed in expanded state which I think is not OK. - this second request is reflected in CupertinoSliverNavigationBar & CupertinoNavigationBar should support differing style||widget for
largeTitleandmiddle#53788
- not showing
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packagescupertino_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Type
Projects
- StatusShow more project fieldsDone
Activity
darshankawar commentedon Mar 19, 2021
@campovski Hi,
Does this open issue sound similar to yours ?
campovski commentedon Mar 19, 2021
@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.
darshankawar commentedon Mar 22, 2021
Thanks @campovski for clarifying. Feel free to send a PR to fix your and the mentioned issue.
campovski commentedon Mar 22, 2021
@darshankawar Probably this should have "f: cupertino" instead of "f: material design"?
8 remaining items
Cupertino transparent navigation bars (#149102)
Cupertino transparent navigation bars (flutter#149102)
[-]`CupertinoSliverNavigationBar` improvements[/-][+]`CupertinoSliverNavigationBar` and `CupertinoNavigationBar` should support background colors[/+]Piinks commentedon Aug 22, 2024
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:
largeTitleandmiddle#53788victorsanni commentedon Sep 27, 2024
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
victorsanni commentedon Oct 26, 2024
The first part of this issue was resolved in #149102, while the second part was resolved in #113544.
github-actions commentedon Nov 11, 2024
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 -vand a minimal reproduction of the issue.