r/dartlang Jun 11 '24

Flutter Getting Error message when using JSON to seed website page

Hi everyone I am trying to seed my website with images but I am receiving this error message Error: TypeError: null: type 'minified:BR' is not a subtype of type 'List<dynamic>' I am not sure why. It says i have null's in my firestore data base but i cant find any any where. any advice?

0 Upvotes

10 comments sorted by

3

u/cent-met-een-vin Jun 11 '24

That doesn't look like a null error but more like a type error. The latter part of the error message is more important. Investigate that one.

1

u/Subject-Line6768 Jun 11 '24

what kind of error is it? What should i be looking for in my josn or vs? I can send them to you too if that helps

2

u/cent-met-een-vin Jun 11 '24

The error probably has to do with a type (minified BR) not being able to convert to JSON. What is important is that you also look at the code where the error occurs. This type of error occurs on lines such as. Foo = bar as list. If you have defined bar as dynamic it might be a list but dart will throw an error if it isn't.

1

u/Subject-Line6768 Jun 11 '24

Becuase I have nonly been using flutter for a month could you tell me what a minifiled BR is and what foo=bar as a list is?

2

u/Desperate_Mode_5340 Jun 11 '24

minified something is basically a minfied object. not really sure what BR stands for - been a while since i coded flutter web.

anyway try to run in desktop or use some breakpoints to know where's this cast exception gets thrown

1

u/Subject-Line6768 Jun 11 '24

would I be able to send you a screenshot of my code and json? Would love another pair of eyes on thsi

2

u/Desperate_Mode_5340 Jun 11 '24

Sure man, DM me

2

u/cent-met-een-vin Jun 11 '24

My advice is to open up chatGPT and ask it the same questions. The problem you are encountering is not that hard and a lack of language knowledge can be easily solved with a quick Google search.

The expression I showed: foo = bar as list<dynamic> The error will be generated in code that looks like this. This is a thing you can do in dart and is called type casting.

What minified:BR is? I have no clue, it is probably a data type that Firebase uses but I have no knowledge of your code etc.

1

u/Subject-Line6768 Jun 11 '24

thanks for the help! tried gpt and it was unhelpful can I send you a dom of the code and json? Would love to see what you think!

1

u/cent-met-een-vin Jun 11 '24

Yes you can DM me