Skip to content

fix(AlarmModel): correct fromJson initialization (#867)#868

Merged
MarkisDev merged 1 commit intoCCExtractor:mainfrom
dorodb-web22:fix-alarmmodel-fromjson
Apr 19, 2026
Merged

fix(AlarmModel): correct fromJson initialization (#867)#868
MarkisDev merged 1 commit intoCCExtractor:mainfrom
dorodb-web22:fix-alarmmodel-fromjson

Conversation

@dorodb-web22
Copy link
Copy Markdown
Contributor

Description

Description

AlarmModel.fromJson was calling fromMap without using the returned instance, which meant the constructed object was never actually initialized.

since most fields in AlarmModel are declared as late, using fromJson would result in a LateInitializationError if accessed.

This PR updates fromJson to properly delegate to fromMap using a redirecting constructor, ensuring the model is correctly initialized

Proposed Changes

Converted AlarmModel.fromJson to use Dart's redirecting constructor syntax (: this.fromMap(...)) so the instance actually gets initialized with the decoded data.

Fixes #867

Screenshots

N/A - This is a data-layer code fix with no UI changes.

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

@MarkisDev MarkisDev merged commit 1442aaf into CCExtractor:main Apr 19, 2026
1 check passed
NihalDR pushed a commit to NihalDR/ultimate_alarm_clock that referenced this pull request Apr 20, 2026
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.

Bug: AlarmModel.fromJson does not initialize fields

2 participants