alibaba / alibaba/flutter_boost

关闭activity页面回传数据到flutter页面失败(发现在FlutterBoostActivity 里面并没有对onActivityResult 方法进行处理)

Open
#1,337 1 comment 0 reactions 0 assignees View on GitHub
Android
Dominant language
Dart
Stars
7.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Description

3.2 Native页面退出时,传递参数给上一个Flutter页面
// 1. 从Flutter页面打开一个Native页面,并处理返回结果
InkWell(
child: Container(
padding: const EdgeInsets.all(8.0),
margin: const EdgeInsets.all(8.0),
color: Colors.yellow,
child: Text(
'open native page',
style: TextStyle(fontSize: 22.0, color: Colors.black),
)),
onTap: () => BoostNavigator.instance
.push("ANativePage") // Native页面路由
.then((value) => print('retval:$value')),
),
// 2. Native页面退出时,返回结果
@Override
public void finish() {
Intent intent = new Intent();
intent.putExtra("msg","This message is from Native!!!");
intent.putExtra("bool", true);
intent.putExtra("int", 666);
setResult(Activity.RESULT_OK, intent); // 返回结果给dart
super.finish();
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting FlutterBoostActivity and tracing how the native Activity result reaches the BoostNavigator push future. Reproduce the shown Flutter-to-native flow with the finish() result payload. Done means the Flutter callback receives the returned msg, bool, and int values after the native Activity closes.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter, java
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.