Book Image

Learning Dart

Book Image

Learning Dart

Overview of this book

Table of Contents (19 chapters)
Learning Dart
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 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 code files of this section, refer to chapter 6\bank_terminal_s1 in the code bundle.

In this first spiral, we 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 subfolder model and these are 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...