Skip to content

370 - SafeList in Flutter and Dart

Compare
Choose a tag to compare
@vandadnp vandadnp released this 20 Nov 04:38
· 20 commits to main since this release
7db6313

Dart's List leaves a lot to be desired from the default implementation. For instance if you read the first element of an empty list you get an exception. Rust and Swift have optionality baked into their lists so you receive optional values instead of exceptions. You can create your own lists in Dart though to circumvent some of these shortcomings. Here is an example => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/safelist-in-flutter-and-dart/safelist-in-flutter-and-dart.md