当通过单击showBottomSheet将屏幕导航到另一个人时,此错误通过以下代码引发。
FloatingActionButton(
onPressed: (){
showModalBottomSheet(context: context, builder: (context){
return showComments(
context,
postId: postId,
ownerId: ownerId,
mediaUrl: mediaUrl,
);
});
},
child: Icon(Icons.message),
);
}
}
showComments(BuildContext context,
{String postId, String ownerId, String mediaUrl}) {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return Comments(
postId: postId,
postOwnerId: ownerId,
postMediaUrl: mediaUrl,
);
}));
}