Skip to content

Releases: vandadnp/flutter-tips-and-tricks

375 - Canonicalized Maps in Dart

30 Dec 07:29
cdc7891
Compare
Choose a tag to compare

Canonicalized maps in Dart are maps where for each key, you can calculate a unique value and should two keys get the same unique value, the last one always wins. Here is an example of how this can be useful => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/canonicalized-maps-in-dart/canonicalized-maps-in-dart.md

374 - Extending Functions in Flutter

29 Dec 05:21
de6cbdb
Compare
Choose a tag to compare

If you can turn a function into a data type, then you can extend it. This example shows how helpful this can be =>

https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/extending-functions-in-flutter/extending-functions-in-flutter.md

373 - Stream Timeout Between Events in Flutter

01 Dec 05:36
5512e1e
Compare
Choose a tag to compare

In order to make sure your stream produces an element every N-seconds, you can take advantage of this useful Stream transformer in Flutter / Dart => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/stream-timeout-between-events-in-flutter/stream-timeout-between-events-in-flutter.md

372 - Dart Object Description Using Reflection

26 Nov 06:44
b4afbb0
Compare
Choose a tag to compare

371 - Unwrapping Multiple Optionals in Flutter and Dart

24 Nov 05:17
d712e1f
Compare
Choose a tag to compare

If you have multipel optional values which are needed for a single operation, you will need to check all of them for null and then perform your operation on them if all are non-null. Using this function you can simplify that task => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/unwrapping-multiple-optionals-in-flutter-and-dart/unwrapping-multiple-optionals-in-flutter-and-dart.md

370 - SafeList in Flutter and Dart

20 Nov 04:38
7db6313
Compare
Choose a tag to compare

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

369 - Optional Iterable First Element in Dart

16 Nov 05:27
b0bbdd2
Compare
Choose a tag to compare

368 - Finding and Converting JSON Values in Dart

15 Nov 05:19
dcddbc9
Compare
Choose a tag to compare

Use this extension to find a key in a JSON Map object, and should it exist AND its value be of a given type, then you can convert it to another data-type all within the same operation => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/finding-and-converting-json-values-in-dart/finding-and-converting-json-values-in-dart.md

367 - Colorful Logs in Flutter

13 Nov 06:00
d187fd6
Compare
Choose a tag to compare

Use this extension on Object? in order to log any sort of value to the console and distinguish true null values from others => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/colorful-logs-in-flutter/colorful-logs-in-flutter.md

366 - Prefer Iterable in Flutter

13 Nov 03:55
7ff42e6
Compare
Choose a tag to compare

Iterables allow lazy evaluation of collection items in Flutter and are the preferred way of iterating over otherwise-heavy collections. Here is an example why they are important to use => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/prefer-iterable-in-flutter/prefer-iterable-in-flutter.md