Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: withContainer为true,传递实体类报错 #1928

Closed
applebest opened this issue Nov 22, 2023 · 1 comment
Closed

[Bug]: withContainer为true,传递实体类报错 #1928

applebest opened this issue Nov 22, 2023 · 1 comment
Labels
Not a problem with boost Maybe it not a problem with boost

Comments

@applebest
Copy link

请描述遇到的问题,以及您所期望的正确的结果

希望可以传递实体类

请说明如何操作会遇到上述问题

使用 BoostNavigator.instance.push(RouterPath.articleLibraryDetail ,arguments:{Nav.argumentsKey:itemModel},withContainer: true)

报错:
E/flutter (15928): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument: Instance of 'ArticleLibraryModelData'
E/flutter (15928): #0 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:465:7)
E/flutter (15928): #1 _NativeRouterApiCodec.writeValue (package:flutter_boost/src/messages.dart:150:13)
E/flutter (15928): #2 StandardMessageCodec.writeValue. (package:flutter/src/services/message_codecs.dart:462:9)
E/flutter (15928): #3 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
E/flutter (15928): #4 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:460:13)
E/flutter (15928): #5 _NativeRouterApiCodec.writeValue (package:flutter_boost/src/messages.dart:150:13)
E/flutter (15928): #6 StandardMessageCodec.writeValue. (package:flutter/src/services/message_codecs.dart:462:9)
E/flutter (15928): #7 _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
E/flutter (15928): #8 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:460:13)
[log] │ #0 Log.d (package:composition_flutter/util/log_utils.dart:36:15)
E/flutter (15928): #9 _NativeRouterApiCodec.writeValue (package:flutter_boost/src/messages.dart:150:13)
E/flutter (15928): #10 _NativeRouterApiCodec.writeValue (package:flutter_boost/src/messages.dart:135:7)
E/flutter (15928): #11 StandardMessageCodec.writeValue (package:flutter/src/services/message_codecs.dart:455:9)
E/flutter (15928): #12 _NativeRouterApiCodec.writeValue (package:flutter_boost/src/messages.dart:150:13)
E/flutter (15928): #13 StandardMessageCodec.encodeMessage (package:flutter/src/services/message_codecs.dart:332:5)
E/flutter (15928): #14 BasicMessageChannel.send (package:flutter/src/services/platform_channel.dart:195:71)
E/flutter (15928): #15 NativeRouterApi.pushFlutterRoute (package:flutter_boost/src/messages.dart:211:23)
E/flutter (15928): #16 FlutterBoostAppState.pushWithResult (package:flutter_boost/src/flutter_boost_app.dart:312:23)
E/flutter (15928): #17 BoostNavigator.push (package:flutter_boost/src/boost_navigator.dart:82:24)
E/flutter (15928): #18 Nav.push (package:composition_flutter/util/nav.dart:18:36)
E/flutter (15928): #19 _ArticleLibraryListPageState.build... (package:composition_flutter/page/articleLibrary/page/article_library_list_page.dart:46:23)
E/flutter (15928): #20 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)
E/flutter (15928): #21 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:654:11)
E/flutter (15928): #22 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:311:5)
E/flutter (15928): #23 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:281:7)
E/flutter (15928): #24 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:167:27)
E/flutter (15928): #25 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:492:20)
E/flutter (15928): #26 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22)
E/flutter (15928): #27 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:333:11)
E/flutter (15928): #28 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7)
E/flutter (15928): #29 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5)
E/flutter (15928): #30 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7)
E/flutter (15928): #31 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9)
E/flutter (15928): #32 _invoke1 (dart:ui/hooks.dart:186:13)
E/flutter (15928): #33 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:424:7)
E/flutter (15928): #34 _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31)
E/flutter (15928):

在下面填入关键复现代码

BoostNavigator.instance.push(RouterPath.articleLibraryDetail ,arguments:{Nav.argumentsKey:itemModel},withContainer: true)

复现的平台

Both

Flutter SDK版本

3.13.9

FlutterBoost版本

4.4.0

是否延迟初始化FlutterBoost

No

解决方案

@joechan-cq
Copy link
Collaborator

joechan-cq commented Nov 24, 2023

FlutterBoost的路由只能传输基础数据类型或List或Map,非Bug。#1844

@0xZOne 0xZOne added the Not a problem with boost Maybe it not a problem with boost label Dec 31, 2023
@0xZOne 0xZOne closed this as completed Dec 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not a problem with boost Maybe it not a problem with boost
Projects
None yet
Development

No branches or pull requests

3 participants