I'm trying to 'port' some script to the Dart. To learn how everything work etc. But there is a problem - in JavaScript we can set and get any variable in the object. In Dart we have a Map class. And I have no idea how to use it (there is not so many help from Dart API Reference). Currently I have:
Map settings;
//Then I get an dynamic result of a function that gives either null or object.
settings = result ?? {};
settings.someVar = 5;
And this code produces the following error:
"The setter 'someVar' is not defined for the class 'Map'."
Of course I can just 'invent' a new class Settings
, but is there any other solutions?