Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A setter for widget element visibility

  • Loading branch information...
commit 2f94f6a6b119a8fb1c2149f83117e1f846ec2deb 1 parent 89e8cae
@MathieuLorber authored
View
6 labs/architecture-examples/dart/web/dart/TodoApp.dart
@@ -135,21 +135,21 @@ class TodoApp {
void showAll() {
setSelectedFilter(showAllElement);
for (TodoWidget todoWidget in todoWidgets) {
- todoWidget.setElementVisibility(true);
+ todoWidget.visible = true;
}
}
void showActive() {
setSelectedFilter(showActiveElement);
for (TodoWidget todoWidget in todoWidgets) {
- todoWidget.setElementVisibility(!todoWidget.todo.completed);
+ todoWidget.visible = !todoWidget.todo.completed;
}
}
void showCompleted() {
setSelectedFilter(showCompletedElement);
for (TodoWidget todoWidget in todoWidgets) {
- todoWidget.setElementVisibility(todoWidget.todo.completed);
+ todoWidget.visible = todoWidget.todo.completed;
}
}
View
2  labs/architecture-examples/dart/web/dart/TodoWidget.dart
@@ -70,7 +70,7 @@ class TodoWidget {
return element;
}
- void setElementVisibility(bool visible) {
+ void set visible(bool visible) {
if(visible) {
element.style.display = 'block';
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.