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

type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>' #2

Open
Vojtas87 opened this issue Jul 20, 2018 · 2 comments

Comments

@Vojtas87
Copy link

Vojtas87 commented Jul 20, 2018

POPULAR section:
E/flutter ( 4417): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter ( 4417): type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>' E/flutter ( 4417): #0 DbHelper.insertMovies (package:fluvies/data/db_helper.dart:49:28) E/flutter ( 4417): <asynchronous suspension> E/flutter ( 4417): #1 PopularScreenPresenter.loadMovies.<anonymous closure> (package:fluvies/popular_screen/popular_screen_presenter.dart:18:16) E/flutter ( 4417): #2 _RootZone.runUnary (dart:async/zone.dart:1381:54) E/flutter ( 4417): #3 _FutureListener.handleValue (dart:async/future_impl.dart:129:18) E/flutter ( 4417): #4 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:633:45) E/flutter ( 4417): #5 Future._propagateToListeners (dart:async/future_impl.dart:662:32) E/flutter ( 4417): #6 Future._complete (dart:async/future_impl.dart:467:7) E/flutter ( 4417): #7 _SyncCompleter.complete (dart:async/future_impl.dart:51:12) E/flutter ( 4417): #8 _withClient (package:http/http.dart) E/flutter ( 4417): <asynchronous suspension> E/flutter ( 4417): #9 get (package:http/http.dart:47:3) E/flutter ( 4417): #10 NetworkUtil.request (package:fluvies/data/network/network_util.dart:9:17) E/flutter ( 4417): #11 NetworkData.fetchPopularMovies (package:fluvies/data/network/network_data.dart:16:16) E/flutter ( 4417): #12 PopularScreenPresenter.loadMovies (package:fluvies/popular_screen/popular_screen_presenter.dart:16:17) E/flutter ( 4417): #13 PopularScreenState.initState (package:fluvies/popular_screen/popular_screen.dart:26:16) E/flutter ( 4417): #14 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3751:58) E/flutter ( 4417): #15 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3617:5) E/flutter ( 4417): #16 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2907:14) E/flutter ( 4417): #17 Element.updateChild (package:flutter/src/widgets/framework.dart:2710:12) E/flutter ( 4417): #18 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3653:16) E/flutter ( 4417): #19 Element.rebuild (package:flutter/src/widgets/framework.dart:3495:5) E/flutter ( 4417): #20 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2242:33) E/flutter ( 4417): #21 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:626:20) E/flutter ( 4417): #22 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:208:5) E/flutter ( 4417): #23 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15) E/flutter ( 4417): #24 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9) E/flutter ( 4417): #25 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5) E/flutter ( 4417): #26 _invoke (dart:ui/hooks.dart:120:13) E/flutter ( 4417): #27 _drawFrame (dart:ui/hooks.dart:109:3)

LIKED section:
E/flutter ( 4417): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception: E/flutter ( 4417): type '_InternalLinkedHashMap<dynamic, dynamic>' is not a subtype of type 'Map<String, dynamic>' E/flutter ( 4417): #0 DbHelper.insert (package:fluvies/data/db_helper.dart:42:30) E/flutter ( 4417): <asynchronous suspension> E/flutter ( 4417): #1 MovieDetailsState.build.<anonymous closure> (package:fluvies/movie_details_screen.dart:70:41) E/flutter ( 4417): <asynchronous suspension> E/flutter ( 4417): #2 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:494:14) E/flutter ( 4417): #3 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:549:30) E/flutter ( 4417): #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24) E/flutter ( 4417): #5 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:161:9) E/flutter ( 4417): #6 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:94:7) E/flutter ( 4417): #7 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:315:9) E/flutter ( 4417): #8 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:73:12) E/flutter ( 4417): #9 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:101:11) E/flutter ( 4417): #10 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:143:19) E/flutter ( 4417): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:121:22) E/flutter ( 4417): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:101:7) E/flutter ( 4417): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:64:7) E/flutter ( 4417): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:48:7) E/flutter ( 4417): #15 _invoke1 (dart:ui/hooks.dart:134:13) E/flutter ( 4417): #16 _dispatchPointerDataPacket (dart:ui/hooks.dart:91:5)

@Vojtas87
Copy link
Author

Vojtas87 commented Jul 20, 2018

Solution:

Map map = {id : movie.id, name : movie.name, poster: movie.poster, backdrop : movie.backdrop, desc : movie.desc, tag : movieTag};

in db_helper.dart has to be replaced by

Map<String, dynamic> map = {id : movie.id, name : movie.name, poster: movie.poster, backdrop : movie.backdrop, desc : movie.desc, tag : movieTag};

because of Dart 2.

@dilpreet2028
Copy link
Owner

Thanks for the solution @Vojtas87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants