Open mozerrr opened 3 years ago
Узнал подробности, проблема касается самого флаттера, не знаю можно ли исправить в нативе. https://github.com/flutter/flutter/issues/74801 В таком случае неплохо было бы сделать поддержку полноэкранного режима модалки (параметр acqScreenViewType).
This is not a flutter bug, there are two ways to solve this problem.
1、 Override the method getBackgroundMode
in FlutterActivity
:
public class MyFlutterActivity extends FlutterActivity {
....
@NonNull
protected FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode() {
return FlutterActivityLaunchConfigs.BackgroundMode.transparent;
}
....
}
2、Add extra to the Intent
Intent intent = new Intent(this, FlutterActivity.class);
intent.putExtra("background_mode","transparent");
startActivity(intent);
This is not a flutter bug, there are two ways to solve this problem. 1、 Override the method
getBackgroundMode
inFlutterActivity
:public class MyFlutterActivity extends FlutterActivity { .... @NonNull protected FlutterActivityLaunchConfigs.BackgroundMode getBackgroundMode() { return FlutterActivityLaunchConfigs.BackgroundMode.transparent; } .... }
2、Add extra to the
Intent
Intent intent = new Intent(this, FlutterActivity.class); intent.putExtra("background_mode","transparent"); startActivity(intent);
这只能修复切换到后台的黑屏,对权限申请息屏亮屏后导致的黑屏无作用。