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

Added copy constructor to model generator (non-private-fields) #48

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

Conversation

andhieka
Copy link

@andhieka andhieka commented Jan 8, 2020

Create copy constructor to help users who want to use generated models
as immutable value types (copying object instead of directly modifying
variables).

Create copy constructor to help users who want to use generated models
as immutable value types (copying object instead of directly modifying
variables).
@andhieka andhieka changed the title Added copy constructor to model generator (non-private-fields) #42 Added copy constructor to model generator (non-private-fields) Jan 8, 2020
@andhieka andhieka changed the title #42 Added copy constructor to model generator (non-private-fields) Added copy constructor to model generator (non-private-fields) Jan 8, 2020
@andhieka
Copy link
Author

andhieka commented Jan 8, 2020

This PR would partially fulfil the request in #42 as this adds copyWithUpdate.

Caveat
This PR does not change behaviour when user uses "private fields" mode

Demo
You can try it on my github pages

Example usage of copy constructor
See in DartPad

@CpdnCristiano
Copy link

good job can i use on my project?

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.

None yet

2 participants