notificationNameToUnsubscribeMethod function
Transforms a notification name to its corresponding unsubscribe method name.
For example, 'accountNotifications' becomes 'accountUnsubscribe'.
Implementation
String notificationNameToUnsubscribeMethod(String notificationName) {
return notificationName.replaceAll(RegExp(r'Notifications$'), 'Unsubscribe');
}