In this spiral, we will read all our Bank Account data from the local storage and display the numbers in a dropdown list. Upon selection, all details of the bank account are shown in a table. This is how our page looks, at the start, upon opening the selection list:
In this spiral, we will let the code construct the web page:
void main() {
readLocalStorage(); (1)
constructPage(); (2)
sel.onChange.listen(showAccount); (3)
}
In line (1)
, the account numbers are read from local storage, extracted, and put into a list:
readLocalStorage() { account_nos = []; for (var key in window.localStorage.keys) { account_nos.add(key.substring(12)); // extract account number } }
The method in line (2)
calls two other methods, constructSelect
(line (4)
) and constructTable
(line...