redux_prism 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 70

redux_prism #

Build Status Coverage Status pub package

Library used to easily access dispatched actions in a Redux Store. The library defines a pattern to catch new dispatched actions and listen to them in a reactive context. The StorePrism.middleware works like a proxy in the store middlewares and add every new action in the StorePrism.actions stream.

Usage #

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'package:redux/redux.dart';
import 'package:redux_prism/redux_prism.dart';

void main() => runApp(MessageApp());

class MessageApp extends StatelessWidget {
  Widget build(BuildContext context) =>
      store: Store<String>(
        (state, action) => state,
        middleware: [
          // register StorePrism "proxy" middleware
      child: MaterialApp(
        title: 'Redux Prism',
        home: MessagePage()

class MessageAction {
  final String message;


  String toString() => 'MessageAction { message: $message }';

class MessagePage extends StatefulWidget {
  _MessagePageState createState() => _MessagePageState();

class _MessagePageState extends State<MessagePage> {
  final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
  final TextEditingController _messageController = TextEditingController();
  // used to cancel the subscription, when the widget is disposed
  StreamSubscription _actionsSubscription;

  void initState() {
    // listen to the actions stream and show a snackbar when a new action is dispatched
    _actionsSubscription = StorePrism.actions
      .listen((action) {
          .showSnackBar(SnackBar(content: Text(action.toString())));

  void dispose() {
    // ever remember to cancel the listen in widget dispose hook

  Widget build(BuildContext context) =>
      key: _scaffoldKey,
      appBar: AppBar(title: Text('Redux Prism')),
      body: Column(
        children: <Widget>[
            controller: _messageController,
            decoration: InputDecoration(labelText: 'Message')
            builder: (_, store) =>
                onPressed: () =>
                  store.dispatch(MessageAction(message: _messageController.text)),
                child: Text('SEND')

0.1.2 #

Changing to Dart 2 stable version

  • Changing to stable sdk version
  • linking repository tag to every version in

0.1.1 #

Dart 2 compatibility

  • Resolving sdk version

0.1.0 #

Initial version

  • Includes resource to extra power redux with ability to catch actions like a stream
  • Includes StorePrism class to access the actions stream and the injectable middleware responsible for catch and put new actions to the stream


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  redux_prism: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:redux_prism/redux_prism.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Nov 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:redux_prism/redux_prism.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.6.1