Reputation: 169
I just started using Dart, and I haven't been able to find answers to these issues.
How do these three AS3 lines translate into Dart?
1) static var asset:*;
<<-- basically how do I handle *
type
2) static function getAsset():* {
<<-- same issue, how do I handle *
type?
3) static function loadImages(... images):void {
<< -- how do I handle ...
argument?
Upvotes: 2
Views: 179
Reputation: 34031
I don't know ActionScript, but some quick Googling suggests that the asterisk means "can be any type". Since Dart is optionally typed, this means you can just leave the type off. I believe static
works about the same in both languages.
So:
1) static var asset:*;
becomes static var asset;
2) static function getAsset():* {
becomes static getAsset() {
3) Dart doesn't support varargs, but this answer has a workaround.
Upvotes: 1