I recently started a series of daily tweets about easy ways to improve your Dart & Flutter code. I called this Easy Wins.
To make these easier to find, I'm sharing 7 tips every week here on my website.
Entire series here:
- Dart & Flutter Easy Wins 1-7
- Dart & Flutter Easy Wins 8-14
- Dart & Flutter Easy Wins 15-21
- Dart & Flutter Easy Wins 22-28
- Dart & Flutter Easy Wins 29-35
- Dart & Flutter Easy Wins 36-42
29. When EXTENDING classes, all ABSTRACT methods MUST be overridden & other methods CAN be overridden. When IMPLEMENTING classes, ALL methods MUST be overridden.
30. Need to iterate through a map in a null-safe manner? Use `.entries`:
31. Need different implementations for web and native platforms? Use conditional imports.
More info here: Conditionally importing and exporting library files
32. Need to declare a function type with generics? Use a typedef:
33. Need to work with *computed* variables? Use getters and setters.
34. Need to return a Future that returns immediately? Use `Future.value`.
35. Want to force a delay before executing some code? Use `Future.delayed`.
More tips coming next week. Subscribe via RSS for updates!
Happy coding!