我想使用这个包https://github.com/apptreesoftware/flutter_map来测试 MapboxGL 。
我正在 Nokia 5.3 、 Android 10 上进行测试。
所以当我测试它时,直接从 Main.dart 启动屏幕,它与标记和所有东西都可以正常工作。
但是当我点击一个按钮后尝试进入该屏幕时,我得到一个黑屏。
Pubspec.yaml
environment:
sdk: ">=2.8.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_map: any #Test map
flutter_map_marker_cluster: any
所以就像我说的,当我尝试像这样到达屏幕时
InkWell(
child: Icon(
FontAwesomeIcons.mapMarkerAlt,
size: 12,
color: HexColor('#54D3C2'),),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (BuildContext context) {
return TestMapPage();
},
),);
},
)
我在我的控制台中得到这些。
I/flutter (27236): Another exception was thrown: There are multiple heroes that share the
same tag within a subtree.
W/mple.sportsens(27236): Accessing hidden method Lsun/misc/Unsafe;- >getUnsafe()Lsun/misc/Unsafe; (greylist,core-platform-api, linking, allowed)
W/mple.sportsens(27236): Accessing hidden method Lsun/misc/Unsafe;- >objectFieldOffset(Ljava/lang/reflect/Field;)J (greylist,core-platform-api, linking, allowed)
W/mple.sportsens(27236): Accessing hidden method Lsun/misc/Unsafe;->compareAndSwapObject(Ljava/lang/Object;JLjava/lang/Object;Ljava/lang/Object;)Z (greylist, linking, allowed)
W/mple.sportsens(27236): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist, linking, allowed)