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

Spiral 1 – the power of HTML5 forms


We will make a form that will enable us to create objects for the BankAccount class that we encountered in the code examples in Chapter 1, Dart – A Modern Web Programming Language, and Chapter 2, Getting to Work with Dart. Moreover, we will be able to deposit or withdraw money from these accounts, calculating and adding interest to them.

Note

For the code files of this section, refer to chapter 6\bank_terminal_s1 in the code bundle.

In this first spiral, we will construct our model classes and lay out a form to create and update a bank account using the new specialized input fields of HTML5. The code for the classes is kept in the web\model subfolder and these are a part of our application, as shown in the initial code of bank_terminal_s1.dart:

library bank_terminal;
import 'dart:html';
part 'model/bank_account.dart';
part 'model/person.dart';
void main() {

A bank account is owned by a person, as we see in the starting code of bank_account.dart:

part of bank_terminal...