Open Kabilan21 opened 3 years ago
Hi @Kabilan21
Can you please provide your flutter doctor -v
& a minimal complete reproducible code sample in a repository
Thank you
Hi @TahaTesser
You can find the app here .In MainActivity you can find onPostResume() . Initially, flutter fragment is loaded, it contains a button to navigate to the native fragment .
I placed the appbar inside fragment.xml , the issue is same if the appbar is placed inside the activity_main.xml layout.
By clicking "Navigate to native" button you can navigate to native fragment . It has a App bar but it is hidden in presence of the code flutter.onPostResume();
Without the presence of the flutterfragment.onPostResume() ,sometimes if the app is opened and in the memory for a long time, and the app is opened again, it crashes. I am not sure the crash is due to not handling of flutterfragment.onPostResume().
Run flutter pub get in flutter module directory to generate the necessary files for flutter module.
Hi @Kabilan21 Thanks for the code sample, I can reproduce the issue
stable |
master |
---|---|
❌ | ❌ |
Check flutter doctor -v
outputs for each channel below
✅: No Issue ❌: Issue reproduced
cc @blasten
嗨@Kabilan21 感谢您提供代码示例,我可以重现该问题
Screenrecorder-2021-08-05-13-36-45-881.mp4
stable
master
❌ ❌ 检查flutter doctor -v
下面每个通道的输出颤振医生 -v ✅: 没有任何问题 ❌: 问题转载
I also encountered the same problem in the project. If this method is not called, the problem will not occur when the app enters the foreground.
How can I solve this problem? If I don't call onpostresume, will it cause other problems?
hi,
I am using Flutter add-to-app implementation. I have a MainActivity that extends AppCompatActivity . it has two fragments, a native fragment, and a Flutter fragment. App theme is currently set to noActionBar. I have a custom app bar in the layout_main.xml
adding flutterFragment.onPostResume() causes the app bar to partially hide under the status bar.
A single line change removing flutterFragment.onPostResume() makes the app work as expected .
I have found a solution, which can be solved by overriding the onpostresume method and calling setsystemuivisibility again
hi @Rempage,
can you share the solution in code? specifically the onPostResume() override.
hi @Rempage,
can you share the solution in code? specifically the onPostResume() override.
@Override
protected void onPostResume() {
super.onPostResume();
if (mainFrag != null) {
mainFrag.onPostResume();
}
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
}
You can try it. You can set other enumeration parameters.
hi,
I am using Flutter add-to-app implementation. I have a MainActivity that extends AppCompatActivity . it has two fragments, a native fragment, and a Flutter fragment. App theme is currently set to noActionBar. I have a custom app bar in the layout_main.xml
adding flutterFragment.onPostResume() causes the app bar to partially hide under the status bar.
A single line change removing flutterFragment.onPostResume() makes the app work as expected .