What is the equivalent to Platform.flush() in Dart?

154 Views Asked by At

I was trying to migrate one library from polymer.js to polymer.dart and I found this line:

Platform.flush()

And I was wondering what is the equivalent in dart.

this line appears on line 32 in next library:

https://github.com/Polymer/designer/blob/master/elements/design-state/design-state.html

1

There are 1 best solutions below

0
Günter Zöchbauer On

There isn't and you shouldn't need it in Polymer.dart but you might for interop with Polymer.js. A workaround is to use JS-interop:

import 'dart:js' as js show context;

...

js.context['Platform'].callMethod('flush')

When you call async(...) or asyncTimer(...) of your Polymer element Platform.flush() is called from Polymer.dart code.