Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support handling classDecl fromJson(String s) in JsonDecodable #56665

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

morlay
Copy link

@morlay morlay commented Sep 7, 2024

To support usage like

@JsonCodable()
class Account {
    AccountType accountType
}

class AccountType {
  static const USER = AccountType("USER");
  static const AGENT = AccountType("AGENT");

  const AccountType(this.value);

  final String value;

  factory AccountType.fromJson(String value) {
    return AccountType(value);
  }

  String toJson() {
    return value;
  }
}

Copy link

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/383930

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

Copy link

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/384161

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

@jakemac53
Copy link
Contributor

Reviewed at the Gerrit CL, https://dart-review.googlesource.com/c/sdk/+/384161

@mit-mit
Copy link
Member

mit-mit commented Sep 24, 2024

Hi @morlay are you still working on this? If so, please respond in the Gerrit link.

@morlay
Copy link
Author

morlay commented Sep 26, 2024

Hi @morlay are you still working on this? If so, please respond in the Gerrit link.

Sorry. I have network issue to access googlesource.
Could you help to take over this PR?

Copy link

https://dart-review.googlesource.com/c/sdk/+/384161 has been updated with the latest commits from this pull request.

1 similar comment
Copy link

https://dart-review.googlesource.com/c/sdk/+/384161 has been updated with the latest commits from this pull request.

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