Skip to content

Commit

Permalink
Fixing nullable fields and converters (#624)
Browse files Browse the repository at this point in the history
* Fixing nullable fields and converters

* Bump version

* Fix version
  • Loading branch information
MDikkii authored Nov 13, 2023
1 parent 7af0a31 commit ded2d5d
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import "package:cloud_firestore/cloud_firestore.dart";
import "package:json_annotation/json_annotation.dart";

class DocumentReferenceConverter
implements JsonConverter<DocumentReference, dynamic> {
implements JsonConverter<DocumentReference, Object> {
const DocumentReferenceConverter();

@override
DocumentReference fromJson(dynamic json) => json as DocumentReference;

@override
dynamic toJson(DocumentReference documentReference) => documentReference;
Object toJson(DocumentReference documentReference) => documentReference;
}
8 changes: 4 additions & 4 deletions recipients_app/lib/core/helpers/timestamp_converter.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import "package:cloud_firestore/cloud_firestore.dart";
import "package:json_annotation/json_annotation.dart";

class TimestampConverter implements JsonConverter<Timestamp?, dynamic> {
class TimestampConverter implements JsonConverter<Timestamp, Object> {
const TimestampConverter();

@override
Timestamp? fromJson(dynamic json) {
return json as Timestamp?;
Timestamp fromJson(dynamic json) {
return json as Timestamp;
}

@override
dynamic toJson(Timestamp? object) {
Object toJson(Timestamp object) {
return object;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 13 additions & 9 deletions recipients_app/lib/data/models/recipient.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 20 additions & 4 deletions recipients_app/lib/data/models/survey/survey.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion recipients_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: app
description: Social Income App

publish_to: "none"
version: 1.1.8+22
version: 1.1.8+23

environment:
sdk: ">=3.1.0 <4.0.0"
Expand Down

0 comments on commit ded2d5d

Please sign in to comment.