Index: samples/calculator/calculator.dart |
diff --git a/samples/calculator/calculator.dart b/samples/calculator/calculator.dart |
index 10a0477e9a567e954d619bf4ebb1bd7c750af2ed..cd6c2b4971373d8ff0b5d1808cb8784ae6af9f13 100644 |
--- a/samples/calculator/calculator.dart |
+++ b/samples/calculator/calculator.dart |
@@ -5,6 +5,7 @@ |
import 'dart:html'; |
import 'dart:math' as Math; |
import 'calcui.dart'; |
+import 'dart:async'; |
Set numberKeyPresses; |
Set operatorKeyPresses; |
@@ -324,8 +325,9 @@ void flickerKey(Element key, [String postfix = '-hover']) { |
} |
key.classes.add('${theClass}${postfix}'); |
final String nextPostfix = (postfix == '-error') ? '-error' : '-press'; |
- window.setTimeout(() => resetKey(key, '${theClass}${postfix}', |
- '${theClass}${nextPostfix}'), 80); |
+ new Timer(const Duration(milliseconds: 80), |
+ () => resetKey(key, '${theClass}${postfix}', |
+ '${theClass}${nextPostfix}')); |
} |
void resetKey(Element key, String classToRemove, [String classToAdd = ""]) { |
@@ -333,7 +335,8 @@ void resetKey(Element key, String classToRemove, [String classToAdd = ""]) { |
key.classes.remove(classToRemove); |
if (classToAdd.length > 0) { |
key.classes.add(classToAdd); |
- window.setTimeout(() => resetKey(key, classToAdd), 80); |
+ new Timer(const Duration(milliseconds: 80), |
+ () => resetKey(key, classToAdd)); |
} |
} |
} |