3

I am trying to upgrade to DART 1.9.3, Polymer 0.16.1

Code that worked before:

initPolymer().run((){
   ... some code
}

now reports that

"the method run() is not defined for Future<Zone>"

Is this a known change/defect? What would be a workaround?

Please, advise.

slybloty
  • 6,346
  • 6
  • 49
  • 70
Yuri P.
  • 389
  • 2
  • 11

1 Answers1

5

The Polymer.dart release notes for 0.16.0 have:

Breaking Changes

The initPolymer() method now returns a Future instead of a Zone. This is not completed until all @HtmlImport imports have finished loading. See the changelog for more information and a few example migration paths.

Which suggests that you should put your ... some code inside a function called realMain() and call it like:

main() => initPolymer().then((zone) => zone.run(realMain));
realMain() => ...

Or:

main() => initPolymer();

@initMethod
realMain() => ...
Community
  • 1
  • 1
ComputerDruid
  • 16,897
  • 1
  • 19
  • 28