Repository: flutter
Issue: CupertinoNavigationBarBackButton works incorrectly
Labels: framework,f: cupertino,has reproducible steps,found in release: 2.5,found in release: 2.6,team-design,triaged-design

## Steps to Reproduce

1. Run `flutter create bug`.
2. Replace contents of `main.dart` file with the following:

```
import 'package:flutter/cupertino.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return CupertinoApp(
      title: 'Flutter Demo',
      home: MyHomePage(),
      routes: {
        '/another-page': (context) => AnotherPage(),
      },
    );
  }
}

class MyHomePage extends StatelessWidget {
  MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return CupertinoTabScaffold(
      tabBar: CupertinoTabBar(
        items: const <BottomNavigationBarItem>[
          BottomNavigationBarItem(
            icon: const Icon(CupertinoIcons.map),
            label: 'Page 1',
          ),
          BottomNavigationBarItem(
            icon: const Icon(CupertinoIcons.map),
            label: 'Page 2',
          ),
          BottomNavigationBarItem(
            icon: const Icon(CupertinoIcons.map),
            label: 'Page 3',
          ),
        ],
      ),
      tabBuilder: (context, i) {
        return CupertinoPageScaffold(
          navigationBar: CupertinoNavigationBar(
            middle: Text('Page $i'),
          ),
          child: SafeArea(
            child: Center(
              child: Container(
                width: double.infinity,
                height: 200,
                child: Column(
                  children: [
                    Text('Hello from Page $i!'),
                    CupertinoButton(
                      child: Text('Go to another page'),
                      onPressed: () =>
                          Navigator.of(context).pushNamed('/another-page'),
                    ),
                  ],
                ),
              ),
            ),
          ),
        );
      },
    );
  }
}

class AnotherPage extends StatelessWidget {
  const AnotherPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    print(ModalRoute.of(context)!.canPop);

    return CupertinoPageScaffold(
      navigationBar: CupertinoNavigationBar(
        leading: CupertinoNavigationBarBackButton(
          color: CupertinoColors.black,
        ),
        middle: Text('Another Page'),
      ),
      child: Center(
        child: Text('Hello from Another Page!'),
      ),
    );
  }
}

```

Run on iOS and click the button to go to Another Page.

3. 

**Expected results:** CupertinoNavigationBarBackButton works normally because the page where it's used indeed can pop.

**Actual results:**  You will see the red box error on page transitions (back and forward) and the following message in the logs:

```
flutter: true

======== Exception caught by widgets library =======================================================
The following assertion was thrown building CupertinoNavigationBarBackButton(dirty):
CupertinoNavigationBarBackButton should only be used in routes that can be popped
'package:flutter/src/cupertino/nav_bar.dart':
Failed assertion: line 1312 pos 9: 'currentRoute?.canPop == true'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was: 
  CupertinoNavigationBarBackButton file:///%PATH_TO_PROJECT%/lib/main.dart:81:18
When the exception was thrown, this was the stack: 
#2      CupertinoNavigationBarBackButton.build (package:flutter/src/cupertino/nav_bar.dart:1312:9)
#3      StatelessElement.build (package:flutter/src/widgets/framework.dart:4648:28)
#4      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4574:15)
#5      Element.rebuild (package:flutter/src/widgets/framework.dart:4267:5)
#6      ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:4553:5)
...
====================================================================================================

```

4. Output of `flutter doctor`:

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.2 20G95 darwin-arm, locale ru-RU)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (version 2020.3)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.60.0)
[✓] Connected device (3 available)

! Doctor found issues in 1 category.
```