Exception Handling in Dart — a practical guide to Dart exception handling with clear examples you can reuse in real projects.
Flutter Tutorial Series (22/107). Prefer one article? Read the complete Flutter tutorial.
Short description
Handle async errors too — uncaught Futures become runtime issues.
Try/catch
try {
final n = int.parse('x');
} on FormatException catch (e) {
print(e);
}