stacked icon indicating copy to clipboard operation
stacked copied to clipboard

[bug]: FormView initial values not syncronizing with viewModel

Open miroirstudiosrl opened this issue 2 years ago • 1 comments

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 avatar Jul 26 '23 10:07 miroirstudiosrl

@miroirstudiosrl a new version of stacked_generator was released, 1.5.0. Can u update the package and see if the issue is fixed?

ferrarafer avatar Aug 01 '23 02:08 ferrarafer