async_redux_core 1.4.1
async_redux_core: ^1.4.1 copied to clipboard
Dart-only core package for the Async Redux state management, the easy and powerful version of Redux.
async_redux_core #
This is the core Dart-only package for the async_redux package.
In your Flutter app: #
-
Do NOT include this core package directly.
Instead, go to the async_redux package which already exports this core code, plus provides Flutter related code.
In your Dart server or Dart-only code: #
-
For the moment, this Dart-only package simply contains the
UserException
class, and nothing more.-
If you are creating code for a Dart server (backend) like Serverpod, or Celest, or developing some other Dart-only package that does not depend on Flutter, then you can use this package directly:
import 'package:async_redux_core/async_redux_core.dart';
Note: When using Serverpod or Celest, you can throw
UserException
in your backend code, and that exception will automatically be thrown in the frontend. As long as the Serverpod or Celest cloud function is called inside redux actions, Async Redux will display the exception message to the user in a dialog (or other UI element that you can customize). This can also be used with package i18n_extension_core to make sure the error message gets translated to the user's language. For example:UserException('The password you typed is invalid'.i18n);
in the backend, will reach the frontend already translated asUserException('La contraseña que ingresaste no es válida')
if the user device is in Spanish.Note: For this to work in Serverpod, after you import
async_redux_core
in thepubspec.yaml
file of the server project, you must add theUserException
class to yourgenerator.yaml
file, in itsextraClasses
section:type: server client_package_path: ../my_client server_test_tools_path: test/integration/test_tools modules: serverpod_auth: nickname: auth extraClasses: - package:async_redux_core/async_redux_core.dart:UserException
-
Documentation #
Go to async_redux to read the docs.
By Marcelo Glasberg #
glasberg.dev
github.com/marcglasberg
linkedin.com/in/marcglasberg/
twitter.com/glasbergmarcelo
stackoverflow.com/users/3411681/marcg
medium.com/@marcglasberg
My article in the official Flutter documentation:
The Flutter packages I've authored:
- async_redux
- provider_for_redux
- i18n_extension
- align_positioned
- network_to_file_image
- image_pixels
- matrix4_transform
- back_button_interceptor
- indexed_list_view
- animated_size_and_fade
- assorted_layout_widgets
- weak_map
- themed
- bdd_framework
- tiktoken_tokenizer_gpt4o_o1
My Medium Articles: