Repository navigation
Read the home widget JSON spec with the shared SpecJsonReader - #4
Merged
Merged
Conversation
The spec reader had its own copy of the reader the layout JSON and the Live Activity package already share. It now uses SpecJsonReader; errors are rethrown as HomeWidgetJsonException with the same path and message. A new test pins the message and path of every kind of invalid input, and the generated files and the JSON round trip match v0.3.0 byte for byte. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sbis04
approved these changes
Nov 30, 2026
sbis04
left a comment
Collaborator
There was a problem hiding this comment.
LGTM.
Checked:
test/json_errors_test.dartrun against main'sjson.dart: all 24 pass, so paths and messages are unchanged.- Files generated from
example/widgets.jsonand from a probe spec (countdowns, fill/fixed images,\rtext): identical on main and on this branch. dart testanddart analyze --fatal-infosclean.
This was referenced Nov 30, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
homeWidgetAppFromJsonhad its own copy of the small JSON reader that the layout JSON andflutterflow_live_activityalready share (SpecJsonReaderinflutterflow_native_layout). It now uses the shared one, which removes about 90 lines of duplicated reader code.No behaviour change:
HomeWidgetJsonExceptionis still thrown, with the same path and message and the sametoString().test/json_errors_test.dartpins the path and message of 24 kinds of invalid input (spec, widget, value, layout size, layout, refresh, configuration). The pins were captured on v0.3.0 and pass unchanged.example/widgets.jsonand from a spec that also hasrefreshandconfigurationare byte-identical to v0.3.0, as is the JSON round trip.dart analyze --fatal-infosanddart formatare clean.CHANGELOG: one line under Unreleased.
🤖 Generated with Claude Code