dart-league / dson

dart library which converts Dart Objects into their JSON representation
Apache License 2.0
66 stars 14 forks source link

the method [] was called on null #19

Closed LexiBigCheese closed 7 years ago

LexiBigCheese commented 7 years ago

pretty much when i saw where it was coming from i said:

so how do i _initMirrors() when I don't have an _initMirrors()?

as i see it i need an _initMirrors() function from somewhere but i don't have one. i see it in your examples.

update: I think i know where to get an _initMirrors() function, but my main and all the things that need serializing are seperate, so i don't think it'll give my main.dart a main.g.dart with a _initMirrors() function

LexiBigCheese commented 7 years ago

the answer is in the main file at the top do

library lib.main; //replace lib.main with where ever it is separated by dots and no .dart
//imports and stuff
import 'package:dson/dson.dart'
//imports and stuff

then at the top of the main function put _initMirrors() and save, then do the build or watch or whatever and ayo spaghettio succ ess