Releases: davidmarne/flutter_built_redux
Releases · davidmarne/flutter_built_redux
0.4.1
0.4.0
-
Breaking changes:
-
Remove state builder generic from StoreConnector
-
Made StoreConnectorState private
-
-
Perform check on storeSub in didChangeDependencies to return early if a subscription to the store has already been created.
-
Raise exceptions if the store found by inheritFromWidgetOfExactType has different generics than the StoreConnector
-
Add unit tests
0.2.0
Rather than implementing StoreConnector & StoreConnectorState you now only have to have to write one object that implements connect & build. The build function also now takes the mapped state value and actions as parameters.
abstract class MyWidgetProps implements Built<MyWidgetProps, MyWidgetPropsBuilder> {
String get propIWantFromMyReduxState;
MyWidgetProps._();
factory MyWidgetProps([updates(MyWidgetPropsBuilder b)]) => _$MyWidgetProps;
}
class MyWidget extends StoreConnector<MyReduxState, MyReduxStateBuilder, MyReduxStateActions,
MyWidgetProps, MyWidgetPropsBuilder> {
MyWidget({Key key}) : super(key: key);
@override
MyWidgetProps connect(Store<MyReduxState, MyReduxStateBuilder, MyReduxStateActions> store) =>
new MyWidgetProps((b) => b..propIWantFromMyReduxState = store.state.someProperty)
MyWidgetState createState() => new MyWidgetState();
}
class MyWidgetState extends StoreConnectorState<MyReduxState, MyReduxStateBuilder,
MyReduxStateActions, MyWidgetProps, MyWidgetPropsBuilder> {
Widget build(BuildContext context) {
return new Center(
child: new Text(state.propIWantFromMyReduxState),
);
}
would now be
abstract class MyWidgetProps implements Built<MyWidgetProps, MyWidgetPropsBuilder> {
String get propIWantFromMyReduxState;
MyWidgetProps._();
factory MyWidgetProps([updates(MyWidgetPropsBuilder b)]) => _$MyWidgetProps;
}
class MyWidget extends StoreConnector<MyReduxState, MyReduxStateBuilder, MyReduxStateActions, MyWidgetProps> {
MyWidget({Key key}) : super(key: key);
@override
MyWidgetProps connect(MyReduxState state) =>
new MyWidgetProps((b) => b..propIWantFromMyReduxState = state.someProperty);
Widget build(BuildContext context, MyWidgetProps state, MyReduxStateActions actions) {
return new Center(
child: new Text(state.propIWantFromMyReduxState),
);
}
0.1.0
0.1.0