alibaba / alibaba/flutter_boost
[Bug]: iOS 关于透明页面,提前影响 flutter 顶层容器 生命周期的问题
- Dominant language
- Dart
- Stars
- 7.2k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
### 请描述遇到的问题,以及您所期望的正确的结果
```
//这里分为两种情况,由于UIModalPresentationOverFullScreen下,生命周期显示会有问题
//所以需要手动调用的场景,从而使下面底部的vc调用viewAppear相关逻辑
if vc.modalPresentationStyle == .overFullScreen {
//这里手动beginAppearanceTransition触发页面生命周期
self.navigationController?.topViewController?.beginAppearanceTransition(true, animated: false)
vc.dismiss(animated: true) {
self.navigationController?.topViewController?.endAppearanceTransition()
}
}else{
//正常场景,直接dismiss
vc.dismiss(animated: true, completion: nil)
}
```
demo 里面写了这个注释,现在如果真按照注释去做。
场景 :
FlutterA => 原生 => FlutterB 透明页面
Flutter B 关闭的时候,去手动触发 FlutterA 的viewapper,会触发 FlutterA 的 onPageShow。
但是Flutter A 的PageShow 有做一些业务逻辑,比如原生页面逻辑走完才处理,会导致 Flutter A 这边逻辑错误。
这种问题应该怎么处理
### 请说明如何操作会遇到上述问题
_No response_
### 在下面填入关键复现代码
```
```
### 复现的平台
Both
### Flutter SDK版本
3.27.4
### FlutterBoost版本
4.4.0
### 是否延迟初始化FlutterBoost
No
### 解决方案
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the iOS UIModalPresentationOverFullScreen dismissal path shown in the issue and trace FlutterBoost's FlutterA/FlutterB lifecycle callbacks. Reproduce the FlutterA → native → transparent FlutterB flow with Flutter SDK 3.27.4 and FlutterBoost 4.4.0; done means closing FlutterB no longer triggers an incorrect FlutterA onPageShow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flutter, ios
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100