UserGqlRepository class Null safety
Shared method container for PatientGqlReporitory and
SupporterGqlRepository. Since both repositories access
shared data in the backend, this class contains all
shared methods between the Patient and Supporter repository.
It has no function on its own, so methods here are generally
marked as @protected. Direct calls to this class are discouraged.
Constructors
- UserGqlRepository({required GraphQLClient graphQLClient, required Logger? logger})
Properties
- graphQLClient → GraphQLClient
-
final
- hashCode → int
-
The hash code for this object.
read-onlyinherited
- logger → Logger?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
deleteProfile(
) → Future< bool> -
Deletes our user profile in the backend
Returns
trueon success,falseon error. -
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.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
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
-
setUserFcmToken(
{required User user, required String token}) → Future< bool> -
Updates the Firebase Cloud Messaging
tokenforuser. Returnstrueon success andfalseon error. -
setUserInterests(
{required User user, required BuiltSet< LocalizedType< interests}) → Future<Interest> >bool> -
toString(
) → String -
A string representation of this object.
inherited
-
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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
userGenderToGqlFormat(
UserGender gender) → String?