How to Cancel HTTP Requests with CancelToken and Riverpod

You can use CancelToken to stop unnecessary data fetches when users navigate away or to implement "cancel" buttons in your Flutter apps. https://codewithandrea.com/tips/dio-cancel-token-riverpod/

Created 8mo | Jul 11, 2024, 3:40:04 PM


Login to add comment

Other posts in this group

Wildcard Variables in Dart 3.7

Since Dart 3.7, the _ character is a wildcard variable and you can use it more than once in your code, without causing name collisions. https://codewithandrea.com/tips/wildcard-variables-dart-3-7/

Feb 14, 2025, 9:10:07 AM | Code with Andrea
New Formatting Style in Dart 3.7

Dart 3.7 introduces a new formatter that automatically adds or removes trailing commas, based on the max line length. https://codewithandrea.com/tips/new-formatting-style-dart-3-7/

Feb 14, 2025, 9:10:06 AM | Code with Andrea
There's a New Formatting Style in Dart 3.7 (Here's What It Means for You)

Dart 3.7 introduces a new formatter that changes how your Flutter code is formatted. Learn what’s new and how to prepare your codebase. https://codewithandrea.com/articles/new-formatting-style-dart-3-

Feb 13, 2025, 2:40:02 PM | Code with Andrea
Wildcard Variables in Dart 3.7

Since Dart 3.7, the _ character is a wildcard variable and you can use it more than once in your code, without causing name collisions. https://codewithandrea.com/tips/wildcard-variables-dart-3.7/

Feb 13, 2025, 9:50:06 AM | Code with Andrea
Hotkeys with CallbackShortcuts

The CallbackShortcuts widget makes it easy to add keyboard shortcuts to your Flutter app. Here's how to use it. https://codewithandrea.com/tips/hotkeys-callback-shortcuts/

Feb 11, 2025, 4:20:04 PM | Code with Andrea
Responsive Split View in Flutter

Here's how to create a responsive split-view widget that works on mobile, desktop and web. https://codewithandrea.com/tips/responsive-split-view-flutter/

Feb 10, 2025, 5:10:06 PM | Code with Andrea
GitHub Self-Hosted Runners

If you're using GitHub Actions for your CI/CD needs, you can setup a self-hosted runner to cut your build times and save money. https://codewithandrea.com/tips/github-self-hosted-runners/

Feb 6, 2025, 11:10:08 AM | Code with Andrea