Member-only story

How To Use Lints In Flutter

Andrew Zuo
6 min readNov 13, 2021

--

Photo by Miltiadis Fragkidis on Unsplash

I recently wrote an article called ‘My #1 Problem With Dart’:

So my #1 problem is you can run futures without awaiting them. And this leads to countless bugs.

But it was pointed out in that article’s comments there is actually a linter rule that prevents it. It’s called unawaited futures.

And it solves this entire issue. It’s a little embarrassing, really. Now that entire article is obsolete. Although I suspect people can still get value out of it as I added a note about the linter in the introduction.

But I wanted to write this article for people that are not aware of lints. Because it’s completely possible even a relatively experienced Flutter developer does not know about lints.

Which is a shame because out of the box Flutter does a lot of weird stuff. Like you can make a function that returns something without actually returning something. I mean with null safety it’s a little better but you can still do it. And, of course, unawaited futures.

What Are Lints

--

--

Written by Andrew Zuo

Join me on my language learning journey with Litany, a smarter SRS language learning app. Available on iOS apple.co/3rZyh9B and Android bit.ly/38qt9xW

No responses yet

Write a response