Open brianquinlan opened 2 years ago
NSObject has a new class method that is equivalent to [[class alloc] init] but calling it is not intuitive because new is a keyword in Dart.
NSObject
new
[[class alloc] init]
Maybe we could have a special case like this:
class MyClass extends NSObject { factory MyClass(MyLib lib) { return castFrom(new1(lib)); }
So you can write:
final c = MyClass(lib);
instead of:
final c = MyClass.new1(lib);
That would be a good start. I was also thinking of translating every method starting with "init" into a constructor.
NSObject
has anew
class method that is equivalent to[[class alloc] init]
but calling it is not intuitive becausenew
is a keyword in Dart.Maybe we could have a special case like this:
So you can write:
instead of: