Your Site Title

Flutter 导航

Navigator.of(context).push /// 使用构造函数传参
Navigator.of(context).pushAndRemoveUntil
Navigator.of(context).pop

Navigator.of(context).pushNamed
arguments 可以传参数

/// 提取arguments
1. ModalRoute.of(context).settings.arguments
2. MaterialApp.onGenerateRoute settings.arguments  然后传递给MaterialPageRoute.PassArgumentsScreen

/// 获取返回值
final result = await Navigator.push

监听回退按钮(包换Android Back按钮)

WillPopScope

Reference

Navigation and routing Navigation Learning Flutter’s new navigation and routing system