flutter_exceptions_redux 0.0.1 copy "flutter_exceptions_redux: ^0.0.1" to clipboard
flutter_exceptions_redux: ^0.0.1 copied to clipboard

outdated

Exception handling state and middleware for redux in Flutter.

example/README.md

To instantiate and add middleware

ExceptionRedux<AppState> exceptionRedux = ExceptionRedux(
    exceptionHandler: (e) => print(e),
    exceptionHistorySize: 10,
store = Store<AppState>(
    middleware: exceptionRedux.createExceptionMiddleware()
      ..addAll(appMiddleware()),
  );

To add to app state:

class AppState {
  ...
  ExceptionState exceptionState;
  ...

  AppState(
    ...
    this.exceptionState,
    ...
  );

  AppState copyWith({
    ...
    ExceptionState exceptionState,
    ...
  }){
    return AppState(
      ...
      exceptionState: exceptionState ?? this.exceptionState,
      ...
    );
  }

  factory AppState.initial(){
    return AppState(
      ...
      exceptionState: ExceptionState.initial(),
      ...
    );
  }
}

To add the reducer:

AppState appReducer(AppState state, action) {
  return AppState(
    ...
    exceptionState: exceptionReducers(state.exceptionState, action),
    ...
  );
}
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Exception handling state and middleware for redux in Flutter.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, flutter_redux, json_annotation, json_serializable, redux

More

Packages that depend on flutter_exceptions_redux