我已经在Android项目中创建了Flutter View
public void onClick(View view) {
View flutterView = Flutter.createView(
MainActivity.this,
getLifecycle(),
"route1"
);
FrameLayout.LayoutParams layout = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
// layout.leftMargin = 100;
//layout.topMargin = 200;
addContentView(flutterView, layout);
}
但是,我无法弹出/关闭视图。 如何在飞镖代码中弹出此视图?
答案 0 :(得分:1)
编辑:
您可以通过在Dart代码中调用Navigator.pop()
使Flutter应用自行关闭。