Index: samples/simple_todo/simple_todo_impl.dart |
diff --git a/samples/simple_todo/simple_todo_impl.dart b/samples/simple_todo/simple_todo_impl.dart |
deleted file mode 100644 |
index 9b5d66826726a68fdeb6b85c22d015525e254242..0000000000000000000000000000000000000000 |
--- a/samples/simple_todo/simple_todo_impl.dart |
+++ /dev/null |
@@ -1,61 +0,0 @@ |
-// Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
-// for details. All rights reserved. Use of this source code is governed by a |
-// BSD-style license that can be found in the LICENSE.md file. |
- |
-import 'todo_model.dart'; |
-import 'generated/dart/simple_todo.dart'; |
- |
-class TodoImpl extends TodoService { |
- TodoModel _model = new TodoModel(); |
- |
- TodoImpl() { |
- _model.createItem("Default todo."); |
- _model.createItem("Another todo."); |
- } |
- |
- void createItem(BoxString title) { |
- _model.createItem(title.s); |
- } |
- |
- void toggle(int id) { |
- if (_model.todos.containsKey(id)) { |
- Item item = _model.todos[id]; |
- if (item.done) { |
- item.uncomplete(); |
- } else { |
- item.complete(); |
- } |
- } |
- } |
- |
- void clearItems() { |
- _model.clearItems(); |
- } |
- |
- void getItem(int index, TodoItemBuilder result) { |
- Iterable<Item> items = _model.todos.values; |
- if (index >= 0 && index < items.length) { |
- Item item = items.elementAt(index); |
- result.title = item.title; |
- result.done = item.done; |
- result.id = item.id; |
- } |
- } |
- |
- void getItemById(int id, TodoItemBuilder result) { |
- if (_model.todos.containsKey(id)) { |
- Item item = _model.todos[id]; |
- result.id = item.id; |
- result.title = item.title; |
- result.done = item.done; |
- } |
- } |
- |
- int getNoItems() { |
- return _model.todos.values.length; |
- } |
- |
- void deleteItem(int id) { |
- _model.todos.remove(id); |
- } |
-} |