Dart & Flutter: Error Handling for Beginners

Published: 16 March 2023
on channel: FlutterED - Learn Flutter and Dart
296
6

In the past several episodes we have been building out a surprisingly fun command-line weather application! Of course, we've made a huge omission in that we haven't spent any time error handling!

In this video you will learn how to handle errors coming from the weather api we are using, as well as have a review of the power of the try catch block.

Make sure to take your Flutter applications to the next level!

00:00 - Introduction
00:36 - Where to Add Error Handling
00:58 - Breaking the App on Purpose
02:28 - Error Handling with the Try Catch Block
04:13 - Handling Non 200 Status Codes
04:52 - Possible Weather API Error Codes
05:27 - Using the Switch Case Block / Statement
06:37 - The Ternary Operator
07:15 - Setting Up Our Error Messages
08:08 - Handling Error 404
10:30 - Handling the 400, 401 and 403 Error/Status Codes
13:03 - Creating a function to generate error messages!
14:52 - Wrap-up and Final Thoughts

Let me know if you have any questions or comments!

Other Important Videos:

Building a Weather App:
   • Building a Weather App in Dart || Lea...  

Refactoring Our Weather App:
   • Building a Weather App in Dart || Ref...  

Unit Testing in Our Weather App:
   • Unit Testing in Dart and Flutter Tuto...  


Watch video Dart & Flutter: Error Handling for Beginners online without registration, duration hours minute second in high quality. This video was added by user FlutterED - Learn Flutter and Dart 16 March 2023, don't forget to share it with your friends and acquaintances, it has been viewed on our site 296 once and liked it 6 people.