Compare commits

...

24 Commits

Author SHA1 Message Date
3f1c93c35f
feat(authentication): add mock + local storage 2023-03-10 15:07:49 +01:00
fcc439a311
docs(authentication): update example with multiple data sources 2023-03-08 12:57:56 +01:00
5a3eeed7b5
refactor(authentication)!: split data sources (cache, session, external) 2023-03-08 12:57:24 +01:00
0e5e2403ce
style(authentication): dart format + add some docs 2023-03-08 12:55:30 +01:00
76a655ac63
fix(authentication): make sur access token is available on every steps 2023-02-08 16:09:26 +01:00
b458f8c0c8
feat(authentication): remove session wrapper for AuthenticationSession 2023-02-08 13:37:52 +01:00
2e5aafdb5a
docs(authentication): add full dartdoc 2023-02-07 14:55:28 +01:00
fdd020f103
test(authentication): update tests 2023-02-07 14:55:28 +01:00
918215b5b8
docs: roolback and remove wiki 2023-02-07 14:55:28 +01:00
b68e46c622
docs(authentication): add wiki script 2023-02-07 14:55:28 +01:00
305cddea19
docs(authentication): update example 2023-02-07 14:55:28 +01:00
50886d97b3
feat(authentication): add account edit cubit 2023-02-07 14:55:28 +01:00
692c255a19
feat(authentication): add custom routine, and documentation 2023-02-07 14:55:28 +01:00
4dc0b26e95
feat(authentication): add full event support 2023-02-07 14:55:28 +01:00
bf1d8f188f
test(authentication): fix tests 2023-02-07 14:54:39 +01:00
a72babfafe
fix(authentication): anonymous sign in event 2023-02-07 14:54:39 +01:00
830d32152b
refactor(authentication): use custom user changes stream 2023-02-07 14:54:39 +01:00
7f0544d19c
fix(authentication): initialize account stream transformer 2023-02-07 14:54:39 +01:00
c005c3dc43
docs(authentication): update example 2023-02-07 14:54:39 +01:00
97c14c7a99
refactor(authentication)!: use mixins, and remove use of onSignUpSuccess 2023-02-07 14:54:39 +01:00
f37babc084
feat(authentication)!: add event type on auth change 2023-02-07 14:54:38 +01:00
e6c234f0ea
refactor: make signup/in, passwordreset cubit extendable 2023-02-07 14:54:38 +01:00
2088e0e4bc
fix(authentication): stream on null account 2023-02-07 14:54:38 +01:00
1e07b2ed1c
fix(authentication): handle empty provider list (closes #113) 2023-02-07 14:54:38 +01:00
649 changed files with 39368 additions and 2171 deletions

7
.gitignore vendored
View File

@ -13,10 +13,6 @@ build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock
# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# dotenv environment variables file
.env*
@ -38,7 +34,6 @@ doc/api/
### Flutter ###
# Flutter/Dart/Pub related
**/doc/api/
.fvm/
.pub-cache/
.pub/
@ -200,4 +195,4 @@ google-services.json
pubspec_overrides.yaml
# Mason
.mason/
.mason/

View File

@ -23,7 +23,6 @@
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/

View File

@ -1,5 +1,5 @@
<!--
* Copyright (C) 2022 WYATT GROUP
* Copyright (C) 2023 WYATT GROUP
* Please see the AUTHORS file for details.
* This program is free software: you can redistribute it and/or modify
@ -7,7 +7,7 @@
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
@ -19,9 +19,7 @@
# Flutter - Authentication BLoC
<p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis">
<img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" />
</a>
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis"><img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis" /></a>
<img src="https://img.shields.io/badge/SDK-Flutter-blue?style=flat-square" alt="SDK: Flutter" />
</p>
@ -29,37 +27,195 @@ Authentication Bloc for Flutter.
## Features
- Wyatt Architecture
- Entities:
- Account : AccountModel -> Contains account information from provider
- AccountWrapper : AccountWrapperModel -> Contains account and extra data.
- Data Sources:
- Local:
- Cached Authentication Data : AuthenticationCacheDataSourceImpl -> Provides a cache implementation
- Remote:
- Remote Authentication Data : AuthenticationFirebaseDataSourceImpl -> Provides a proxy to FirebaseAuth
- Repositories:
- AuthenticationRepository : AuthenticationRepositoryImpl -> Provides all authentication methods
- Features:
- Authentication:
- AuthenticationBuilder : widget to build reactive view from authentication state
- AuthenticationCubit : tracks every auth changes, have sign out capability.
- SignUp:
- SignUpCubit: implementation of a FormDataCubit from `wyatt_form_bloc` for the sign up
- SignIn:
- SignUpCubit: implementation of a FormDataCubit from `wyatt_form_bloc` for the sign in
- Consistent
* Every class have same naming convention
- Tested
* 🧐 Wyatt Architecture
* 🧱 Entities
- Account -> Contains account information from provider.
- Session -> Contains account and associated data retrieved from an external source.
- AuthenticationChangeEvent -> Describes an event in authentication change (sign in, sign up, sign out, etc...)
- SessionWrapper -> Contains latest authentication change event and session.
* 🔑 Powerful and secured authentication repository
* 🔥 Multiple data sources
- Mock
- Firebase
* 🧊 Cubits, why make it complicated when you can make it simple?
- Goes to the essential.
* 📐 Consistent
- Every class have same naming convention
* 🧪 Tested
* 📚 Documented: [available here](./doc/api/index.md)
## Getting started
Simply add `wyatt_authentication_bloc` in `pubspec.yaml`, then
Simply add `wyatt_authentication_bloc` in `pubspec.yaml` , then
```dart
import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
```
## Usage
### Data source
// TODO
The first step is to provide a data source.
```dart
getIt.registerLazySingleton<AuthenticationRemoteDataSource<int>>(
() => AuthenticationFirebaseDataSourceImpl<int>(
firebaseAuth: FirebaseAuth.instance,
googleSignIn:
GoogleSignIn(clientId: DefaultFirebaseOptions.ios.iosClientId)),
);
```
> Here we use GetIt (see example project)
### Repository
Then you can configure your repository.
```dart
final AuthenticationRepository<int> authenticationRepository = AuthenticationRepositoryImpl(
authenticationRemoteDataSource:
getIt<AuthenticationRemoteDataSource<int>>(),
customPasswordValidator: const CustomPassword.pure(),
extraSignUpInputs: [
FormInput(
AuthFormField.confirmPassword,
const ConfirmedPassword.pure(),
metadata: const FormInputMetadata<void>(export: false),
),
],
);
```
> Here we pass some extra inputs for the sign up, and a custom password validator.
### Cubits
It is necessary to implement each cubit. Don't panic, most of the work is already done 😊 you just have to customize the logic of these.
In each of these cubits it is necessary to overload the various callbacks.
> Here the associated data `Data` is a `int`
#### Authentication
In the authentication are managed, the refresh, the deletion of account or the disconnection.
```dart
class ExampleAuthenticationCubit extends AuthenticationCubit<int> {
ExampleAuthenticationCubit({required super.authenticationRepository});
@override
FutureOrResult<int?> onReauthenticate(Result<Account, AppException> result) async {
// TODO
}
@override
FutureOrResult<int?> onRefresh(Result<Account, AppException> result) {
// TODO
}
@override
FutureOrResult<int?> onSignInFromCache(SessionWrapper<int> wrapper) {
// TODO
}
@override
FutureOrResult<void> onSignOut() {
// TODO
}
@override
FutureOrResult<void> onDelete() {
// TODO
}
}
```
#### Sign Up
```dart
class ExampleSignUpCubit extends SignUpCubit<int> {
ExampleSignUpCubit({
required super.authenticationRepository,
});
@override
FutureOrResult<int?> onSignUpWithEmailAndPassword(Result<Account, AppException> result, WyattForm form) async {
// TODO
}
}
```
#### Sign In
```dart
class ExampleSignInCubit extends SignInCubit<int> {
ExampleSignInCubit({
required super.authenticationRepository,
});
@override
FutureOrResult<int?> onSignInWithEmailAndPassword(Result<Account, AppException> result, WyattForm form) {
// TODO
}
@override
FutureOrResult<int?> onSignInAnonymously(Result<Account, AppException> result, WyattForm form) {
// TODO
}
@override
FutureOrResult<int?> onSignInWithGoogle(Result<Account, AppException> result, WyattForm form) {
// TODO
}
}
```
After setting up all these cubits you can provide them in the application. And that's it!
```dart
BlocProvider<SignUpCubit<int>>(
create: (_) => ExampleSignUpCubit(
authenticationRepository: authenticationRepository,
),
),
BlocProvider<SignInCubit<int>>(
create: (_) => ExampleSignInCubit(
authenticationRepository: authenticationRepository,
),
),
```
### Widgets
Widgets are provided to make your life easier. Starting with the `AuthenticationBuilder` which allows you to build according to the authentication state.
```dart
AuthenticationBuilder<int>(
authenticated: (context, sessionWrapper) => Text(
'Logged as ${sessionWrapper.session?.account.email} | GeneratedId is ${sessionWrapper.session?.data}'),
unauthenticated: (context) =>
const Text('Not logged (unauthenticated)'),
unknown: (context) => const Text('Not logged (unknown)'),
),
```
A `BuildContext` extension is also available to access certain attributes more quickly.
```dart
Text('Home | ${context.account<AuthenticationCubit<int>, int>()?.email}'),
```
Listeners are used to listen to the status of the sign in and sign up forms.
```dart
return SignInListener<int>(
onError: (context, status, errorMessage) => ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(
SnackBar(content: Text(errorMessage ?? 'Sign In Failure')),
),
child: ...
);
```

View File

@ -0,0 +1,6 @@
# 404
Oops, something's gone wrong :-(
You've tried to visit a page that doesn't exist. Luckily this site has other
[pages](index.md).

View File

@ -0,0 +1 @@
[]

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,214 @@
# wyatt_authentication_bloc - Dart API docs
<!--
* Copyright (C) 2023 WYATT GROUP
* Please see the AUTHORS file for details.
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<h1 id="flutter---authentication-bloc">Flutter - Authentication BLoC</h1><p align="left">
<a href="https://git.wyatt-studio.fr/Wyatt-FOSS/wyatt-packages/src/branch/master/packages/wyatt_analysis"><img src="https://img.shields.io/badge/Style-Wyatt%20Analysis-blue.svg?style=flat-square" alt="Style: Wyatt Analysis"></a>
<img src="https://img.shields.io/badge/SDK-Flutter-blue?style=flat-square" alt="SDK: Flutter">
</p>
<p>Authentication Bloc for Flutter.</p>
<h2 id="features">Features</h2>
<ul>
<li>🧐 Wyatt Architecture</li>
<li>🧱 Entities
<ul>
<li>Account -&gt; Contains account information from provider.</li>
<li>Session -&gt; Contains account and associated data retrieved from an external source.</li>
<li>AuthenticationChangeEvent -&gt; Describes an event in authentication change (sign in, sign up, sign out, etc...)</li>
<li>SessionWrapper -&gt; Contains latest authentication change event and session.</li>
</ul>
</li>
<li>🔑 Powerful and secured authentication repository</li>
<li>🔥 Multiple data sources
<ul>
<li>Mock</li>
<li>Firebase</li>
</ul>
</li>
<li>🧊 Cubits, why make it complicated when you can make it simple?
<ul>
<li>Goes to the essential.</li>
</ul>
</li>
<li>📐 Consistent
<ul>
<li>Every class have same naming convention</li>
</ul>
</li>
<li>🧪 Tested</li>
<li>📚 Documented: <a href="./doc/api/index.md">available here</a></li>
</ul>
<h2 id="getting-started">Getting started</h2>
<p>Simply add <code>wyatt_authentication_bloc</code> in <code>pubspec.yaml</code> , then</p>
<pre class="language-dart"><code class="language-dart">import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
</code></pre>
<h3 id="data-source">Data source</h3>
<p>The first step is to provide a data source.</p>
<pre class="language-dart"><code class="language-dart">getIt.registerLazySingleton&lt;AuthenticationRemoteDataSource&lt;int&gt;&gt;(
() =&gt; AuthenticationFirebaseDataSourceImpl&lt;int&gt;(
firebaseAuth: FirebaseAuth.instance,
googleSignIn:
GoogleSignIn(clientId: DefaultFirebaseOptions.ios.iosClientId)),
);
</code></pre>
<blockquote>
<p>Here we use GetIt (see example project)</p>
</blockquote>
<h3 id="repository">Repository</h3>
<p>Then you can configure your repository.</p>
<pre class="language-dart"><code class="language-dart">final AuthenticationRepository&lt;int&gt; authenticationRepository = AuthenticationRepositoryImpl(
authenticationRemoteDataSource:
getIt&lt;AuthenticationRemoteDataSource&lt;int&gt;&gt;(),
customPasswordValidator: const CustomPassword.pure(),
extraSignUpInputs: [
FormInput(
AuthFormField.confirmPassword,
const ConfirmedPassword.pure(),
metadata: const FormInputMetadata&lt;void&gt;(export: false),
),
],
);
</code></pre>
<blockquote>
<p>Here we pass some extra inputs for the sign up, and a custom password validator.</p>
</blockquote>
<h3 id="cubits">Cubits</h3>
<p>It is necessary to implement each cubit. Don't panic, most of the work is already done 😊 you just have to customize the logic of these.</p>
<p>In each of these cubits it is necessary to overload the various callbacks.</p>
<blockquote>
<p>Here the associated data <code>Data</code> is a <code>int</code></p>
</blockquote>
<h4 id="authentication">Authentication</h4>
<p>In the authentication are managed, the refresh, the deletion of account or the disconnection.</p>
<pre class="language-dart"><code class="language-dart">class ExampleAuthenticationCubit extends AuthenticationCubit&lt;int&gt; {
ExampleAuthenticationCubit({required super.authenticationRepository});
@override
FutureOrResult&lt;int?&gt; onReauthenticate(Result&lt;Account, AppException&gt; result) async {
// TODO
}
@override
FutureOrResult&lt;int?&gt; onRefresh(Result&lt;Account, AppException&gt; result) {
// TODO
}
@override
FutureOrResult&lt;int?&gt; onSignInFromCache(SessionWrapper&lt;int&gt; wrapper) {
// TODO
}
@override
FutureOrResult&lt;void&gt; onSignOut() {
// TODO
}
@override
FutureOrResult&lt;void&gt; onDelete() {
// TODO
}
}
</code></pre>
<h4 id="sign-up">Sign Up</h4>
<pre class="language-dart"><code class="language-dart">class ExampleSignUpCubit extends SignUpCubit&lt;int&gt; {
ExampleSignUpCubit({
required super.authenticationRepository,
});
@override
FutureOrResult&lt;int?&gt; onSignUpWithEmailAndPassword(Result&lt;Account, AppException&gt; result, WyattForm form) async {
// TODO
}
}
</code></pre>
<h4 id="sign-in">Sign In</h4>
<pre class="language-dart"><code class="language-dart">class ExampleSignInCubit extends SignInCubit&lt;int&gt; {
ExampleSignInCubit({
required super.authenticationRepository,
});
@override
FutureOrResult&lt;int?&gt; onSignInWithEmailAndPassword(Result&lt;Account, AppException&gt; result, WyattForm form) {
// TODO
}
@override
FutureOrResult&lt;int?&gt; onSignInAnonymously(Result&lt;Account, AppException&gt; result, WyattForm form) {
// TODO
}
@override
FutureOrResult&lt;int?&gt; onSignInWithGoogle(Result&lt;Account, AppException&gt; result, WyattForm form) {
// TODO
}
}
</code></pre>
<p>After setting up all these cubits you can provide them in the application. And that's it!</p>
<pre class="language-dart"><code class="language-dart">BlocProvider&lt;SignUpCubit&lt;int&gt;&gt;(
create: (_) =&gt; ExampleSignUpCubit(
authenticationRepository: authenticationRepository,
),
),
BlocProvider&lt;SignInCubit&lt;int&gt;&gt;(
create: (_) =&gt; ExampleSignInCubit(
authenticationRepository: authenticationRepository,
),
),
</code></pre>
<h3 id="widgets">Widgets</h3>
<p>Widgets are provided to make your life easier. Starting with the <code>AuthenticationBuilder</code> which allows you to build according to the authentication state.</p>
<pre class="language-dart"><code class="language-dart">AuthenticationBuilder&lt;int&gt;(
authenticated: (context, sessionWrapper) =&gt; Text(
'Logged as ${sessionWrapper.session?.account.email} | GeneratedId is ${sessionWrapper.session?.data}'),
unauthenticated: (context) =&gt;
const Text('Not logged (unauthenticated)'),
unknown: (context) =&gt; const Text('Not logged (unknown)'),
),
</code></pre>
<p>A <code>BuildContext</code> extension is also available to access certain attributes more quickly.</p>
<pre class="language-dart"><code class="language-dart">Text('Home | ${context.account&lt;AuthenticationCubit&lt;int&gt;, int&gt;()?.email}'),
</code></pre>
<p>Listeners are used to listen to the status of the sign in and sign up forms.</p>
<pre class="language-dart"><code class="language-dart">return SignInListener&lt;int&gt;(
onError: (context, status, errorMessage) =&gt; ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(
SnackBar(content: Text(errorMessage ?? 'Sign In Failure')),
),
child: ...
);
</code></pre>
## Libraries
##### [wyatt_authentication_bloc](wyatt_authentication_bloc/wyatt_authentication_bloc-library.md)
An authentication library for BLoC.

View File

@ -0,0 +1,6 @@
# 404
Oops, something's gone wrong :-(
You've tried to visit a page that doesn't exist. Luckily this site has other
[pages](index.md).

View File

@ -0,0 +1,237 @@
# Account class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Represents a user <a href="../wyatt_authentication_bloc/Account-class.md">Account</a> in the
various identity provisioning systems.</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [Equatable](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable-class.html)
- Account
**Implementers**
- [AccountModel](../wyatt_authentication_bloc/AccountModel-class.md)
## Constructors
[Account](../wyatt_authentication_bloc/Account/Account.md) ({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) id, required [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) isAnonymous, required [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) emailVerified, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) providerId, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? email, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? phoneNumber, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? photoURL, [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? creationTime, [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? lastSignInTime, [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)? isNewUser, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? accessToken, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? refreshToken})
_const_
## Properties
##### [accessToken](../wyatt_authentication_bloc/Account/accessToken.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The user access token
_<span class="feature">final</span>_
##### [creationTime](../wyatt_authentication_bloc/Account/creationTime.md) &#8594; [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)?
Returns the users account creation time.
_<span class="feature">final</span>_
##### [email](../wyatt_authentication_bloc/Account/email.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The users email address.
_<span class="feature">final</span>_
##### [emailVerified](../wyatt_authentication_bloc/Account/emailVerified.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
Returns whether the users email address has been verified.
_<span class="feature">final</span>_
##### [hashCode](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [id](../wyatt_authentication_bloc/Account/id.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
The user's unique ID.
_<span class="feature">final</span>_
##### [isAnonymous](../wyatt_authentication_bloc/Account/isAnonymous.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
Returns whether the user is a anonymous.
_<span class="feature">final</span>_
##### [isNewUser](../wyatt_authentication_bloc/Account/isNewUser.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)?
Whether the user account has been recently created.
_<span class="feature">final</span>_
##### [lastSignInTime](../wyatt_authentication_bloc/Account/lastSignInTime.md) &#8594; [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)?
When the user last signed in as dictated by the server clock.
_<span class="feature">final</span>_
##### [phoneNumber](../wyatt_authentication_bloc/Account/phoneNumber.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
Returns the users phone number.
_<span class="feature">final</span>_
##### [photoURL](../wyatt_authentication_bloc/Account/photoURL.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
Returns a photo URL for the user.
_<span class="feature">final</span>_
##### [props](../wyatt_authentication_bloc/Account/props.md) &#8594; [List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)?>
The list of properties that will be used to determine whether
two instances are equal.
_<span class="feature">read-only</span><span class="feature">override</span>_
##### [providerId](../wyatt_authentication_bloc/Account/providerId.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
The provider ID for the user.
_<span class="feature">final</span>_
##### [refreshToken](../wyatt_authentication_bloc/Account/refreshToken.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The user refresh token
_<span class="feature">final</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [stringify](../wyatt_authentication_bloc/Account/stringify.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
If set to <code>true</code>, the <a href="https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html">toString</a> method will be overridden to output
this instance's <a href="../wyatt_authentication_bloc/Account/props.md">props</a>.
_<span class="feature">read-only</span><span class="feature">override</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,43 @@
# Account constructor
*[<Null safety>](https://dart.dev/null-safety)*
const
Account({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) id, required [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) isAnonymous, required [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) emailVerified, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) providerId, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? email, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? phoneNumber, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? photoURL, [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? creationTime, [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? lastSignInTime, [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)? isNewUser, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? accessToken, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? refreshToken})
## Implementation
```dart
const Account({
required this.id,
required this.isAnonymous,
required this.emailVerified,
required this.providerId,
this.email,
this.phoneNumber,
this.photoURL,
this.creationTime,
this.lastSignInTime,
this.isNewUser,
this.accessToken,
this.refreshToken,
});
```

View File

@ -0,0 +1,34 @@
# accessToken property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? accessToken
_<span class="feature">final</span>_
<p>The user access token</p>
## Implementation
```dart
final String? accessToken;
```

View File

@ -0,0 +1,35 @@
# creationTime property
*[<Null safety>](https://dart.dev/null-safety)*
[DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? creationTime
_<span class="feature">final</span>_
<p>Returns the users account creation time.</p>
<p>When this account was created as dictated by the server clock.</p>
## Implementation
```dart
final DateTime? creationTime;
```

View File

@ -0,0 +1,35 @@
# email property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? email
_<span class="feature">final</span>_
<p>The users email address.</p>
<p>Will be <code>null</code> if signing in anonymously.</p>
## Implementation
```dart
final String? email;
```

View File

@ -0,0 +1,35 @@
# emailVerified property
*[<Null safety>](https://dart.dev/null-safety)*
[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) emailVerified
_<span class="feature">final</span>_
<p>Returns whether the users email address has been verified.</p>
<p>To send a verification email, see <code>SendEmailVerification</code>.</p>
## Implementation
```dart
final bool emailVerified;
```

View File

@ -0,0 +1,34 @@
# id property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) id
_<span class="feature">final</span>_
<p>The user's unique ID.</p>
## Implementation
```dart
final String id;
```

View File

@ -0,0 +1,34 @@
# isAnonymous property
*[<Null safety>](https://dart.dev/null-safety)*
[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) isAnonymous
_<span class="feature">final</span>_
<p>Returns whether the user is a anonymous.</p>
## Implementation
```dart
final bool isAnonymous;
```

View File

@ -0,0 +1,34 @@
# isNewUser property
*[<Null safety>](https://dart.dev/null-safety)*
[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)? isNewUser
_<span class="feature">final</span>_
<p>Whether the user account has been recently created.</p>
## Implementation
```dart
final bool? isNewUser;
```

View File

@ -0,0 +1,34 @@
# lastSignInTime property
*[<Null safety>](https://dart.dev/null-safety)*
[DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)? lastSignInTime
_<span class="feature">final</span>_
<p>When the user last signed in as dictated by the server clock.</p>
## Implementation
```dart
final DateTime? lastSignInTime;
```

View File

@ -0,0 +1,36 @@
# phoneNumber property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? phoneNumber
_<span class="feature">final</span>_
<p>Returns the users phone number.</p>
<p>This property will be <code>null</code> if the user has not signed in or been has
their phone number linked.</p>
## Implementation
```dart
final String? phoneNumber;
```

View File

@ -0,0 +1,36 @@
# photoURL property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? photoURL
_<span class="feature">final</span>_
<p>Returns a photo URL for the user.</p>
<p>This property will be populated if the user has signed in or been linked
with a 3rd party OAuth provider (such as Google).</p>
## Implementation
```dart
final String? photoURL;
```

View File

@ -0,0 +1,55 @@
# props property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)?> props
_<span class="feature">override</span>_
<p>The list of properties that will be used to determine whether
two instances are equal.</p>
## Implementation
```dart
@override
List<Object?> get props => [
id,
isAnonymous,
email,
emailVerified,
phoneNumber,
photoURL,
creationTime,
lastSignInTime,
providerId,
isNewUser,
accessToken,
refreshToken,
];
```

View File

@ -0,0 +1,34 @@
# providerId property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) providerId
_<span class="feature">final</span>_
<p>The provider ID for the user.</p>
## Implementation
```dart
final String providerId;
```

View File

@ -0,0 +1,34 @@
# refreshToken property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? refreshToken
_<span class="feature">final</span>_
<p>The user refresh token</p>
## Implementation
```dart
final String? refreshToken;
```

View File

@ -0,0 +1,47 @@
# stringify property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) stringify
_<span class="feature">override</span>_
<p>If set to <code>true</code>, the <a href="https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html">toString</a> method will be overridden to output
this instance's <a href="../../wyatt_authentication_bloc/Account/props.md">props</a>.</p>
<p>A global default value for <a href="../../wyatt_authentication_bloc/Account/stringify.md">stringify</a> can be set using
<code>EquatableConfig.stringify</code>.</p>
<p>If this instance's <a href="../../wyatt_authentication_bloc/Account/stringify.md">stringify</a> is set to null, the value of
<code>EquatableConfig.stringify</code> will be used instead. This defaults to
<code>false</code>.</p>
## Implementation
```dart
@override
bool get stringify => true;
```

View File

@ -0,0 +1,247 @@
# AccountModel class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Account Model to parse Firebase User data</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [Equatable](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable-class.html)
- [Account](../wyatt_authentication_bloc/Account-class.md)
- AccountModel
## Constructors
[AccountModel.fromFirebaseUser](../wyatt_authentication_bloc/AccountModel/AccountModel.fromFirebaseUser.md) ([User](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/User-class.html)? user, {[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? accessToken})
_factory_
[AccountModel.fromFirebaseUserCredential](../wyatt_authentication_bloc/AccountModel/AccountModel.fromFirebaseUserCredential.md) ([UserCredential](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/UserCredential-class.html)? userCredential)
_factory_
## Properties
##### [accessToken](../wyatt_authentication_bloc/Account/accessToken.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The user access token
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [creationTime](../wyatt_authentication_bloc/Account/creationTime.md) &#8594; [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)?
Returns the users account creation time.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [email](../wyatt_authentication_bloc/Account/email.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The users email address.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [emailVerified](../wyatt_authentication_bloc/Account/emailVerified.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
Returns whether the users email address has been verified.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [hashCode](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [id](../wyatt_authentication_bloc/Account/id.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
The user's unique ID.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [isAnonymous](../wyatt_authentication_bloc/Account/isAnonymous.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
Returns whether the user is a anonymous.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [isNewUser](../wyatt_authentication_bloc/Account/isNewUser.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)?
Whether the user account has been recently created.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [lastSignInTime](../wyatt_authentication_bloc/Account/lastSignInTime.md) &#8594; [DateTime](https://api.flutter.dev/flutter/dart-core/DateTime-class.html)?
When the user last signed in as dictated by the server clock.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [phoneNumber](../wyatt_authentication_bloc/Account/phoneNumber.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
Returns the users phone number.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [photoURL](../wyatt_authentication_bloc/Account/photoURL.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
Returns a photo URL for the user.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [props](../wyatt_authentication_bloc/Account/props.md) &#8594; [List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)?>
The list of properties that will be used to determine whether
two instances are equal.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [providerId](../wyatt_authentication_bloc/Account/providerId.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
The provider ID for the user.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [refreshToken](../wyatt_authentication_bloc/AccountModel/refreshToken.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)?
The user refresh token
_<span class="feature">read-only</span><span class="feature">override</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [stringify](../wyatt_authentication_bloc/Account/stringify.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
If set to <code>true</code>, the <a href="https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html">toString</a> method will be overridden to output
this instance's <a href="../wyatt_authentication_bloc/Account/props.md">props</a>.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [user](../wyatt_authentication_bloc/AccountModel/user.md) &#8594; [User](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/User-class.html)?
_<span class="feature">final</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,51 @@
# AccountModel.fromFirebaseUser constructor
*[<Null safety>](https://dart.dev/null-safety)*
AccountModel.fromFirebaseUser([User](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/User-class.html)? user, {[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? accessToken})
## Implementation
```dart
factory AccountModel.fromFirebaseUser(User? user, {String? accessToken}) {
if (user != null) {
final providerId =
(user.providerData.isEmpty) ? '' : user.providerData.first.providerId;
return AccountModel._(
user: user,
id: user.uid,
emailVerified: user.emailVerified,
isAnonymous: user.isAnonymous,
providerId: providerId,
creationTime: user.metadata.creationTime,
lastSignInTime: user.metadata.lastSignInTime,
isNewUser: false,
email: user.email,
phoneNumber: user.phoneNumber,
photoURL: user.photoURL,
accessToken: accessToken,
);
} else {
throw ModelParsingFailureFirebase('null-user', 'User cannot be null');
}
}
```

View File

@ -0,0 +1,54 @@
# AccountModel.fromFirebaseUserCredential constructor
*[<Null safety>](https://dart.dev/null-safety)*
AccountModel.fromFirebaseUserCredential([UserCredential](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/UserCredential-class.html)? userCredential)
## Implementation
```dart
factory AccountModel.fromFirebaseUserCredential(
UserCredential? userCredential,
) {
final user = userCredential?.user;
if (user != null) {
final providerId =
(user.providerData.isEmpty) ? '' : user.providerData.first.providerId;
return AccountModel._(
user: user,
id: user.uid,
emailVerified: user.emailVerified,
isAnonymous: user.isAnonymous,
providerId: providerId,
creationTime: user.metadata.creationTime,
lastSignInTime: user.metadata.lastSignInTime,
isNewUser: userCredential?.additionalUserInfo?.isNewUser,
email: user.email,
phoneNumber: user.phoneNumber,
photoURL: user.photoURL,
accessToken: userCredential?.credential?.accessToken,
);
} else {
throw ModelParsingFailureFirebase('null-user', 'User cannot be null');
}
}
```

View File

@ -0,0 +1,41 @@
# refreshToken property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? refreshToken
_<span class="feature">override</span>_
<p>The user refresh token</p>
## Implementation
```dart
@override
String? get refreshToken => user?.refreshToken;
```

View File

@ -0,0 +1,33 @@
# user property
*[<Null safety>](https://dart.dev/null-safety)*
[User](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/User-class.html)? user
_<span class="feature">final</span>_
## Implementation
```dart
final User? user;
```

View File

@ -0,0 +1,137 @@
# ApplyActionCodeFailureFirebase class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Thrown if during the apply action code process if a failure occurs.</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [AuthenticationFailureInterface](../wyatt_authentication_bloc/AuthenticationFailureInterface-class.md)
- [ApplyActionCodeFailureInterface](../wyatt_authentication_bloc/ApplyActionCodeFailureInterface-class.md)
- ApplyActionCodeFailureFirebase
## Constructors
[ApplyActionCodeFailureFirebase](../wyatt_authentication_bloc/ApplyActionCodeFailureFirebase/ApplyActionCodeFailureFirebase.md) ([[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? msg])
[ApplyActionCodeFailureFirebase.fromCode](../wyatt_authentication_bloc/ApplyActionCodeFailureFirebase/ApplyActionCodeFailureFirebase.fromCode.md) ([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
## Properties
##### [code](../wyatt_authentication_bloc/AuthenticationFailureInterface/code.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span><span class="feature">inherited</span>_
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [message](../wyatt_authentication_bloc/AuthenticationFailureInterface/message.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [msg](../wyatt_authentication_bloc/AuthenticationFailureInterface/msg.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](../wyatt_authentication_bloc/AuthenticationFailureInterface/toString.md)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,49 @@
# ApplyActionCodeFailureFirebase.fromCode constructor
*[<Null safety>](https://dart.dev/null-safety)*
ApplyActionCodeFailureFirebase.fromCode([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
## Implementation
```dart
ApplyActionCodeFailureFirebase.fromCode(String code) : super.fromCode(code) {
switch (code) {
case 'expired-action-code':
msg = 'Action code has expired.';
break;
case 'invalid-action-code':
msg = 'Action code is invalid.';
break;
case 'user-disabled':
msg = 'This user has been disabled. Please contact support for help.';
break;
case 'user-not-found':
msg = 'Email is not found, please create an account.';
break;
default:
this.code = 'unknown';
msg = 'An unknown error occurred.';
}
}
```

View File

@ -0,0 +1,31 @@
# ApplyActionCodeFailureFirebase constructor
*[<Null safety>](https://dart.dev/null-safety)*
ApplyActionCodeFailureFirebase([[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? msg])
## Implementation
```dart
ApplyActionCodeFailureFirebase([String? code, String? msg])
: super(code ?? 'unknown', msg ?? 'An unknown error occurred.');
```

View File

@ -0,0 +1,139 @@
# ApplyActionCodeFailureInterface class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Thrown if during the apply action code process if a failure occurs.</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [AuthenticationFailureInterface](../wyatt_authentication_bloc/AuthenticationFailureInterface-class.md)
- ApplyActionCodeFailureInterface
**Implementers**
- [ApplyActionCodeFailureFirebase](../wyatt_authentication_bloc/ApplyActionCodeFailureFirebase-class.md)
## Constructors
[ApplyActionCodeFailureInterface](../wyatt_authentication_bloc/ApplyActionCodeFailureInterface/ApplyActionCodeFailureInterface.md) ([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html) msg)
Thrown if during the apply action code process if a failure occurs.
[ApplyActionCodeFailureInterface.fromCode](../wyatt_authentication_bloc/ApplyActionCodeFailureInterface/ApplyActionCodeFailureInterface.fromCode.md) ([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
Thrown if during the apply action code process if a failure occurs.
## Properties
##### [code](../wyatt_authentication_bloc/AuthenticationFailureInterface/code.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span><span class="feature">inherited</span>_
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [message](../wyatt_authentication_bloc/AuthenticationFailureInterface/message.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [msg](../wyatt_authentication_bloc/AuthenticationFailureInterface/msg.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](../wyatt_authentication_bloc/AuthenticationFailureInterface/toString.md)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,31 @@
# ApplyActionCodeFailureInterface.fromCode constructor
*[<Null safety>](https://dart.dev/null-safety)*
ApplyActionCodeFailureInterface.fromCode([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
<p>Thrown if during the apply action code process if a failure occurs.</p>
## Implementation
```dart
ApplyActionCodeFailureInterface.fromCode(super.code) : super.fromCode();
```

View File

@ -0,0 +1,31 @@
# ApplyActionCodeFailureInterface constructor
*[<Null safety>](https://dart.dev/null-safety)*
ApplyActionCodeFailureInterface([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html) msg)
<p>Thrown if during the apply action code process if a failure occurs.</p>
## Implementation
```dart
ApplyActionCodeFailureInterface(super.code, super.msg);
```

View File

@ -0,0 +1,122 @@
# AuthFormField class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Default authentication form fields name</p>
## Constructors
[AuthFormField](../wyatt_authentication_bloc/AuthFormField/AuthFormField.md) ()
## Properties
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](https://api.flutter.dev/flutter/dart-core/Object/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_
## Constants
##### [confirmPassword](../wyatt_authentication_bloc/AuthFormField/confirmPassword-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Confirm Password field: <code>wyattConfirmPasswordField</code>
##### [email](../wyatt_authentication_bloc/AuthFormField/email-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Email field: <code>wyattEmailField</code>
##### [password](../wyatt_authentication_bloc/AuthFormField/password-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Password field: <code>wyattPasswordField</code>

View File

@ -0,0 +1,25 @@
# AuthFormField constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthFormField()

View File

@ -0,0 +1,34 @@
# confirmPassword constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const confirmPassword
<p>Confirm Password field: <code>wyattConfirmPasswordField</code></p>
## Implementation
```dart
static const confirmPassword = 'wyattConfirmPasswordField';
```

View File

@ -0,0 +1,34 @@
# email constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const email
<p>Email field: <code>wyattEmailField</code></p>
## Implementation
```dart
static const email = 'wyattEmailField';
```

View File

@ -0,0 +1,34 @@
# password constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const password
<p>Password field: <code>wyattPasswordField</code></p>
## Implementation
```dart
static const password = 'wyattPasswordField';
```

View File

@ -0,0 +1,131 @@
# AuthFormName class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Default authentication form name</p>
## Constructors
[AuthFormName](../wyatt_authentication_bloc/AuthFormName/AuthFormName.md) ()
## Properties
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](https://api.flutter.dev/flutter/dart-core/Object/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_
## Constants
##### [editAccountForm](../wyatt_authentication_bloc/AuthFormName/editAccountForm-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Edit account form: <code>wyattEditAccountForm</code>
##### [passwordResetForm](../wyatt_authentication_bloc/AuthFormName/passwordResetForm-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Password reset form: <code>wyattPasswordResetForm</code>
##### [signInForm](../wyatt_authentication_bloc/AuthFormName/signInForm-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Sign In form: <code>wyattSignInForm</code>
##### [signUpForm](../wyatt_authentication_bloc/AuthFormName/signUpForm-constant.md) const [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Sign Up form: <code>wyattSignUpForm</code>

View File

@ -0,0 +1,25 @@
# AuthFormName constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthFormName()

View File

@ -0,0 +1,34 @@
# editAccountForm constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const editAccountForm
<p>Edit account form: <code>wyattEditAccountForm</code></p>
## Implementation
```dart
static const String editAccountForm = 'wyattEditAccountForm';
```

View File

@ -0,0 +1,34 @@
# passwordResetForm constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const passwordResetForm
<p>Password reset form: <code>wyattPasswordResetForm</code></p>
## Implementation
```dart
static const String passwordResetForm = 'wyattPasswordResetForm';
```

View File

@ -0,0 +1,34 @@
# signInForm constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const signInForm
<p>Sign In form: <code>wyattSignInForm</code></p>
## Implementation
```dart
static const String signInForm = 'wyattSignInForm';
```

View File

@ -0,0 +1,34 @@
# signUpForm constant
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) const signUpForm
<p>Sign Up form: <code>wyattSignUpForm</code></p>
## Implementation
```dart
static const String signUpForm = 'wyattSignUpForm';
```

View File

@ -0,0 +1,216 @@
# AuthenticationBuilder&lt;Data> class
*[<Null safety>](https://dart.dev/null-safety)*
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [DiagnosticableTree](https://api.flutter.dev/flutter/foundation/DiagnosticableTree-class.html)
- [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html)
- [StatelessWidget](https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html)
- AuthenticationBuilder
## Constructors
[AuthenticationBuilder](../wyatt_authentication_bloc/AuthenticationBuilder/AuthenticationBuilder.md) ({required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) authenticated([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context, [SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> sessionWrapper), required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) unauthenticated([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context), required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) unknown([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context), [Key](https://api.flutter.dev/flutter/foundation/Key-class.html)? key})
_const_
## Properties
##### [authenticated](../wyatt_authentication_bloc/AuthenticationBuilder/authenticated.md) &#8594; [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context, [SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> sessionWrapper)
_<span class="feature">final</span>_
##### [hashCode](https://api.flutter.dev/flutter/widgets/Widget/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [key](https://api.flutter.dev/flutter/widgets/Widget/key.html) &#8594; [Key](https://api.flutter.dev/flutter/foundation/Key-class.html)?
Controls how one widget replaces another widget in the tree.
_<span class="feature">final</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [unauthenticated](../wyatt_authentication_bloc/AuthenticationBuilder/unauthenticated.md) &#8594; [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context)
_<span class="feature">final</span>_
##### [unknown](../wyatt_authentication_bloc/AuthenticationBuilder/unknown.md) &#8594; [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context)
_<span class="feature">final</span>_
## Methods
##### [build](../wyatt_authentication_bloc/AuthenticationBuilder/build.md)([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context) [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html)
Describes the part of the user interface represented by this widget.
_<span class="feature">override</span>_
##### [createElement](https://api.flutter.dev/flutter/widgets/StatelessWidget/createElement.html)() [StatelessElement](https://api.flutter.dev/flutter/widgets/StatelessElement-class.html)
Creates a <a href="https://api.flutter.dev/flutter/widgets/StatelessElement-class.html">StatelessElement</a> to manage this widget's location in the tree.
_<span class="feature">inherited</span>_
##### [debugDescribeChildren](https://api.flutter.dev/flutter/foundation/DiagnosticableTree/debugDescribeChildren.html)() [List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[DiagnosticsNode](https://api.flutter.dev/flutter/foundation/DiagnosticsNode-class.html)>
Returns a list of <code>DiagnosticsNode</code> objects describing this node's
children.
_<span class="feature">inherited</span>_
##### [debugFillProperties](https://api.flutter.dev/flutter/widgets/Widget/debugFillProperties.html)([DiagnosticPropertiesBuilder](https://api.flutter.dev/flutter/foundation/DiagnosticPropertiesBuilder-class.html) properties) void
Add additional properties associated with the node.
_<span class="feature">inherited</span>_
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toDiagnosticsNode](https://api.flutter.dev/flutter/foundation/DiagnosticableTree/toDiagnosticsNode.html)({[String](https://api.flutter.dev/flutter/dart-core/String-class.html)? name, [DiagnosticsTreeStyle](https://api.flutter.dev/flutter/foundation/DiagnosticsTreeStyle.html)? style}) [DiagnosticsNode](https://api.flutter.dev/flutter/foundation/DiagnosticsNode-class.html)
Returns a debug representation of the object that is used by debugging
tools and by <a href="https://api.flutter.dev/flutter/foundation/DiagnosticsNode/toStringDeep.html">DiagnosticsNode.toStringDeep</a>.
_<span class="feature">inherited</span>_
##### [toString](https://api.flutter.dev/flutter/foundation/Diagnosticable/toString.html)({[DiagnosticLevel](https://api.flutter.dev/flutter/foundation/DiagnosticLevel.html) minLevel = DiagnosticLevel.info}) [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
##### [toStringDeep](https://api.flutter.dev/flutter/foundation/DiagnosticableTree/toStringDeep.html)({[String](https://api.flutter.dev/flutter/dart-core/String-class.html) prefixLineOne = '', [String](https://api.flutter.dev/flutter/dart-core/String-class.html)? prefixOtherLines, [DiagnosticLevel](https://api.flutter.dev/flutter/foundation/DiagnosticLevel.html) minLevel = DiagnosticLevel.debug}) [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Returns a string representation of this node and its descendants.
_<span class="feature">inherited</span>_
##### [toStringShallow](https://api.flutter.dev/flutter/foundation/DiagnosticableTree/toStringShallow.html)({[String](https://api.flutter.dev/flutter/dart-core/String-class.html) joiner = ', ', [DiagnosticLevel](https://api.flutter.dev/flutter/foundation/DiagnosticLevel.html) minLevel = DiagnosticLevel.debug}) [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
Returns a one-line detailed description of the object.
_<span class="feature">inherited</span>_
##### [toStringShort](https://api.flutter.dev/flutter/widgets/Widget/toStringShort.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A short, textual description of this widget.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/widgets/Widget/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,35 @@
# AuthenticationBuilder&lt;Data> constructor
*[<Null safety>](https://dart.dev/null-safety)*
const
AuthenticationBuilder&lt;Data>({required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) authenticated([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context, [SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> sessionWrapper), required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) unauthenticated([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context), required [Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) unknown([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context), [Key](https://api.flutter.dev/flutter/foundation/Key-class.html)? key})
## Implementation
```dart
const AuthenticationBuilder({
required this.authenticated,
required this.unauthenticated,
required this.unknown,
super.key,
});
```

View File

@ -0,0 +1,36 @@
# authenticated property
*[<Null safety>](https://dart.dev/null-safety)*
[Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context, [SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> sessionWrapper) authenticated
_<span class="feature">final</span>_
## Implementation
```dart
final Widget Function(
BuildContext context,
SessionWrapper<Data> sessionWrapper,
) authenticated;
```

View File

@ -0,0 +1,85 @@
# build method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) build
([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context)
_<span class="feature">override</span>_
<p>Describes the part of the user interface represented by this widget.</p>
<p>The framework calls this method when this widget is inserted into the tree
in a given <a href="https://api.flutter.dev/flutter/widgets/BuildContext-class.html">BuildContext</a> and when the dependencies of this widget change
(e.g., an <a href="https://api.flutter.dev/flutter/widgets/InheritedWidget-class.html">InheritedWidget</a> referenced by this widget changes). This
method can potentially be called in every frame and should not have any side
effects beyond building a widget.</p>
<p>The framework replaces the subtree below this widget with the widget
returned by this method, either by updating the existing subtree or by
removing the subtree and inflating a new subtree, depending on whether the
widget returned by this method can update the root of the existing
subtree, as determined by calling <a href="https://api.flutter.dev/flutter/widgets/Widget/canUpdate.html">Widget.canUpdate</a>.</p>
<p>Typically implementations return a newly created constellation of widgets
that are configured with information from this widget's constructor and
from the given <a href="https://api.flutter.dev/flutter/widgets/BuildContext-class.html">BuildContext</a>.</p>
<p>The given <a href="https://api.flutter.dev/flutter/widgets/BuildContext-class.html">BuildContext</a> contains information about the location in the
tree at which this widget is being built. For example, the context
provides the set of inherited widgets for this location in the tree. A
given widget might be built with multiple different <a href="https://api.flutter.dev/flutter/widgets/BuildContext-class.html">BuildContext</a>
arguments over time if the widget is moved around the tree or if the
widget is inserted into the tree in multiple places at once.</p>
<p>The implementation of this method must only depend on:</p>
<ul>
<li>the fields of the widget, which themselves must not change over time,
and</li>
<li>any ambient state obtained from the <code>context</code> using
<a href="https://api.flutter.dev/flutter/widgets/BuildContext/dependOnInheritedWidgetOfExactType.html">BuildContext.dependOnInheritedWidgetOfExactType</a>.</li>
</ul>
<p>If a widget's <a href="../../wyatt_authentication_bloc/AuthenticationBuilder/build.md">build</a> method is to depend on anything else, use a
<a href="https://api.flutter.dev/flutter/widgets/StatefulWidget-class.html">StatefulWidget</a> instead.</p>
<p>See also:</p>
<ul>
<li><a href="https://api.flutter.dev/flutter/widgets/StatelessWidget-class.html">StatelessWidget</a>, which contains the discussion on performance considerations.</li>
</ul>
## Implementation
```dart
@override
Widget build(BuildContext context) =>
BlocBuilder<AuthenticationCubit<Data>, AuthenticationState<Data>>(
builder: (context, state) {
if (state.status == AuthenticationStatus.authenticated) {
if (state.wrapper != null) {
return authenticated(context, state.wrapper!);
} else {
return unauthenticated(context);
}
} else if (state.status == AuthenticationStatus.unauthenticated) {
return unauthenticated(context);
} else {
return unknown(context);
}
},
);
```

View File

@ -0,0 +1,33 @@
# unauthenticated property
*[<Null safety>](https://dart.dev/null-safety)*
[Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context) unauthenticated
_<span class="feature">final</span>_
## Implementation
```dart
final Widget Function(BuildContext context) unauthenticated;
```

View File

@ -0,0 +1,33 @@
# unknown property
*[<Null safety>](https://dart.dev/null-safety)*
[Widget](https://api.flutter.dev/flutter/widgets/Widget-class.html) Function([BuildContext](https://api.flutter.dev/flutter/widgets/BuildContext-class.html) context) unknown
_<span class="feature">final</span>_
## Implementation
```dart
final Widget Function(BuildContext context) unknown;
```

View File

@ -0,0 +1,137 @@
# AuthenticationChangeEvent class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Represents an event initiated by a change in
the user's authentication status.</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [Equatable](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable-class.html)
- AuthenticationChangeEvent
**Implementers**
- [DeletedEvent](../wyatt_authentication_bloc/DeletedEvent-class.md)
- [ReauthenticatedEvent](../wyatt_authentication_bloc/ReauthenticatedEvent-class.md)
- [RefreshedEvent](../wyatt_authentication_bloc/RefreshedEvent-class.md)
- [SignedInEvent](../wyatt_authentication_bloc/SignedInEvent-class.md)
- [SignedInFromCacheEvent](../wyatt_authentication_bloc/SignedInFromCacheEvent-class.md)
- [SignedOutEvent](../wyatt_authentication_bloc/SignedOutEvent-class.md)
- [SignedUpEvent](../wyatt_authentication_bloc/SignedUpEvent-class.md)
- [UnknownAuthenticationEvent](../wyatt_authentication_bloc/UnknownAuthenticationEvent-class.md)
- [UpdatedEvent](../wyatt_authentication_bloc/UpdatedEvent-class.md)
## Constructors
[AuthenticationChangeEvent](../wyatt_authentication_bloc/AuthenticationChangeEvent/AuthenticationChangeEvent.md) ()
_const_
## Properties
##### [hashCode](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [props](../wyatt_authentication_bloc/AuthenticationChangeEvent/props.md) &#8594; [List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)?>
The list of properties that will be used to determine whether
two instances are equal.
_<span class="feature">read-only</span><span class="feature">override</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [stringify](../wyatt_authentication_bloc/AuthenticationChangeEvent/stringify.md) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
If set to <code>true</code>, the <a href="https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html">toString</a> method will be overridden to output
this instance's <a href="../wyatt_authentication_bloc/AuthenticationChangeEvent/props.md">props</a>.
_<span class="feature">read-only</span><span class="feature">override</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,30 @@
# AuthenticationChangeEvent constructor
*[<Null safety>](https://dart.dev/null-safety)*
const
AuthenticationChangeEvent()
## Implementation
```dart
const AuthenticationChangeEvent();
```

View File

@ -0,0 +1,42 @@
# props property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[List](https://api.flutter.dev/flutter/dart-core/List-class.html)&lt;[Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)?> props
_<span class="feature">override</span>_
<p>The list of properties that will be used to determine whether
two instances are equal.</p>
## Implementation
```dart
@override
List<Object?> get props => [];
```

View File

@ -0,0 +1,47 @@
# stringify property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html) stringify
_<span class="feature">override</span>_
<p>If set to <code>true</code>, the <a href="https://pub.dev/documentation/equatable/2.0.5/equatable/Equatable/toString.html">toString</a> method will be overridden to output
this instance's <a href="../../wyatt_authentication_bloc/AuthenticationChangeEvent/props.md">props</a>.</p>
<p>A global default value for <a href="../../wyatt_authentication_bloc/AuthenticationChangeEvent/stringify.md">stringify</a> can be set using
<code>EquatableConfig.stringify</code>.</p>
<p>If this instance's <a href="../../wyatt_authentication_bloc/AuthenticationChangeEvent/stringify.md">stringify</a> is set to null, the value of
<code>EquatableConfig.stringify</code> will be used instead. This defaults to
<code>false</code>.</p>
## Implementation
```dart
@override
bool get stringify => true;
```

View File

@ -0,0 +1,292 @@
# AuthenticationCubit&lt;Data> class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Abstract authentication cubit class needs to be implemented in application.</p>
<p>This cubit is in charge of managing the global authentication state of
the application.</p>
<p>Its here you can override every callbacks and add your custom logic.</p>
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [BlocBase](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase-class.html)&lt;[AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data>>
- [Cubit](https://pub.dev/documentation/bloc/8.1.0/bloc/Cubit-class.html)&lt;[AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data>>
- AuthenticationCubit
## Constructors
[AuthenticationCubit](../wyatt_authentication_bloc/AuthenticationCubit/AuthenticationCubit.md) ({required [AuthenticationRepository](../wyatt_authentication_bloc/AuthenticationRepository-class.md)&lt;Data> authenticationRepository})
## Properties
##### [authenticationRepository](../wyatt_authentication_bloc/AuthenticationCubit/authenticationRepository.md) &#8594; [AuthenticationRepository](../wyatt_authentication_bloc/AuthenticationRepository-class.md)&lt;Data>
_<span class="feature">final</span>_
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [isClosed](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/isClosed.html) &#8594; [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
Whether the bloc is closed.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [state](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/state.html) &#8594; [AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data>
The current <a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/state.html">state</a>.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [stream](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/stream.html) &#8594; [Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)&lt;[AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data>>
The current <a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/stream.html">stream</a> of states.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [addError](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/addError.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) error, [[StackTrace](https://api.flutter.dev/flutter/dart-core/StackTrace-class.html)? stackTrace]) void
Reports an <code>error</code> which triggers <a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/onError.html">onError</a> with an optional <a href="https://api.flutter.dev/flutter/dart-core/StackTrace-class.html">StackTrace</a>.
_<span class="feature">inherited</span>_
##### [close](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/close.html)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Closes the instance.
This method should be called when the instance is no longer needed.
Once <a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/close.html">close</a> is called, the instance can no longer be used.
_<span class="feature">inherited</span>_
##### [currentSession](../wyatt_authentication_bloc/AuthenticationCubit/currentSession.md)() [SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data>?
Returns latest session wrapper.
##### [delete](../wyatt_authentication_bloc/AuthenticationCubit/delete.md)() [FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void>
Delete account.
##### [emit](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/emit.html)([AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data> state) void
Updates the <code>state</code> to the provided <code>state</code>.
<a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/emit.html">emit</a> does nothing if the <code>state</code> being emitted
is equal to the current <code>state</code>.
_<span class="feature">inherited</span>_
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [onChange](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/onChange.html)([Change](https://pub.dev/documentation/bloc/8.1.0/bloc/Change-class.html)&lt;[AuthenticationState](../wyatt_authentication_bloc/AuthenticationState-class.md)&lt;Data>> change) void
Called whenever a <code>change</code> occurs with the given <code>change</code>.
A <code>change</code> occurs when a new <code>state</code> is emitted.
<a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/onChange.html">onChange</a> is called before the <code>state</code> of the <code>cubit</code> is updated.
<a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/onChange.html">onChange</a> is a great spot to add logging/analytics for a specific <code>cubit</code>.
_<span class="feature">inherited</span>_
##### [onDelete](../wyatt_authentication_bloc/AuthenticationCubit/onDelete.md)() FutureOrResult&lt;void>
This callback is triggered when the current account is deleted from
the remote.
##### [onError](https://pub.dev/documentation/bloc/8.1.0/bloc/BlocBase/onError.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) error, [StackTrace](https://api.flutter.dev/flutter/dart-core/StackTrace-class.html) stackTrace) void
Called whenever an <code>error</code> occurs and notifies <a href="https://pub.dev/documentation/bloc/8.1.0/bloc/BlocObserver/onError.html">BlocObserver.onError</a>.
_<span class="feature">inherited</span>_
##### [onReauthenticate](../wyatt_authentication_bloc/AuthenticationCubit/onReauthenticate.md)(Result&lt;[Account](../wyatt_authentication_bloc/Account-class.md), AppException> result) FutureOrResult&lt;Data?>
This callback is triggered when the account is re-authenticated
##### [onRefresh](../wyatt_authentication_bloc/AuthenticationCubit/onRefresh.md)(Result&lt;[Account](../wyatt_authentication_bloc/Account-class.md), AppException> result) FutureOrResult&lt;Data?>
This callback is triggered when the account is refreshed.
##### [onSignInFromCache](../wyatt_authentication_bloc/AuthenticationCubit/onSignInFromCache.md)([SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper) FutureOrResult&lt;Data?>
This callback is triggered when the user is automaticcaly logged in from
the cache.
##### [onSignOut](../wyatt_authentication_bloc/AuthenticationCubit/onSignOut.md)() FutureOrResult&lt;void>
This callback is triggered when the user is logged out.
##### [reauthenticate](../wyatt_authentication_bloc/AuthenticationCubit/reauthenticate.md)() [FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void>
Some security-sensitive actions—such as deleting an account,
setting a primary email address, and changing a password—require that
the user has recently signed in.
##### [refresh](../wyatt_authentication_bloc/AuthenticationCubit/refresh.md)() [FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void>
Refreshes the current user, if signed in.
##### [signOut](../wyatt_authentication_bloc/AuthenticationCubit/signOut.md)() [FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void>
Signs out the current user.
It also clears the cache and the associated data.
##### [toString](https://api.flutter.dev/flutter/dart-core/Object/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,34 @@
# AuthenticationCubit&lt;Data> constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthenticationCubit&lt;Data>({required [AuthenticationRepository](../../wyatt_authentication_bloc/AuthenticationRepository-class.md)&lt;Data> authenticationRepository})
## Implementation
```dart
AuthenticationCubit({
required this.authenticationRepository,
}) : super(const AuthenticationState.unknown()) {
_listenForAuthenticationChanges();
}
```

View File

@ -0,0 +1,33 @@
# authenticationRepository property
*[<Null safety>](https://dart.dev/null-safety)*
[AuthenticationRepository](../../wyatt_authentication_bloc/AuthenticationRepository-class.md)&lt;Data> authenticationRepository
_<span class="feature">final</span>_
## Implementation
```dart
final AuthenticationRepository<Data> authenticationRepository;
```

View File

@ -0,0 +1,37 @@
# currentSession method
*[<Null safety>](https://dart.dev/null-safety)*
[SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data>? currentSession
()
<p>Returns latest session wrapper.</p>
<p>Contains latest event and latest session data (account + extra data)</p>
## Implementation
```dart
SessionWrapper<Data>? currentSession() => _latestSession;
```

View File

@ -0,0 +1,44 @@
# delete method
*[<Null safety>](https://dart.dev/null-safety)*
[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> delete
()
<p>Delete account.</p>
<p>Throws a DeleteAccountFailureInterface if
an exception occurs.</p>
## Implementation
```dart
FutureOr<void> delete() async => CustomRoutine<void, void>(
routine: authenticationRepository.delete,
attachedLogic: (routineResult) => onDelete(),
onError: addError,
onSuccess: (result, data) => authenticationRepository
.addSession(SessionWrapper<Data>(event: const DeletedEvent())),
).call();
```

View File

@ -0,0 +1,38 @@
# onDelete method
*[<Null safety>](https://dart.dev/null-safety)*
FutureOrResult&lt;void> onDelete
()
<p>This callback is triggered when the current account is deleted from
the remote.</p>
<p>For example: when the user wants to delete his account from Firebase</p>
## Implementation
```dart
FutureOrResult<void> onDelete();
```

View File

@ -0,0 +1,38 @@
# onReauthenticate method
*[<Null safety>](https://dart.dev/null-safety)*
FutureOrResult&lt;Data?> onReauthenticate
(Result&lt;[Account](../../wyatt_authentication_bloc/Account-class.md), AppException> result)
<p>This callback is triggered when the account is re-authenticated</p>
<p>For example: when the user is logged in and sign in
from an another provider</p>
## Implementation
```dart
FutureOrResult<Data?> onReauthenticate(Result<Account, AppException> result);
```

View File

@ -0,0 +1,37 @@
# onRefresh method
*[<Null safety>](https://dart.dev/null-safety)*
FutureOrResult&lt;Data?> onRefresh
(Result&lt;[Account](../../wyatt_authentication_bloc/Account-class.md), AppException> result)
<p>This callback is triggered when the account is refreshed.</p>
<p>For example: when the access token is refreshed.</p>
## Implementation
```dart
FutureOrResult<Data?> onRefresh(Result<Account, AppException> result);
```

View File

@ -0,0 +1,38 @@
# onSignInFromCache method
*[<Null safety>](https://dart.dev/null-safety)*
FutureOrResult&lt;Data?> onSignInFromCache
([SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper)
<p>This callback is triggered when the user is automaticcaly logged in from
the cache.</p>
<p>For example: when the user is sign in from the Firebase cache.</p>
## Implementation
```dart
FutureOrResult<Data?> onSignInFromCache(SessionWrapper<Data> wrapper);
```

View File

@ -0,0 +1,37 @@
# onSignOut method
*[<Null safety>](https://dart.dev/null-safety)*
FutureOrResult&lt;void> onSignOut
()
<p>This callback is triggered when the user is logged out.</p>
<p>For example: when the user clicks on the logout button.</p>
## Implementation
```dart
FutureOrResult<void> onSignOut();
```

View File

@ -0,0 +1,53 @@
# reauthenticate method
*[<Null safety>](https://dart.dev/null-safety)*
[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> reauthenticate
()
<p>Some security-sensitive actions—such as deleting an account,
setting a primary email address, and changing a password—require that
the user has recently signed in.</p>
<p>Throws a ReauthenticateFailureInterface if
an exception occurs.</p>
## Implementation
```dart
FutureOr<void> reauthenticate() async => CustomRoutine<Account, Data?>(
routine: authenticationRepository.reauthenticate,
attachedLogic: onReauthenticate,
onError: addError,
onSuccess: (result, data) => authenticationRepository.addSession(
SessionWrapper(
event: ReauthenticatedEvent(account: result),
session: Session<Data>(
account: result,
data: data,
),
),
),
).call();
```

View File

@ -0,0 +1,49 @@
# refresh method
*[<Null safety>](https://dart.dev/null-safety)*
[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> refresh
()
<p>Refreshes the current user, if signed in.</p>
## Implementation
```dart
FutureOr<void> refresh() async => CustomRoutine<Account, Data?>(
routine: authenticationRepository.refresh,
attachedLogic: onRefresh,
onError: addError,
onSuccess: (result, data) => authenticationRepository.addSession(
SessionWrapper(
event: RefreshedEvent(account: result),
session: Session<Data>(
account: result,
data: data,
),
),
),
).call();
```

View File

@ -0,0 +1,43 @@
# signOut method
*[<Null safety>](https://dart.dev/null-safety)*
[FutureOr](https://api.flutter.dev/flutter/dart-async/FutureOr-class.html)&lt;void> signOut
()
<p>Signs out the current user.
It also clears the cache and the associated data.</p>
## Implementation
```dart
FutureOr<void> signOut() async => CustomRoutine<void, void>(
routine: authenticationRepository.signOut,
attachedLogic: (routineResult) => onSignOut(),
onError: addError,
onSuccess: (result, data) => authenticationRepository
.addSession(SessionWrapper<Data>(event: const SignedOutEvent())),
).call();
```

View File

@ -0,0 +1,159 @@
# AuthenticationFailureInterface class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Base exception used in Wyatt Authentication</p>
**Implemented types**
- [Exception](https://api.flutter.dev/flutter/dart-core/Exception-class.html)
**Implementers**
- [ApplyActionCodeFailureInterface](../wyatt_authentication_bloc/ApplyActionCodeFailureInterface-class.md)
- [ConfirmPasswordResetFailureInterface](../wyatt_authentication_bloc/ConfirmPasswordResetFailureInterface-class.md)
- [DeleteAccountFailureInterface](../wyatt_authentication_bloc/DeleteAccountFailureInterface-class.md)
- [FetchSignInMethodsForEmailFailureInterface](../wyatt_authentication_bloc/FetchSignInMethodsForEmailFailureInterface-class.md)
- [ModelParsingFailureInterface](../wyatt_authentication_bloc/ModelParsingFailureInterface-class.md)
- [ReauthenticateFailureInterface](../wyatt_authentication_bloc/ReauthenticateFailureInterface-class.md)
- [RefreshFailureInterface](../wyatt_authentication_bloc/RefreshFailureInterface-class.md)
- [SendEmailVerificationFailureInterface](../wyatt_authentication_bloc/SendEmailVerificationFailureInterface-class.md)
- [SendPasswordResetEmailFailureInterface](../wyatt_authentication_bloc/SendPasswordResetEmailFailureInterface-class.md)
- [SendSignInLinkEmailFailureInterface](../wyatt_authentication_bloc/SendSignInLinkEmailFailureInterface-class.md)
- [SignInAnonymouslyFailureInterface](../wyatt_authentication_bloc/SignInAnonymouslyFailureInterface-class.md)
- [SignInWithAppleFailureInterface](../wyatt_authentication_bloc/SignInWithAppleFailureInterface-class.md)
- [SignInWithCredentialFailureInterface](../wyatt_authentication_bloc/SignInWithCredentialFailureInterface-class.md)
- [SignInWithEmailAndPasswordFailureInterface](../wyatt_authentication_bloc/SignInWithEmailAndPasswordFailureInterface-class.md)
- [SignInWithEmailLinkFailureInterface](../wyatt_authentication_bloc/SignInWithEmailLinkFailureInterface-class.md)
- [SignInWithFacebookFailureInterface](../wyatt_authentication_bloc/SignInWithFacebookFailureInterface-class.md)
- [SignInWithGoogleFailureInterface](../wyatt_authentication_bloc/SignInWithGoogleFailureInterface-class.md)
- [SignInWithTwitterFailureInterface](../wyatt_authentication_bloc/SignInWithTwitterFailureInterface-class.md)
- [SignOutFailureInterface](../wyatt_authentication_bloc/SignOutFailureInterface-class.md)
- [SignUpWithEmailAndPasswordFailureInterface](../wyatt_authentication_bloc/SignUpWithEmailAndPasswordFailureInterface-class.md)
- [UpdateEmailFailureInterface](../wyatt_authentication_bloc/UpdateEmailFailureInterface-class.md)
- [UpdatePasswordFailureInterface](../wyatt_authentication_bloc/UpdatePasswordFailureInterface-class.md)
- [VerifyPasswordResetCodeFailureInterface](../wyatt_authentication_bloc/VerifyPasswordResetCodeFailureInterface-class.md)
## Constructors
[AuthenticationFailureInterface](../wyatt_authentication_bloc/AuthenticationFailureInterface/AuthenticationFailureInterface.md) ([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html) msg)
[AuthenticationFailureInterface.fromCode](../wyatt_authentication_bloc/AuthenticationFailureInterface/AuthenticationFailureInterface.fromCode.md) ([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
## Properties
##### [code](../wyatt_authentication_bloc/AuthenticationFailureInterface/code.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span>_
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [message](../wyatt_authentication_bloc/AuthenticationFailureInterface/message.md) &#8594; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read-only</span>_
##### [msg](../wyatt_authentication_bloc/AuthenticationFailureInterface/msg.md) &#8596; [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
_<span class="feature">read / write</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [toString](../wyatt_authentication_bloc/AuthenticationFailureInterface/toString.md)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,31 @@
# AuthenticationFailureInterface.fromCode constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthenticationFailureInterface.fromCode([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code)
## Implementation
```dart
AuthenticationFailureInterface.fromCode(this.code)
: msg = 'An unknown error occurred.';
```

View File

@ -0,0 +1,30 @@
# AuthenticationFailureInterface constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthenticationFailureInterface([String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, [String](https://api.flutter.dev/flutter/dart-core/String-class.html) msg)
## Implementation
```dart
AuthenticationFailureInterface(this.code, this.msg);
```

View File

@ -0,0 +1,33 @@
# code property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) code
_<span class="feature">read / write</span>_
## Implementation
```dart
String code;
```

View File

@ -0,0 +1,40 @@
# message property
*[<Null safety>](https://dart.dev/null-safety)*
**Annotations**
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) message
## Implementation
```dart
@override
String get message => msg;
```

View File

@ -0,0 +1,33 @@
# msg property
*[<Null safety>](https://dart.dev/null-safety)*
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) msg
_<span class="feature">read / write</span>_
## Implementation
```dart
String msg;
```

View File

@ -0,0 +1,53 @@
# toString method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[String](https://api.flutter.dev/flutter/dart-core/String-class.html) toString
()
_<span class="feature">inherited</span>_
<p>A string representation of this object.</p>
<p>Some classes have a default textual representation,
often paired with a static <code>parse</code> function (like <a href="https://api.flutter.dev/flutter/dart-core/int/parse.html">int.parse</a>).
These classes will provide the textual representation as
their string representation.</p>
<p>Other classes have no meaningful textual representation
that a program will care about.
Such classes will typically override <code>toString</code> to provide
useful information when inspecting the object,
mainly for debugging or logging.</p>
## Implementation
```dart
@override
String toString() {
if (message.isNotNullOrEmpty) {
return '$runtimeType: $message';
} else {
return '$runtimeType: An exception occured';
}
}
```

View File

@ -0,0 +1,251 @@
# AuthenticationFirebaseDataSourceImpl&lt;Data> class
*[<Null safety>](https://dart.dev/null-safety)*
**Inheritance**
- [Object](https://api.flutter.dev/flutter/dart-core/Object-class.html)
- [AuthenticationRemoteDataSource](../wyatt_authentication_bloc/AuthenticationRemoteDataSource-class.md)&lt;Data>
- AuthenticationFirebaseDataSourceImpl
## Constructors
[AuthenticationFirebaseDataSourceImpl](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/AuthenticationFirebaseDataSourceImpl.md) ({[FirebaseAuth](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/FirebaseAuth-class.html)? firebaseAuth, [GoogleSignIn](https://pub.dev/documentation/google_sign_in/5.4.2/google_sign_in/GoogleSignIn-class.html)? googleSignIn})
## Properties
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [addSession](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/addSession.md)([SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper) void
Add a new authentication event.
_<span class="feature">override</span>_
##### [confirmPasswordReset](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/confirmPasswordReset.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) newPassword}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Confirms the password reset with the provided <code>newPassword</code> and <code>code</code>.
_<span class="feature">override</span>_
##### [delete](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/delete.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Delete account.
_<span class="feature">override</span>_
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [reauthenticate](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/reauthenticate.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Some security-sensitive actions—such as deleting an account,
setting a primary email address, and changing a password—require that
the user has recently signed in.
_<span class="feature">override</span>_
##### [refresh](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/refresh.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Refreshes the current user, if signed in.
_<span class="feature">override</span>_
##### [sendEmailVerification](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/sendEmailVerification.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Sends verification email to the account email.
_<span class="feature">override</span>_
##### [sendPasswordResetEmail](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/sendPasswordResetEmail.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Sends a password reset email to the provided <code>email</code>.
_<span class="feature">override</span>_
##### [sessionStream](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/sessionStream.md)() [Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)&lt;[SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data>>
Authentication state change event stream.
_<span class="feature">override</span>_
##### [signInAnonymously](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/signInAnonymously.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Sign in anonymously.
_<span class="feature">override</span>_
##### [signInWithEmailAndPassword](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/signInWithEmailAndPassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Signs in with the provided <code>email</code> and <code>password</code>.
_<span class="feature">override</span>_
##### [signInWithGoogle](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/signInWithGoogle.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Starts the Sign In with Google Flow.
_<span class="feature">override</span>_
##### [signOut](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/signOut.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
Signs out the current user.
It also clears the cache and the associated data.
_<span class="feature">override</span>_
##### [signUpWithEmailAndPassword](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/signUpWithEmailAndPassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Creates a new user with the provided <code>email</code> and <code>password</code>.
_<span class="feature">override</span>_
##### [toString](https://api.flutter.dev/flutter/dart-core/Object/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
##### [updateEmail](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/updateEmail.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Update or add <code>email</code>.
_<span class="feature">override</span>_
##### [updatePassword](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/updatePassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
Update or add <code>password</code>.
_<span class="feature">override</span>_
##### [verifyPasswordResetCode](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl/verifyPasswordResetCode.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)>
Verify password reset code.
_<span class="feature">override</span>_
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,40 @@
# AuthenticationFirebaseDataSourceImpl&lt;Data> constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthenticationFirebaseDataSourceImpl&lt;Data>({[FirebaseAuth](https://pub.dev/documentation/firebase_auth/4.2.0/firebase_auth/FirebaseAuth-class.html)? firebaseAuth, [GoogleSignIn](https://pub.dev/documentation/google_sign_in/5.4.2/google_sign_in/GoogleSignIn-class.html)? googleSignIn})
## Implementation
```dart
AuthenticationFirebaseDataSourceImpl({
FirebaseAuth? firebaseAuth,
GoogleSignIn? googleSignIn,
}) : _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance,
_googleSignIn = googleSignIn ?? GoogleSignIn() {
_latestCredentials = BehaviorSubject();
_sessionStream = BehaviorSubject();
// Check for account in memory (persistence)
_checkForCachedAccount();
}
```

View File

@ -0,0 +1,40 @@
# addSession method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
void addSession
([SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper)
_<span class="feature">override</span>_
<p>Add a new authentication event.</p>
## Implementation
```dart
@override
void addSession(SessionWrapper<Data> wrapper) {
_sessionStream.add(wrapper);
}
```

View File

@ -0,0 +1,53 @@
# confirmPasswordReset method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> confirmPasswordReset
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) newPassword})
_<span class="feature">override</span>_
<p>Confirms the password reset with the provided <code>newPassword</code> and <code>code</code>.</p>
<p>Throws a ConfirmPasswordResetFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<void> confirmPasswordReset({
required String code,
required String newPassword,
}) async {
try {
await _firebaseAuth.confirmPasswordReset(
code: code,
newPassword: newPassword,
);
} on FirebaseAuthException catch (e) {
throw ConfirmPasswordResetFailureFirebase.fromCode(e.code);
} catch (_) {
throw ConfirmPasswordResetFailureFirebase();
}
}
```

View File

@ -0,0 +1,48 @@
# delete method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> delete
()
_<span class="feature">override</span>_
<p>Delete account.</p>
<p>Throws a DeleteAccountFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<void> delete() async {
try {
await _firebaseAuth.currentUser!.delete();
} on FirebaseAuthException catch (e) {
throw DeleteAccountFailureFirebase.fromCode(e.code);
} catch (_) {
throw DeleteAccountFailureFirebase();
}
}
```

View File

@ -0,0 +1,61 @@
# reauthenticate method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> reauthenticate
()
_<span class="feature">override</span>_
<p>Some security-sensitive actions—such as deleting an account,
setting a primary email address, and changing a password—require that
the user has recently signed in.</p>
<p>Throws a ReauthenticateFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> reauthenticate() async {
final latestCreds =
await _latestCredentials.stream.asBroadcastStream().last;
try {
if (latestCreds?.credential != null) {
await _firebaseAuth.currentUser
?.reauthenticateWithCredential(latestCreds!.credential!);
} else {
throw Exception(); // Get caught just after.
}
final account = AccountModel.fromFirebaseUser(_firebaseAuth.currentUser);
return account;
} on FirebaseAuthException catch (e) {
throw ReauthenticateFailureFirebase.fromCode(e.code);
} catch (_) {
throw ReauthenticateFailureFirebase();
}
}
```

View File

@ -0,0 +1,52 @@
# refresh method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> refresh
()
_<span class="feature">override</span>_
<p>Refreshes the current user, if signed in.</p>
## Implementation
```dart
@override
Future<Account> refresh() async {
try {
final jwt = await _firebaseAuth.currentUser?.getIdToken(true);
final account = AccountModel.fromFirebaseUser(
_firebaseAuth.currentUser,
accessToken: jwt,
);
return account;
} on FirebaseAuthException catch (e) {
throw RefreshFailureFirebase.fromCode(e.code);
} catch (_) {
throw RefreshFailureFirebase();
}
}
```

View File

@ -0,0 +1,47 @@
# sendEmailVerification method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> sendEmailVerification
()
_<span class="feature">override</span>_
<p>Sends verification email to the account email.</p>
<p>Throws a SendEmailVerificationFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<void> sendEmailVerification() async {
try {
await _firebaseAuth.currentUser!.sendEmailVerification();
} on FirebaseAuthException catch (e) {
throw SendEmailVerificationFailureFirebase.fromCode(e.code);
} catch (_) {
throw SendEmailVerificationFailureFirebase();
}
}
```

View File

@ -0,0 +1,47 @@
# sendPasswordResetEmail method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> sendPasswordResetEmail
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email})
_<span class="feature">override</span>_
<p>Sends a password reset email to the provided <code>email</code>.</p>
<p>Throws a SendPasswordResetEmailFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<void> sendPasswordResetEmail({required String email}) async {
try {
await _firebaseAuth.sendPasswordResetEmail(email: email);
} on FirebaseAuthException catch (e) {
throw SendPasswordResetEmailFailureFirebase.fromCode(e.code);
} catch (_) {
throw SendPasswordResetEmailFailureFirebase();
}
}
```

View File

@ -0,0 +1,39 @@
# sessionStream method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)&lt;[SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data>> sessionStream
()
_<span class="feature">override</span>_
<p>Authentication state change event stream.</p>
## Implementation
```dart
@override
Stream<SessionWrapper<Data>> sessionStream() =>
_sessionStream.stream.asBroadcastStream();
```

View File

@ -0,0 +1,54 @@
# signInAnonymously method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> signInAnonymously
()
_<span class="feature">override</span>_
<p>Sign in anonymously.</p>
<p>Throws a SignInAnonymouslyFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> signInAnonymously() async {
try {
final userCredential = await _firebaseAuth.signInAnonymously();
return _addToStream(
userCredential,
(account) => SignedInEvent(
account: account,
),
);
} on FirebaseAuthException catch (e) {
throw SignInAnonymouslyFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInAnonymouslyFailureFirebase();
}
}
```

View File

@ -0,0 +1,61 @@
# signInWithEmailAndPassword method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> signInWithEmailAndPassword
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password})
_<span class="feature">override</span>_
<p>Signs in with the provided <code>email</code> and <code>password</code>.</p>
<p>Throws a SignInWithEmailAndPasswordFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> signInWithEmailAndPassword({
required String email,
required String password,
}) async {
try {
final userCredential = await _firebaseAuth.signInWithEmailAndPassword(
email: email,
password: password,
);
return _addToStream(
userCredential,
(account) => SignedInEvent(
account: account,
),
);
} on FirebaseAuthException catch (e) {
throw SignInWithEmailAndPasswordFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithEmailAndPasswordFailureFirebase();
}
}
```

View File

@ -0,0 +1,68 @@
# signInWithGoogle method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> signInWithGoogle
()
_<span class="feature">override</span>_
<p>Starts the Sign In with Google Flow.</p>
<p>Throws a SignInWithGoogleFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> signInWithGoogle() async {
try {
// Trigger the authentication flow
final GoogleSignInAccount? googleUser = await _googleSignIn.signIn();
// Obtain the auth details from the request
final GoogleSignInAuthentication? googleAuth =
await googleUser?.authentication;
// Create a new credential
final credential = GoogleAuthProvider.credential(
accessToken: googleAuth?.accessToken,
idToken: googleAuth?.idToken,
);
final userCredential =
await _firebaseAuth.signInWithCredential(credential);
return _addToStream(
userCredential,
(account) => SignedInEvent(
account: account,
),
);
} on FirebaseAuthException catch (e) {
throw SignInWithGoogleFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignInWithGoogleFailureFirebase();
}
}
```

View File

@ -0,0 +1,46 @@
# signOut method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> signOut
()
_<span class="feature">override</span>_
<p>Signs out the current user.
It also clears the cache and the associated data.</p>
## Implementation
```dart
@override
Future<void> signOut() async {
try {
_latestCredentials.add(null);
await _firebaseAuth.signOut();
} catch (_) {
throw SignOutFailureFirebase();
}
}
```

View File

@ -0,0 +1,62 @@
# signUpWithEmailAndPassword method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> signUpWithEmailAndPassword
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password})
_<span class="feature">override</span>_
<p>Creates a new user with the provided <code>email</code> and <code>password</code>.</p>
<p>Returns the newly created user's unique identifier.</p>
<p>Throws a SignUpWithEmailAndPasswordFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> signUpWithEmailAndPassword({
required String email,
required String password,
}) async {
try {
final userCredential = await _firebaseAuth.createUserWithEmailAndPassword(
email: email,
password: password,
);
return _addToStream(
userCredential,
(account) => SignedUpEvent(
account: account,
),
);
} on FirebaseAuthException catch (e) {
throw SignUpWithEmailAndPasswordFailureFirebase.fromCode(e.code);
} catch (_) {
throw SignUpWithEmailAndPasswordFailureFirebase();
}
}
```

View File

@ -0,0 +1,55 @@
# updateEmail method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> updateEmail
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email})
_<span class="feature">override</span>_
<p>Update or add <code>email</code>.</p>
<p>Throws a UpdateEmailFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> updateEmail({required String email}) async {
try {
await _firebaseAuth.currentUser!.updateEmail(email);
final jwt = await _firebaseAuth.currentUser!.getIdToken(true);
final account = AccountModel.fromFirebaseUser(
_firebaseAuth.currentUser,
accessToken: jwt,
);
return account;
} on FirebaseAuthException catch (e) {
throw UpdateEmailFailureFirebase.fromCode(e.code);
} catch (_) {
throw UpdateEmailFailureFirebase();
}
}
```

View File

@ -0,0 +1,55 @@
# updatePassword method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> updatePassword
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password})
_<span class="feature">override</span>_
<p>Update or add <code>password</code>.</p>
<p>Throws a UpdatePasswordFailureInterface if
an exception occurs.</p>
## Implementation
```dart
@override
Future<Account> updatePassword({required String password}) async {
try {
await _firebaseAuth.currentUser!.updatePassword(password);
final jwt = await _firebaseAuth.currentUser!.getIdToken(true);
final account = AccountModel.fromFirebaseUser(
_firebaseAuth.currentUser,
accessToken: jwt,
);
return account;
} on FirebaseAuthException catch (e) {
throw UpdatePasswordFailureFirebase.fromCode(e.code);
} catch (_) {
throw UpdatePasswordFailureFirebase();
}
}
```

View File

@ -0,0 +1,48 @@
# verifyPasswordResetCode method
*[<Null safety>](https://dart.dev/null-safety)*
- @[override](https://api.flutter.dev/flutter/dart-core/override-constant.html)
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)> verifyPasswordResetCode
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code})
_<span class="feature">override</span>_
<p>Verify password reset code.</p>
<p>Throws a VerifyPasswordResetCodeFailureInterface if an exception occurs.</p>
## Implementation
```dart
@override
Future<bool> verifyPasswordResetCode({required String code}) async {
try {
final email = await _firebaseAuth.verifyPasswordResetCode(code);
return email.isNotNullOrEmpty;
} on FirebaseAuthException catch (e) {
throw VerifyPasswordResetCodeFailureFirebase.fromCode(e.code);
} catch (_) {
throw VerifyPasswordResetCodeFailureFirebase();
}
}
```

View File

@ -0,0 +1,247 @@
# AuthenticationRemoteDataSource&lt;Data> class
*[<Null safety>](https://dart.dev/null-safety)*
<p>Is responsible for abstracting the provenance of the data.</p>
**Implementers**
- [AuthenticationFirebaseDataSourceImpl](../wyatt_authentication_bloc/AuthenticationFirebaseDataSourceImpl-class.md)
## Constructors
[AuthenticationRemoteDataSource](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/AuthenticationRemoteDataSource.md) ()
## Properties
##### [hashCode](https://api.flutter.dev/flutter/dart-core/Object/hashCode.html) &#8594; [int](https://api.flutter.dev/flutter/dart-core/int-class.html)
The hash code for this object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
##### [runtimeType](https://api.flutter.dev/flutter/dart-core/Object/runtimeType.html) &#8594; [Type](https://api.flutter.dev/flutter/dart-core/Type-class.html)
A representation of the runtime type of the object.
_<span class="feature">read-only</span><span class="feature">inherited</span>_
## Methods
##### [addSession](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/addSession.md)([SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper) void
##### [confirmPasswordReset](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/confirmPasswordReset.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) newPassword}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
##### [delete](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/delete.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
##### [noSuchMethod](https://api.flutter.dev/flutter/dart-core/Object/noSuchMethod.html)([Invocation](https://api.flutter.dev/flutter/dart-core/Invocation-class.html) invocation) dynamic
Invoked when a non-existent method or property is accessed.
_<span class="feature">inherited</span>_
##### [reauthenticate](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/reauthenticate.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [refresh](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/refresh.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [sendEmailVerification](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/sendEmailVerification.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
##### [sendPasswordResetEmail](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/sendPasswordResetEmail.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
##### [sessionStream](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/sessionStream.md)() [Stream](https://api.flutter.dev/flutter/dart-async/Stream-class.html)&lt;[SessionWrapper](../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data>>
##### [signInAnonymously](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/signInAnonymously.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [signInWithEmailAndPassword](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/signInWithEmailAndPassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [signInWithGoogle](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/signInWithGoogle.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [signOut](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/signOut.md)() [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void>
##### [signUpWithEmailAndPassword](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/signUpWithEmailAndPassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [toString](https://api.flutter.dev/flutter/dart-core/Object/toString.html)() [String](https://api.flutter.dev/flutter/dart-core/String-class.html)
A string representation of this object.
_<span class="feature">inherited</span>_
##### [updateEmail](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/updateEmail.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) email}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [updatePassword](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/updatePassword.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) password}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../wyatt_authentication_bloc/Account-class.md)>
##### [verifyPasswordResetCode](../wyatt_authentication_bloc/AuthenticationRemoteDataSource/verifyPasswordResetCode.md)({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code}) [Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)>
## Operators
##### [operator ==](https://api.flutter.dev/flutter/dart-core/Object/operator_equals.html)([Object](https://api.flutter.dev/flutter/dart-core/Object-class.html) other) [bool](https://api.flutter.dev/flutter/dart-core/bool-class.html)
The equality operator.
_<span class="feature">inherited</span>_

View File

@ -0,0 +1,25 @@
# AuthenticationRemoteDataSource&lt;Data> constructor
*[<Null safety>](https://dart.dev/null-safety)*
AuthenticationRemoteDataSource&lt;Data>()

View File

@ -0,0 +1,35 @@
# addSession method
*[<Null safety>](https://dart.dev/null-safety)*
void addSession
([SessionWrapper](../../wyatt_authentication_bloc/SessionWrapper-class.md)&lt;Data> wrapper)
## Implementation
```dart
void addSession(SessionWrapper<Data> wrapper);
```

View File

@ -0,0 +1,38 @@
# confirmPasswordReset method
*[<Null safety>](https://dart.dev/null-safety)*
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> confirmPasswordReset
({required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) code, required [String](https://api.flutter.dev/flutter/dart-core/String-class.html) newPassword})
## Implementation
```dart
Future<void> confirmPasswordReset({
required String code,
required String newPassword,
});
```

View File

@ -0,0 +1,35 @@
# delete method
*[<Null safety>](https://dart.dev/null-safety)*
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;void> delete
()
## Implementation
```dart
Future<void> delete();
```

View File

@ -0,0 +1,35 @@
# reauthenticate method
*[<Null safety>](https://dart.dev/null-safety)*
[Future](https://api.flutter.dev/flutter/dart-async/Future-class.html)&lt;[Account](../../wyatt_authentication_bloc/Account-class.md)> reauthenticate
()
## Implementation
```dart
Future<Account> reauthenticate();
```

Some files were not shown because too many files have changed in this diff Show More