我在Back Screen Go中使用此功能,但不在页面刷新中
final alertsScreen = AlertsScreen(userId: loginController.currentUser.value?.id ?? '');
Navigator.push(context, MaterialPageRoute(builder: (context) => alertsScreen));
Future<bool> _onWillPop() async {
// Reload data when the user presses the back button
await fetchNotifications;
await markNotificationAsRead;
await _showNotificationDetails;
print("hello");
Navigator.pop(context, alerts.length);
return true;
// Allow the back navigation
}