Super Secret Bug Trap For Flutter

Fred Grott
Geek Culture
Published in
4 min readAug 16, 2021

--

Part of Dart’s power is moving the run-time checks to a better place for performance in compiling, so we get this nice fast hot-loading flutter. That also is part of the devOPS work you must do because they, whoops, moved it to you doing it! Let me show you how to set up a good group of coding styles to act as a manual run time check sieve to prevent errors.

Background

Dart and the Flutter SDK teams moved most run-time checks to static checking to speed up hot-reloads. To assist in semi-automated run-time check before the compile, they expanded the lints plugins. There are some tricks to move from using the previous third-party lint plugins to flutter_lints and dart lints.

Let me show you how to use the flutter lints plugin.

Flutter Lints

Previously you specified the core.yaml part of lints, now we specify the flutter lints plugin, and it automatically picks up the core list of lints.

Your pubspec after project creation:

--

--