Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants