Book Image

Learning Dart, Second Edition - Second Edition

By : Ivo Balbaert
Book Image

Learning Dart, Second Edition - Second Edition

By: Ivo Balbaert

Overview of this book

Table of Contents (18 chapters)
Learning Dart Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

The TodoMVC app


We will now show how the MVC functions in a Dart version of the famous TodoMVC application (http://todomvc.com/), which is used as a standard to compare different web frameworks. This application is developed in spirals in the dartling_todo_mvc project and is built by using the dartling framework for the model. Download the code from https://github.com/dzenanr/dartling_todo_mvc_spirals. In the following screenshot, you will see a glimpse of the end result (spiral 6):

The TodoMVC app

The todo items can be added, edited, marked as complete, and deleted. Overviews of all the tasks, or only the completed or remaining ones can be shown. The user has undo/redo possibilities after making a mistake. Moreover, it is really useful because the data is stored in the local storage (using the JSON format).

Spiral 0 – generating a class model

Spiral 0 does not have any UI; it contains only a simple model with one Task concept and two properties: title and completed. This is designed in Model...