google / google/tuple.dart

Compatibility with json_serializable

Open
#19 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Dart
Stars
195
Forks
25
PR merge metrics
No merged PRs in 30d

Description

Hi, thank you for your work on `tuple`!
Is there a recommended way to use `tuple` together with `json_serializable`?

For example, if I want to automatically serialize a class that looks like this:
```dart
@JsonSerializable(nullable: false)
class Person {
final String firstName;
final String lastName;
final Tuple2 myTuple;

Person({this.firstName, this.lastName, this.myTuple});

factory Person.fromJson(Map json) => _$PersonFromJson(json);
Map toJson() => _$PersonToJson(this);
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.