feat: Improve notifications, add donation button, improved asn form field

This commit is contained in:
Anton Stubenbord
2023-03-06 22:21:14 +01:00
parent bd891a8658
commit 1172e54199
37 changed files with 985 additions and 305 deletions

View File

@@ -0,0 +1,25 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:paperless_mobile/features/notifications/models/notification_actions.dart';
import 'package:paperless_mobile/features/notifications/models/notification_payloads/notification_tap/notification_tap_response_payload.dart';
import 'package:paperless_mobile/features/notifications/models/notification_payloads/notification_tap/open_downloaded_document_payload.dart';
class NotificationTapResponsePayloadConverter
implements
JsonConverter<NotificationTapResponsePayload, Map<String, dynamic>> {
const NotificationTapResponsePayloadConverter();
@override
NotificationTapResponsePayload fromJson(Map<String, dynamic> json) {
final type = NotificationResponseOpenAction.values.byName(json['type']);
switch (type) {
case NotificationResponseOpenAction.openDownloadedDocumentPath:
return OpenDownloadedDocumentPayload.fromJson(
json,
);
}
}
@override
Map<String, dynamic> toJson(NotificationTapResponsePayload object) {
return object.toJson();
}
}