Skip to content
Advertisement

type ‘_InternalLinkedHashMap’ is not a subtype of type ‘FutureOr<List>’

I have a Problem with my json.decode. I want to get some data from my website but when my website says {“Number”:5} i only get this error (type ‘_InternalLinkedHashMap<String, dynamic>’ is not a subtype of type ‘FutureOr<List>’).

However if my website says string{“Number”:5} i get the correct output and this error FormatException: Unexpected character (at character 1).

Here is my Flutter code:

JavaScript

Thanks for any answer

Advertisement

Answer

Your data from the website and receive by datauser is a Map, not a List.

Change this

JavaScript

For this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement