Index: third_party/pkg/angular/example/web/animation/stress_demo.dart |
diff --git a/third_party/pkg/angular/example/web/animation/stress_demo.dart b/third_party/pkg/angular/example/web/animation/stress_demo.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2f9b9a488cf77e43ec0cd554b8934cf573d062a1 |
--- /dev/null |
+++ b/third_party/pkg/angular/example/web/animation/stress_demo.dart |
@@ -0,0 +1,33 @@ |
+part of animation; |
+ |
+@Component( |
+ selector: 'stress-demo', |
+ template: ''' |
+ <div class="stress-demo"> |
+ <button ng-click="ctrl.visible = !ctrl.visible"> |
+ Toggle Visibility</button> |
+ <div> |
+ <div class="stress-box" ng-repeat="number in ctrl.numbers"></div> |
+ </div> |
+ </div> |
+ ''', |
+ publishAs: 'ctrl', |
+ applyAuthorStyles: true) |
+class StressDemo { |
+ bool _visible = true; |
+ final numbers = <int>[1, 2]; |
+ |
+ // When visibility changes add or remove a large chunk of elements. |
+ void set visible(bool value) { |
+ if (value) { |
+ for (int i = 0; i < 200; i++) { |
+ numbers.add(i); |
+ } |
+ } else { |
+ numbers.clear(); |
+ } |
+ _visible = value; |
+ } |
+ |
+ bool get visible => _visible; |
+} |