O'Reilly logo

Learning Dart by Ivo Balbaert, Dzenan Ridjanovic

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Initializing the Travel Impressions model with Data

After the model is designed (refer the Spiral 4 of the Travel Impression Model figure) and its code is generated, the model is initialized with some basic data starting with its entries. This is done in the lib/travel/impressions/init.dart file.

initTravelImpressions(var entries) {
  _initCountries(entries);
  _initTravelers(entries);
}

We will start with creating a country and some of its places, together with web links, from the entries parameter.

_initCountries(var entries) {
var countries = entries.countries;
var country = new Country(countries.concept);
  country.code = ‘BA’;
  country.name = ‘Bosnia and Herzegovina’;
  countries.add(country);

In the Country concept of the graphical model, there is no ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required