This is the problem that I got => 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 1333 pos 9: 'currentRoute?.canPop == true'
I really do not understand this situation because I used previous 2 pages there is no problem but last page made problem.
Here is my related code part:(third page)
@override
Widget build(BuildContext context) {
final name = basename(widget.file!.path);
if(Platform.isIOS){
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(
leading: CupertinoNavigationBarBackButton(
color: CupertinoColors.white,
),
This is he way how to come here: (first page)
CupertinoButton(
padding: EdgeInsets.all(0),
child: Icon(CupertinoIcons.list_bullet, color: CupertinoColors.white,),
onPressed: () => {
Navigator.push(context, CupertinoPageRoute(builder: (context) => ConsumptionReportsScreen(location: widget.location)))
}
),
(second page)
onTap: () async {
// final file = await PDFApi.loadNetwork(reports[index].pdfUrl);
const url = 'https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf';
final file = await PDFApi().loadNetwork(url);
Navigator.push(context, CupertinoPageRoute(builder: (context) => PdfViewerScreen(file: file)));
},