IdpProvider class

Encapsulates IDP-Providers to log into firebase with.

The IdpProvider class provides various factory constructors for the supported login providers used by FirebaseAuth.signInWithIdp(). The currently supported providers are:

If you want to use a provider other then the ones specified above, you can use IdpProvider.custom() to create a custom provider instance.

Annotations
  • @freezed

Constructors

IdpProvider.custom({required String providerId, @Default(<String, dynamic>{}) Map<String, dynamic> parameters})
Create an IDP-Instance for any provider not explicitly supported.
const
factory
IdpProvider.facebook(String accessToken)
Create an IDP-Instance for facebook.com.
const
factory
IdpProvider.google(String idToken)
Create an IDP-Instance for google.com.
const
factory
IdpProvider.twitter({required String accessToken, required String oauthTokenSecret})
Create an IDP-Instance for twitter.com.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
Returns the identifier of this provider.
no setter
postBody String
Generates a HTTP-POST body to be used by the REST-API.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

map<TResult extends Object?>({required TResult google(_GoogleIdpProvider value), required TResult facebook(_FacebookIdpProvider value), required TResult twitter(_TwitterIdpProvider value), required TResult custom(_CustomIdpProvider value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult? google(_GoogleIdpProvider value)?, TResult? facebook(_FacebookIdpProvider value)?, TResult? twitter(_TwitterIdpProvider value)?, TResult? custom(_CustomIdpProvider value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult google(_GoogleIdpProvider value)?, TResult facebook(_FacebookIdpProvider value)?, TResult twitter(_TwitterIdpProvider value)?, TResult custom(_CustomIdpProvider value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult google(String idToken)?, TResult facebook(String accessToken)?, TResult twitter(String accessToken, String oauthTokenSecret)?, TResult custom(String providerId, Map<String, dynamic> parameters)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult google(String idToken), required TResult facebook(String accessToken), required TResult twitter(String accessToken, String oauthTokenSecret), required TResult custom(String providerId, Map<String, dynamic> parameters)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? google(String idToken)?, TResult? facebook(String accessToken)?, TResult? twitter(String accessToken, String oauthTokenSecret)?, TResult? custom(String providerId, Map<String, dynamic> parameters)?}) → TResult?
inherited

Operators

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