simplified code across the app and consolidated duplicated helpers

This commit is contained in:
2026-09-27 17:29:54 +02:00
parent 3e856d0b1c
commit ee1240f71a
155 changed files with 1772 additions and 2546 deletions
+1 -11
View File
@@ -1,4 +1,3 @@
import 'dart:convert';
import 'dart:developer';
import 'package:flutter/foundation.dart';
@@ -25,7 +24,7 @@ class PushTapRouter {
PushActions.handleBackgroundResponse(response);
return;
}
final map = _payloadMap(response.payload);
final map = decodeNotificationPayload(response.payload);
if (map == null) return;
final target = resolvePushTarget(map);
if (target != null) pendingTarget.value = target;
@@ -50,13 +49,4 @@ class PushTapRouter {
log('Reading the notification launch details failed: $e');
}
}
static Map<String, dynamic>? _payloadMap(String? payload) {
if (payload == null || payload.isEmpty) return null;
try {
return jsonDecode(payload) as Map<String, dynamic>;
} on Object {
return null;
}
}
}