alibaba / alibaba/flutter_boost

已经pause的页面destroy后没有调用dispose

Open
#866 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

## Steps to Reproduce
**A small application to reproduce the bug(最小化可复现的demo)**

1. 把demo的MainActivity启动模式改为singleTask
2. NativePageActivity 的点击事件处理改为打开MainActivity
3. simple_page_widgets.dart中_FlutterRouteWidgetState增加initState和dispose方法,打印日志
4. 安装demo,依次open flutter page->open native page->open native page
5. 查看日志,只打印了initState,没有打印dispose,而这个时候flutter页面其实已经不在了
6. 重新打开flutter页面发现打印日志initState dispose

**Flutter Boost Version:** 1.12.13+3
**Target Platform:** Android
**Target OS version/browser:** 8.1.0
**Devices:** PIXEL

## Logs
add your crash log or something else.

```
// 1-5步骤打印日志
I/flutter (25896): flutterboost:initState

// 6步骤打印日志
I/flutter (25896): flutterboost:initState
I/flutter (25896): flutterboost:dispose
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the reproduction sequence on Android 8.1 with MainActivity in singleTask mode, then inspect simple_page_widgets.dart and the NativePageActivity click handling. Trace the Flutter page lifecycle across the native-page transitions and compare the logged initState and dispose calls. Done means the affected page is disposed when it is no longer present, with the lifecycle behavior covered by a reproducible check.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.