Skip to content

Instantly share code, notes, and snippets.

@harshsoni1110
Created June 17, 2020 12:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshsoni1110/f9d3c4110f16172c16a05eb8f6baa0f2 to your computer and use it in GitHub Desktop.
Save harshsoni1110/f9d3c4110f16172c16a05eb8f6baa0f2 to your computer and use it in GitHub Desktop.
part 'notification.g.dart';
abstract class Notification
implements Built<Notification, NotificationBuilder> {
Notification._();
factory Notification([updates(NotificationBuilder b)]) = _$Notification;
@nullable
String get notificationType;
@nullable
int get notificationId;
@nullable
String get notificationTitle;
@nullable
String get notificationBody;
String toJson() {
return json.encode(serializers.serializeWith(Notification.serializer, this));
}
static Notification fromJson(String jsonString) {
return serializers.deserializeWith(
Notification.serializer, json.decode(jsonString));
}
static Serializer<Notification> get serializer => _$notificationSerializer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment