SupporterGqlRepository class Null safety

Inheritance

Constructors

SupporterGqlRepository(GraphQLClient graphQLClient, Logger? logger)

Properties

graphQLClient GraphQLClient
finalinherited
hashCode int
The hash code for this object.
read-onlyinherited
logger Logger?
finalinherited
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
supporterUpdateStream Stream<StreamUpdate<Supporter>>
read-only

Methods

createSupporter({required String firebaseUid}) Future<Supporter?>
Creates a new supporter in the backend and returns the current instance. If a supporter already exists, returns the existing instance. The supporter is referenced by its Firebase uid. Throws an exception if an error occurred.
deleteProfile() Future<bool>
Deletes our user profile in the backend Returns true on success, false on error.
inherited
deleteSupporter({required Supporter supporter}) Future<bool>
dispose() Future<void>
fetchUserId(String firebaseUid) Future<String?>
Utility function that fetches a user's ID based on a given patient instance. This is required because Strapi does not support direct access to the underlying User instance by a where clause. This method can be removed as soon as Strapi exposes a custom resolver to store the unified data structure. Returns null if the user instance could not be found.
inherited
getSupporter({String? firebaseUid, String? supporterId}) Future<Supporter?>
Retrieves a supporter instance either by its Firebase uid or instance id. Returns null if supporter does not exist Throws an exception if an error occurred.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
refresh({required String supporterId}) Future<Supporter?>
Retrieves the current supporter instance from the backend and publishes it. Returns the Supporter instance on success or null on error.
removePatient({required Patient patient}) Future<Supporter?>
Removes patient from the list of patients from the currently logged in supporter. Returns a new Supporter instance (and publishes it) if successful, otherwise returns null.
setAvatar({required Supporter supporter, required MediaAsset asset}) Future<Supporter?>
Sets the referenced asset as patient avatar. The asset already needs to be present in the CMS and must not be a local asset. When done, causes the repository to emit an updated supporter instance with the avatar referenced as remote URL.
setFcmToken({required Supporter supporter, required String token}) Future<bool>
setInterests({required Supporter supporter, required BuiltSet<LocalizedType<Interest>> interests}) Future<Supporter?>
setUserAvatar({required User user, required MediaAsset asset}) Future<bool>
Sets the referenced asset as avatar. The asset needs to be present in the CMS already. INTERNAL USE ONLY
inherited
setUserFcmToken({required User user, required String token}) Future<bool>
Updates the Firebase Cloud Messaging token for user. Returns true on success and false on error.
inherited
setUserInterests({required User user, required BuiltSet<LocalizedType<Interest>> interests}) Future<bool>
inherited
toString() String
A string representation of this object.
inherited
updateProfile(Supporter supporter) Future<Supporter?>
Updates the supporter's profile data in the database, which is essentially all personal information except for linked data (such as patients).
updateUserProfile(User user) Future<bool>
Updates the patient or supporter's profile data in the database, which is essentially all personal information except for linked data (such as supporters, interests, conditions). INTERNAL USE ONLY
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited