Proper Error Handling in Flutter & Dart (#1 - Principles)
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- 📗 Learn from the written tutorial & get the code 👇👇
resocoder.com/...
🎯 The biggest Flutter conference in Europe:
fluttereurope.dev
📧 Get Flutter news 📰 and resources:
👉 flutter.education
👨💻 Do you write good code? Find out now!
resocoder.com/...
As much as we'd all like to close our eyes and pretend that errors don't exist, we still have to deal with exceptions on a daily basis. Modern languages, including Dart, support exception throwing and catching. However, if you've developed apps for some time you may have become frustrated with this special flow of errors in the program. Is there a way to return errors just like you return regular values while keeping the code maintainable?
This two-part tutorial series will show you how to deal with errors properly. In the first part, you're going to learn the best practices of classic error handling, using try-catch blocks. The second part will introduce powerful concepts from functional programming that will make handling errors even more streamlined.
Go to my website for more information, code examples, and articles:
● resocoder.com
Follow me on social media:
● / resocoder
● / resocoder
● / resocoder
dude you are a genius. I have never seen anyone teach those things. Thanks alot man
Thanks Reso Coder!! I got my error handling working using your video and GetX package. You are awesome!!!
Thank you. I need to see this type of solution without state management
Thank you for the tutorial, it helped me a lot!!
Thank you so much for this tutorial. It helped me a lot 🙂
28:30 "Your memory is unreliable"
So true 😪
🤣🤣🤣
He is great!
thank you so much
Great tutorial! Thnxz!
Would have been nice to cover HTTP errors that doesn't throw but return a body with status code not 200. Do you throw in the Try block? What do you throw exactly?
Is there a tutorial you did that shows what VS Code plugins do you use? xD
they are really helpful!
can you update the TDD series
Is it a bad practice to return a Future.error with our custom message instead of a Failure object ?
well I am thinking about a use case where you have let's say a couple of errors from the server, so you would've written some int that would be error code as well as the message, so I would want the entire object so I don't have to go through the message to see what it contains so I can decide what message user should see.
Thanks Reso. You are handling specific exceptions. What about handling the other exceptions? Is the strategy in the above examples to let the App crash and show the default error widget. Please clarify.
Do anyone the extension to show those pretty arrows?
How can i user error handling with Riverpod and Riverpod(ChangeNotifierProvider) ?
Which extension you are using for dart code coloring???
Hehe, it's literally called dartcode.org
how do you add emoji in code? is that a package?
Those are just regular emoji Unicode characters 🖥 🖱 👨💻
Is it possible to use the error as a trigger? I want to use the HttpExeption (401) as a trigger to display a bottomSheet, so the user knows to login
Please could you add timestamps.
How to make indicator rulers, like the one you have in your vscode? Is there any plugin or setting to do that?
go in the settings and enable the Dart:Preview Flutter Ui Guides option.
Hi brother please a complete video on square inapp payments please
Do you reuse your own videos too? 😁😁