Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lib/flutter_built_redux.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ class _StoreConnectorState<StoreState, Actions extends ReduxActions, LocalState>
@override
Widget build(BuildContext context) =>
widget.build(context, _state, _store.actions as Actions);

@mustCallSuper
@protected
void didUpdateWidget(StoreConnector oldWidget) {
super.didUpdateWidget(oldWidget);
final newState = widget.connect(_store.state as StoreState);
if (_state != newState) {
setState(() {
_state = newState;
});
}
}
}

/// [ReduxProvider] provides access to the redux store to descendant widgets.
Expand Down