in my program, I wish to different behavior depending on whether a class has been defined.
if one had undefined
as in javascript
, something like this:
var i = (NewClass == undefined) ? new OldClass() : new NewClass();
since Dart is compiled, can something like this be done?
seems the best answer is to search for the class NewClass
using the string "NewClass". see Instantiate a class from a string