Skip to content

Commit

Permalink
Instantiation of lists with new List<Object>
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuLorber committed Oct 27, 2012
1 parent 49724ed commit c4065ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions labs/architecture-examples/dart/web/dart/TodoApp.dart
@@ -1,7 +1,7 @@
part of todomvc; part of todomvc;


class TodoApp { class TodoApp {
List<TodoWidget> todoWidgets = []; List<TodoWidget> todoWidgets = new List<TodoWidget>();


Element todoListElement = query('#todo-list'); Element todoListElement = query('#todo-list');
Element mainElement = query('#main'); Element mainElement = query('#main');
Expand Down Expand Up @@ -63,7 +63,7 @@ class TodoApp {
}); });


clearCompletedElement.on.click.add((MouseEvent e) { clearCompletedElement.on.click.add((MouseEvent e) {
List<TodoWidget> newList = []; List<TodoWidget> newList = new List<TodoWidget>();
for (TodoWidget todoWidget in todoWidgets) { for (TodoWidget todoWidget in todoWidgets) {
if (todoWidget.todo.completed) { if (todoWidget.todo.completed) {
todoWidget.element.remove(); todoWidget.element.remove();
Expand Down Expand Up @@ -170,7 +170,7 @@ class TodoApp {


void save() { void save() {
StringBuffer storage = new StringBuffer('['); StringBuffer storage = new StringBuffer('[');
List<Todo> todos = []; List<Todo> todos = new List<Todo>();
for (TodoWidget todoWidget in todoWidgets) { for (TodoWidget todoWidget in todoWidgets) {
todos.add(todoWidget.todo); todos.add(todoWidget.todo);
} }
Expand Down

0 comments on commit c4065ce

Please sign in to comment.