From the course: Flutter Essential Training: Build for Multiple Platforms
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Exception handling - Flutter Tutorial
From the course: Flutter Essential Training: Build for Multiple Platforms
Exception handling
- [Instructor] When the application is behaving unexpectedly or it's unable to complete its operation because of an undefined result or behavior, it must have thrown an exception. Imagine dividing a number by a string, that operation will not complete and will eventually throw an exception. When an application throws an exception, the developer has to handle that scenario and maybe show a fancy UI or a nice message to the user, letting them know something went wrong, so users can still have a good user experience. This is called exception handing. Only when you were writing the method to fetch the network images here, we wrote a logic to check if the response status code is 200, then we convert this to our Dart model class. Otherwise we throw a custom exception. So note what I said, it is a custom exception. That means there must be some non-custom exceptions that are thrown by Flutter itself, so, by the SDK, and we…
Contents
-
-
-
-
-
-
-
-
Handling async operations in Dart7m 49s
-
(Locked)
Introduction to APIs and exploring Postman.5m 6s
-
(Locked)
Deserialize JSON with the JsonSerializable package7m 48s
-
(Locked)
Integrating a REST API7m 16s
-
(Locked)
FutureBuilder for futures5m 33s
-
(Locked)
Repository pattern2m 1s
-
(Locked)
Grid view in a ModalBottomSheet9m 46s
-
(Locked)
Showing the selected image in ChatInput9m 48s
-
(Locked)
Exception handling6m 27s
-
(Locked)
Creating rounded UI elements9m 37s
-
-
-