AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
How to Name a Method That Transforms Your Data Class Into a Map
With Dart method, you'd say, OK, I have some JSON, and I want to decode it to my class. So in so of whatever generic parameter we want to put It will figure everything out itself and do that for you. With mapable, you have actually have like two sets of functions that can decode and encode your models. And then the signature is here like twoJSON output string. Other how it's done in the other packages is that twoJson is the one function that outputs a map. And then you have to encode it manually. That led to some difficulties. Some people liked that very much how I did it. Some people didn't like that very much.