alibaba / alibaba/flutter_boost

flutterboost-v3.0-null-safety-preview.16 Flutter 跳转原生 报错

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

Description

Dart:
BoostNavigator.instance.push(
'native_main',
withContainer: true,
arguments: {},
opaque: true,
).then((dynamic result) {
// 一打开C页面,该回调立马执行,返回null。
})
OC:
- (void) pushNativeRoute:(NSString *) pageName arguments:(NSDictionary *) arguments{
BOOL animated = [arguments[@"animated"] boolValue];
BOOL present= [arguments[@"present"] boolValue];

ViewController *nvc = [[ViewController alloc] init];
if(present){
[self.navigationController presentViewController:nvc animated:animated completion:^{
}];
}else{
[self.navigationController pushViewController:nvc animated:animated];
}
}

报错信息:
2021-12-09 18:10:31.410845+0800 FlutterHybridDemo[1962:381160] [VERBOSE-2:ui_dart_state.cc(199)] Unhandled Exception: Null check operator used on a null value
#0 _MyAppState.routeFactory (package:flutter_module/main.dart:121:62)
#1 routeFactoryWrapper. (package:flutter_boost/src/boost_navigator.dart:17:30)
#2 BoostNavigator.isFlutterPage (package:flutter_boost/src/boost_navigator.dart:61:20)
#3 BoostNavigator.push. (package:flutter_boost/src/boost_navigator.dart:96:13)
#4 _rootRunUnary (dart:async/zone.dart:1362:47)
#5 _CustomZone.runUnary (dart:async/zone.dart:1265:19)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with _MyAppState.routeFactory at main.dart:121 and follow the calls through flutter_boost/src/boost_navigator.dart, especially BoostNavigator.push. Reproduce the BoostNavigator push to the native route in the FlutterHybridDemo, then verify that opening the native page does not raise the null-check exception and that the returned callback behavior is correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, objective-c
Domain
mobile-dev
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.