Repository navigation
Closed
Labels
c: regressionIt was better in the past than it is nowf: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packages
Description
Steps to Reproduce
code
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class Page1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text('Page 1'),
),
child: Center(
child: TextButton(
child: Text("Next"),
onPressed: () {
Navigator.of(context).push<void>(
CupertinoPageRoute(
builder: (BuildContext context) => Page2(),
title: "Page 2",
),
);
},
),
),
);
}
}
class Page2 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
middle: Text("Page 2"),
),
child: Center(
child: Text("Page 2"),
),
);
}
}
void main() {
runApp(CupertinoApp(home: Page1()));
}
-
press next to go to page 2
-
press back button on nav bar
Logs
Logs
The following assertion was thrown building CupertinoNavigationBarBackButton(dirty, dependencies:
[_ModalScopeStatus]):
CupertinoNavigationBarBackButton should only be used in routes that can be popped
'package:flutter/src/cupertino/nav_bar.dart':
Failed assertion: line 1366 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:
CupertinoNavigationBar file:///Users/chtai/apps/test1/lib/main.dart:32:22
This is a regression introduced in #71944
Metadata
Metadata
Assignees
Labels
c: regressionIt was better in the past than it is nowf: routesNavigator, Router, and related APIs.frameworkflutter/packages/flutter repository. See also f: labels.p: cupertino_uicupertino_ui package in flutter/packages
Activity
github-actions commentedon Aug 7, 2021
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.