We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need to get the value of value and can change it
The text was updated successfully, but these errors were encountered:
In that case, you'll need to produce a ViewModel that contains two things: 1) The function to dispatch the action 2) The Value from the state.
class ViewModel { bool active; void Function(bool active) onChange; ViewModel(this.active, this.onChange); static ViewModel fromStore(Store<CounterState> store) { return ViewModel( store.state.isSwitchActive, (bool active) => store.dispatch(ToggleSwitchAction(active)) ); } ) /// Widget StoreConnector<CountState, ViewModel>( converter: ViewModel.fromStore, builder: (context, vm) { return Switch( onChanged: vm.onChanged, value: vm.active, ); } )
Sorry, something went wrong.
This solved my problem, thanks
No branches or pull requests
I need to get the value of value and can change it
The text was updated successfully, but these errors were encountered: