stacked
stacked copied to clipboard
[bug]: FormView initial values not syncronizing with viewModel
Describe the bug
If you set initial value in a FormTextField the function syncFormWithViewModel doesn't set initial viewModel's values (it only adds listeners)..
To reproduce
@FormView(fields: [
FormTextField(name: 'test', initialValue: 'testvalue'),
])
class Test extends StackedView<TestViewModel> with $Test {
...
@override
void onViewModelReady(viewModel) {
syncFormWithViewModel(viewModel);
print(testController.text); // "testValue"
print(viewModel.testValue); // null (should be "testValue")
}
}
Expected behavior
No response
Screenshots
No response
Additional Context
No response
@miroirstudiosrl a new version of stacked_generator was released, 1.5.0. Can u update the package and see if the issue is fixed?