-
Book Overview & Buying
-
Table Of Contents
Mastering DART
By :
Runtime faults can and do occur during the execution of a Dart program. We can split all faults into two types:
There is always some confusion on deciding when to use each kind of fault, but you will be given several general rules to make your life a bit easier. All your decisions will be based on the simple principle of recoverability. If your code generates a fault that can reasonably be recovered from, use exceptions. Conversely, if the code generates a fault that cannot be recovered from, or where continuing the execution would do more harm, use errors.
Let's take a look at each of them in detail.
An error occurs if your code has programming errors that should be fixed by the programmer. Let's take a look at the following main function:
main() {
// Fixed length list
List list = new List(5);
// Fill list with values
for (int i = 0; i < 10; i++) {
list[i] = i;
}
print('Result is ${list}');
}We created an...
Change the font size
Change margin width
Change background colour