Flutter Tips And Tricks Versions Save

A Collection of Flutter and Dart Tips and Tricks

365

1 year ago

Use a Stream transformer to send a value down your stream in case of an exception/error. Here is an example of us recovering a stream with the value of "Baz" upon error https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/recovering-stream-errors-in-flutter/recovering-stream-errors-in-flutter.md

364

1 year ago

Using the .onDispose callback of a StreamProvider's ref in Riverpod you can take care of disposal of your StreamController => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/riverpod-streamprovider-disposal/riverpod-streamprovider-disposal.md

363

1 year ago

Using a Stack together with 2 Text widgets you can render a stroke around your texts. Check this handy tip out => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/figma-text-strokes-in-flutter/figma-text-strokes-in-flutter.md

362

1 year ago

If you want to link to an application that is in the App Store or Google Play Store, you need to have one native and one non-native link. The native link for iOS is used when the device running your app is an iOS device and non native iOS link gets opened if your Flutter app is running on an Android device but is trying to open a link to App Store for an iOS app. The same thing is true for Android devices. With this approach, you can have one UniversalApp that solves this for you in one easy to use class => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/universal-app-links-in-flutter/universal-app-links-in-flutter.md

361

1 year ago

360

1 year ago

Learn how to use the identical() function in Dart to compare if two instances of an object point to the same object in memory. Read the tip here => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/identical-objects-in-dart/identical-objects-in-dart.md

359

1 year ago

358

1 year ago

Just like how we presented futures in the previous tip, by implementing a present() function on AsyncSnapshot, you can easily make your Stream instances presentable in a reusable-way. The same AsyncSnapshot extension is used for presenting futures and streams. Let me show you how => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/presenting-streams-in-flutter/presenting-streams-in-flutter.md

357

1 year ago

By implementing a present() function on AsyncSnapshot, you can easily make your Future instances presentable in a reusable-way. Let me show you how => https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/presenting-futures-in-flutter/presenting-futures-in-flutter.md

356

1 year ago

You can use this trick to absorb errors that are thrown down a stream. Your stream will then simply close when an exception is detected. https://github.com/vandadnp/flutter-tips-and-tricks/blob/main/tipsandtricks/absorb-stream-errors-in-flutter/absorb-stream-errors-in-flutter.md