Skip to content

fix #3#9

Open
paraflu wants to merge 4 commits intoSanjaySodani:masterfrom
paraflu:develop
Open

fix #3#9
paraflu wants to merge 4 commits intoSanjaySodani:masterfrom
paraflu:develop

Conversation

@paraflu
Copy link
Copy Markdown

@paraflu paraflu commented Sep 13, 2024

I've overrided the didUpdateWidget and seem work.

@override
  void didUpdateWidget(covariant oldWidget) {
    print("didUpdateWidget json ${widget.json}");
    print("didUpdateWidget data: $_data");
    _data = jsonDecode(widget.json);
    super.didUpdateWidget(oldWidget);
  }

@paraflu paraflu changed the title Develop fix #3 Sep 13, 2024
@henry-hoang-91
Copy link
Copy Markdown

It only works if edit mode is tree, for support text mode you must update also value in _controller :

_controller.text = _stringifyData(_data, 0, true);

completed code:

@override
  void didUpdateWidget(covariant oldWidget) {
    print("didUpdateWidget json ${widget.json}");
    print("didUpdateWidget data: $_data");
    _data = jsonDecode(widget.json);
    _controller.text = _stringifyData(_data, 0, true);
    super.didUpdateWidget(oldWidget);
  }

@Leozin777
Copy link
Copy Markdown

this fix go to next version ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants