flutter_exceptions_redux 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 59

flutter_exceptions_redux #

Provides redux components to catch exceptions thrown in other middleware, storing it in a dedicated exception state.

Installing #

Usage #

Import the package:

import 'package:flutter_exceptions_redux/flutter_exceptions_redux.dart';

Change Log #

All notable changes to the "flutter_exceptions_redux" package will be documented in this file.

Unreleased #

[0.0.3] - 2020-04-04 #

Add stacktrace to exception callback, allow for non-Exception-children to be caught

[0.0.2] - 2020-03-28 #

Fix library exports

[0.0.1] - 2020-03-25 #

Initial release

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),
    ...
  );
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_exceptions_redux: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_exceptions_redux/redux/flutter_exceptions_redux.dart';
import 'package:flutter_exceptions_redux/redux/src/exception_actions.dart';
import 'package:flutter_exceptions_redux/redux/src/exception_reducer.dart';
import 'package:flutter_exceptions_redux/redux/src/exception_redux.dart';
import 'package:flutter_exceptions_redux/redux/src/exception_state.dart';
import 'package:flutter_exceptions_redux/redux/src/exception_state.g.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
23
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
59
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package not compatible with SDK dart

because of import path [flutter_exceptions_redux] that is in a package requiring null.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
flutter_redux >=0.6.0 <1.0.0 0.6.0
json_annotation >=3.0.1 <4.0.0 3.0.1
json_serializable >=3.2.5 <4.0.0 3.3.0
redux >=4.0.0 <5.0.0 4.0.0
Transitive dependencies
_fe_analyzer_shared 5.0.0
analyzer 0.39.11
args 1.6.0
async 2.4.1
build 1.3.0
build_config 0.4.2
charcode 1.1.3
checked_yaml 1.0.2
collection 1.14.12 1.14.13
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
dart_style 1.3.6
glob 1.2.0
html 0.14.0+3
js 0.6.2
logging 0.11.4
meta 1.1.8
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
path 1.7.0
pedantic 1.9.0 1.9.1
pub_semver 1.4.4
pubspec_parse 0.1.5
sky_engine 0.0.99
source_gen 0.9.5
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6 1.2.0
vector_math 2.0.8
watcher 0.9.7+15
yaml 2.2.1
Dev dependencies
build_runner >=1.8.0 <2.0.0
flutter_test