Skip to content

CupertinoSliverNavigationBar's alwaysShowMiddle now working during page transition #119522

@DavideDessi319

Description

@DavideDessi319

Steps to Reproduce

When I use a CupertinoSliverNavigationBar that transitions to a CupertinoPageScaffold containing a CupertinoNavigationBar, the hero transition looks all right, but the middle which should show only when the CupertinoSliverNavigationBar is scrolled is showing as well for a brief moment, both when pushing and popping the view.
I suppose this is the correct animation in case there's both a largeTitle and a middle visible, but it shouldn't be the case in case the alwaysShowMiddle property is set to false.

  1. Execute flutter run on the code sample
  2. ...
  3. ...

Actual results:

Screen.Recording.2023-01-30.at.17.44.33.mov
Code sample

Here is some code to reproduce the issue

Page one:

CupertinoPageScaffold(
      child: CustomScrollView(
        slivers: [
          CupertinoSliverNavigationBar(
            largeTitle: Text('Test large Title'),
            middle: Text('Test middle'),
            alwaysShowMiddle: false,
            automaticallyImplyLeading: false,
            backgroundColor:
                CupertinoTheme.of(context).scaffoldBackgroundColor.withOpacity(0.7),
            stretch: true,
            border: null,
          ),
        ],
      ),
    );

Page two

CupertinoPageScaffold(
      navigationBar: const CupertinoNavigationBar(
        middle: Text('Aggiungi'),
      ),
      child: Container(),
);
Logs

Metadata

Metadata

Labels

f: cupertinoflutter/packages/flutter/cupertino repositoryf: routesNavigator, Router, and related APIs.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions