getRouteParams method

Map<String, String> getRouteParams(
  1. BuildContext context
)

获取路由参数(一般配合NavigatorManager.go一起使用) context页面或控件视图的上下文

Implementation

Map<String, String> getRouteParams(BuildContext context) {
  var arguments = ModalRoute.of(context)?.settings.arguments;
  if (arguments is Map<String, String>) {
    return arguments;
  }
  return {};
}