📅  最后修改于: 2022-03-11 14:59:22.445000             🧑  作者: Mango
var exampleArgument = 'example string';
Navigator.pushNamed(
context,
ImagesScreen.routeName,
arguments: {'exampleArgument': exampleArgument},
);
and extract the arguments as follows:
@override
Widget build(BuildContext context) {
final arguments = ModalRoute.of(context).settings.arguments as Map;
if (arguments != null) print(arguments['exampleArgument']);
return Scaffold(...);
}