We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
The idea is to have a way to find undefined state
Something like this:
typedef BunnyRecord = PartialRecord<Bunny>; // allows 0 fields in Record class Bunny { final bool isCute; final String? name; Bunny copyWith( BunnyRecord fields) { return Bunny( isCute: fields.hasPropertyDefined(BunnyRecord.properties.isCute) ? fields.isCute : this.isCute, name: fields.hasPropertyDefined(BunnyRecord.properties.name) ? fields.name : this.name, ); } }
Admitedly this #140 is be a better solution in the case of copy with but not in other cases like serialization
final a = jsonEncode(<BunnyRecord>(isCute: true)); // {'isCute': true } final b = jsonEncode(<BunnyRecord>(isCute: true, name: null)); // {'isCute': true, 'name' : null }
The difference between a and b here becomes apparent when you send the json serialization as a database entry update.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
The idea is to have a way to find undefined state
Something like this:
Admitedly this #140 is be a better solution in the case of copy with but not in other cases like serialization
The difference between a and b here becomes apparent when you send the json serialization as a database entry update.
The text was updated successfully, but these errors were encountered: