Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add an integration test for a writeable field w/ @jsonkey(ignore: true)
  • Loading branch information
kevmoo committed Mar 30, 2018
commit b8ae6eafbccb2ab9cf29160725218437b7d83ebe
3 changes: 3 additions & 0 deletions json_serializable/test/test_files/json_test_example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class Order extends Object with _$OrderSerializerMixin {

int get price => items.fold(0, (total, item) => item.price + total);

@JsonKey(ignore: true)
bool shouldBeCached;

Order(this.category, [Iterable<Item> items])
: this.items = new UnmodifiableListView<Item>(
new List<Item>.unmodifiable(items ?? const <Item>[]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class Order extends Object with _$OrderSerializerMixin {

int get price => items.fold(0, (total, item) => item.price + total);

@JsonKey(ignore: true)
bool shouldBeCached;

Order(this.category, [Iterable<Item> items])
: this.items = new UnmodifiableListView<Item>(
new List<Item>.unmodifiable(items ?? const <Item>[]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class Order extends Object with _$OrderSerializerMixin {

int get price => items.fold(0, (total, item) => item.price + total);

@JsonKey(ignore: true)
bool shouldBeCached;

Order(this.category, [Iterable<Item> items])
: this.items = new UnmodifiableListView<Item>(
new List<Item>.unmodifiable(items ?? const <Item>[]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ class Order extends Object with _$OrderSerializerMixin {

int get price => items.fold(0, (total, item) => item.price + total);

@JsonKey(ignore: true)
bool shouldBeCached;

Order(this.category, [Iterable<Item> items])
: this.items = new UnmodifiableListView<Item>(
new List<Item>.unmodifiable(items ?? const <Item>[]));
Expand Down