BUDDHISM AND FLUTTER TOGETHER, IS IT POSSIBLE?

Lucas Matheus Dev
2 min readApr 27, 2022

One of the Buddhist teachings is that we should
calm down and not try to fight our problems, but make friends with them, and can we bring this concept to #programming?

I know what you’re thinking, and no, no
need to hug your #Setup when it gives a red screen lol 😂
😂😂

But what if the problem wasn’t entirely an enemy?

What if he could influence us to look for the #solution instead of just complaining that the ListView doesn’t fit on the screen! (Oops!, I think that was kind of personal 🤭) 😂

It would be amazing if he was a little considerate of us and said, “Hey, this #widget is huge, it doesn’t fit here, how about looking for it on #StackOverFlow? “

And that’s exactly what today’s #tip is about, let’s make friends with that red screen that no one likes, after all, nothing red is good, my bank account says so 😂 😂😂


#flutter has several specific functions for error handling, and the ones we will use are “FlutterError.OnError” and “ErrorWidget.Builder”

FlutterError.OnError : Responsible for handling errors known by flutter, such as an assert() error that does not allow coloring in the container when the BoxDecoration is different from null.

ErrorWidget.Builder : Responsible for build-related errors and tell you what the error screen will look like, and what to do when a build error occurs.

After Implementing our code

This Log :

Because it’s a relatively large code, I’ll leave it on #github if you want to look:

#Repository : https://lnkd.in/gcw9BNA9

Understand more about how to handle errors, access the #Flutter #documentation
https://lnkd.in/gVCBj6ZM

If you found this tip helpful, SHARE AND HELP ANOTHER DEV

--

--