Client for https://github.com/hobroker/thyn
assets/icons
pubspec.yaml
IconsConstants
with the icon name and path
static final newIcon = 'assets/icons/new-icon.png';
SquareIcon
class NewIcon extends SquareIcon {
@override
String get iconPath => IconsConstants.newIcon;
}
Connector
widgetstate
and dispatch
Connector(
converter: (state, dispatch) => _ViewModel(
count: getCount(state),
onClick: () => dispatch(SomeAction()),
),
builder: (context, vm) {
return RaisedButton(
child: Text('Count: ${vm.count}'),
onPressed: vm.onClick,
);
},
)
state
Connector.state(
converter: getCount,
builder: (context, count) {
return Text('Count: ${count}');
},
)
dispatch
Connector.dispatch(
converter: (dispatch) => () => dispatch(SomeAction()),
builder: (context, onClick) {
return RaisedButton(
child: Text('Something'),
onPressed: onClick,
);
},
)