ConsoleActionObserver<St> class Null safety

This action-observer will print all actions to the console, with color, like so:

I/flutter (15304): | Action MyAction

This helps with development, so you probably don't want to use it in release mode:

store = Store<AppState>(
   actionObservers: kReleaseMode ? null : [ConsoleActionObserver()],

If you implement the action's toString, you can display more information. For example, suppose a LoginAction which has a username field:

class LoginAction extends ReduxAction {
  final String username;
  String toString() => super.toString() + '(username)';

The above code will print something like this:

I/flutter (15304): | Action LoginAction(user32)




hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
observe(ReduxAction<St> action, int dispatchCount, {required bool ini}) → void
If ini==true this is right before the action is dispatched. If ini==false this is right after the action finishes.
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Properties

color String Function(ReduxAction action)
Callback that chooses the color to print in the console.
read / write


blue → const String
bold → const String
boldItalic → const String
bold + italic
boldItalicOff → const String
boldOff + italicOff
boldOff → const String
dark → const String
green → const String
grey → const String
italic → const String
italicOff → const String
red → const String
reset → const String
reversed → const String
white → const String
yellow → const String