2

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?

Seth Ladd
  • 95,521
  • 62
  • 179
  • 266
user2267395
  • 119
  • 1
  • 1
  • 5

1 Answers1

1

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.

Community
  • 1
  • 1
Darshan Rivka Whittle
  • 31,378
  • 7
  • 87
  • 105