Hipster Views

Of the three parts to our minimalist MVC library, the view is easily the most lightweight. Sitting atop the MVC stack, it is allowed to communicate directly with either a model or a collection (both at the same time would be frowned upon). Different views will need to list a collection of models, details of individual models, and update models in response to user input. Thus, the view needs to expose both a collection property and a model property. Since it is a view, it also needs an HTML element to which it can attach itself.

The constructor for such a beast looks like the following.

 
class​ ComicsView {
 
var​ el, model, collection;
 
ComicsView({​this​.el, ​this​.model, ​this​.collection});
 
}

Each of these properties is ...

Get Dart 1 for Everyone now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.