Fix: save all PGN header fields before exporting#2864
Fix: save all PGN header fields before exporting#2864MaartenD wants to merge 5 commits intolichess-org:mainfrom
Conversation
devtools_options.yaml
Outdated
There was a problem hiding this comment.
This file should not be part of this PR. Especially since it does nothing here.
There was a problem hiding this comment.
Sorry, i will take a look and try to adjust the commit. I’m a newbie.
There was a problem hiding this comment.
I hope everything is alright now, if not let me know.
c26d3f4 to
5c87546
Compare
| for (final entry in pgnHeaders.entries) { | ||
| ref | ||
| .read(ctrlProvider.notifier) | ||
| .updatePgnHeader(entry.key, _controllers[entry.key]!.text); |
There was a problem hiding this comment.
I suppose the _controllers[entry.key] cannot be null with the current code, but we should still guard it for the future. So let's add a check to avoid the null error.
There was a problem hiding this comment.
@MaartenD we're still missing the null check here
There was a problem hiding this comment.
@veloce when you scroll down in this list there you would see the null check. I did 2 new comits yesterday evening. I’m sorry if this is not the correct way, it’s a whole new world for me (just an old ABAP programmer ;-) ).
There was a problem hiding this comment.
You added a check line 63.
There's nothing to scroll, I'm just seeing the code. Here, line 171 I see _controller[entry.key]!.text, there is still the non-null assertion operator without null check.
.gitignore
Outdated
|
|
||
| # VS Code | ||
| .vscode/ | ||
|
|
There was a problem hiding this comment.
At some point we may want to include some dev tools prefs for the project so there's no reason to add this for now.
If you are using dev tools options on your own you should use .git/info/exclude to ignore it.
| if (controller != null) { | ||
| ref.read(ctrlProvider.notifier).updatePgnHeader(entry.key, controller.text); | ||
| } | ||
| //ref.read(ctrlProvider.notifier).updatePgnHeader(entry.key, _controllers[entry.key]!.text); |
There was a problem hiding this comment.
You should remove the comment
When pressing the share button while still in the last PGN header field (BlackElo),
the value was not saved. Fixed by reading all controllers before exporting.
Fixes #2850