diff --git a/packages/wyatt_authentication_bloc/analysis_options.yaml b/packages/wyatt_authentication_bloc/analysis_options.yaml
index b0c6aced..82177cd5 100644
--- a/packages/wyatt_authentication_bloc/analysis_options.yaml
+++ b/packages/wyatt_authentication_bloc/analysis_options.yaml
@@ -1,4 +1 @@
-include: package:wyatt_analysis/analysis_options.flutter.yaml
-
-analyzer:
- exclude: "!example/**"
\ No newline at end of file
+include: package:wyatt_analysis/analysis_options.flutter.yaml
\ No newline at end of file
diff --git a/packages/wyatt_authentication_bloc/example/lib/bootstrap.dart b/packages/wyatt_authentication_bloc/example/lib/bootstrap.dart
index 4e0f4070..0b4e74c6 100644
--- a/packages/wyatt_authentication_bloc/example/lib/bootstrap.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/bootstrap.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/core/constants/form_field.dart b/packages/wyatt_authentication_bloc/example/lib/core/constants/form_field.dart
index 84636b9f..917131da 100644
--- a/packages/wyatt_authentication_bloc/example/lib/core/constants/form_field.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/core/constants/form_field.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/core/constants/form_name.dart b/packages/wyatt_authentication_bloc/example/lib/core/constants/form_name.dart
index a5ce457e..b41b7335 100644
--- a/packages/wyatt_authentication_bloc/example/lib/core/constants/form_name.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/core/constants/form_name.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/core/utils/app_bloc_observer.dart b/packages/wyatt_authentication_bloc/example/lib/core/utils/app_bloc_observer.dart
index 3490aee1..1a25acfd 100644
--- a/packages/wyatt_authentication_bloc/example/lib/core/utils/app_bloc_observer.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/core/utils/app_bloc_observer.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/core/utils/custom_password.dart b/packages/wyatt_authentication_bloc/example/lib/core/utils/custom_password.dart
index bdbb3552..d80b6d3e 100644
--- a/packages/wyatt_authentication_bloc/example/lib/core/utils/custom_password.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/core/utils/custom_password.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/main.dart b/packages/wyatt_authentication_bloc/example/lib/main.dart
index 0149dcb6..c41af8b6 100644
--- a/packages/wyatt_authentication_bloc/example/lib/main.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/main.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart
index e82e2b4c..c92aa597 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/edit_profile/blocs/edit_profile_cubit.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
@@ -71,4 +71,4 @@ class EditProfileCubit extends FormDataCubitImpl {
}
emit(state.copyWith(status: FormStatus.submissionSuccess));
}
-}
\ No newline at end of file
+}
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/sign_in_page.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/sign_in_page.dart
index 5d7aa1e4..19dfd0b6 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/sign_in_page.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/sign_in_page.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/widgets/sign_in_form.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/widgets/sign_in_form.dart
index 865b6cec..9a8cb6ad 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/widgets/sign_in_form.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_in/widgets/sign_in_form.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/sign_up_page.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/sign_up_page.dart
index 918f09cd..ff232348 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/sign_up_page.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/sign_up_page.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/widgets/sign_up_form.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/widgets/sign_up_form.dart
index 546ec326..bb3ebceb 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/widgets/sign_up_form.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sign_up/widgets/sign_up_form.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sub/sub_page.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sub/sub_page.dart
index 48a39986..a5c8a6b6 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/sub/sub_page.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/sub/sub_page.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
@@ -30,10 +30,12 @@ class SubPage extends StatelessWidget {
title: const Text('Sub'),
actions: [
IconButton(
- onPressed: () => context.read>().signOut(),
+ onPressed: () =>
+ context.read>().signOut(),
icon: const Icon(Icons.logout_rounded)),
IconButton(
- onPressed: () => context.read>().refresh(),
+ onPressed: () =>
+ context.read>().refresh(),
icon: const Icon(Icons.refresh))
],
),
diff --git a/packages/wyatt_authentication_bloc/example/lib/presentation/features/welcome/welcome_page.dart b/packages/wyatt_authentication_bloc/example/lib/presentation/features/welcome/welcome_page.dart
index 5080183c..10d5c0cc 100644
--- a/packages/wyatt_authentication_bloc/example/lib/presentation/features/welcome/welcome_page.dart
+++ b/packages/wyatt_authentication_bloc/example/lib/presentation/features/welcome/welcome_page.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/example/test/widget_test.dart b/packages/wyatt_authentication_bloc/example/test/widget_test.dart
index e69de29b..8b137891 100644
--- a/packages/wyatt_authentication_bloc/example/test/widget_test.dart
+++ b/packages/wyatt_authentication_bloc/example/test/widget_test.dart
@@ -0,0 +1 @@
+
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/core.dart b/packages/wyatt_authentication_bloc/lib/src/core/core.dart
index 16b0264b..2d4165fc 100644
--- a/packages/wyatt_authentication_bloc/lib/src/core/core.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/core/core.dart
@@ -18,4 +18,3 @@ export 'constants/form_field.dart';
export 'constants/form_name.dart';
export 'enums/enums.dart';
export 'exceptions/exceptions.dart';
-export 'utils/utils.dart';
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/enums/authentication_status.dart b/packages/wyatt_authentication_bloc/lib/src/core/enums/authentication_status.dart
index af10ceae..11386588 100644
--- a/packages/wyatt_authentication_bloc/lib/src/core/enums/authentication_status.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/core/enums/authentication_status.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/enums/enums.dart b/packages/wyatt_authentication_bloc/lib/src/core/enums/enums.dart
index 67d107d6..db37d714 100644
--- a/packages/wyatt_authentication_bloc/lib/src/core/enums/enums.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/core/enums/enums.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/exceptions/exceptions.dart b/packages/wyatt_authentication_bloc/lib/src/core/exceptions/exceptions.dart
index cfcfba68..7d418c1f 100644
--- a/packages/wyatt_authentication_bloc/lib/src/core/exceptions/exceptions.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/core/exceptions/exceptions.dart
@@ -20,15 +20,14 @@ part 'exceptions_firebase.dart';
abstract class AuthenticationFailureInterface extends AppException
implements Exception {
+ AuthenticationFailureInterface(this.code, this.msg);
+ AuthenticationFailureInterface.fromCode(this.code)
+ : msg = 'An unknown error occurred.';
String code;
String msg;
@override
String get message => msg;
-
- AuthenticationFailureInterface(this.code, this.msg);
- AuthenticationFailureInterface.fromCode(this.code)
- : msg = 'An unknown error occurred.';
}
/// {@template apply_action_code_failure}
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/utils/cryptography.dart b/packages/wyatt_authentication_bloc/lib/src/core/utils/cryptography.dart
deleted file mode 100644
index f9a0b247..00000000
--- a/packages/wyatt_authentication_bloc/lib/src/core/utils/cryptography.dart
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (C) 2022 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 .
-
-import 'dart:convert';
-import 'dart:math';
-
-import 'package:crypto/crypto.dart';
-
-class Cryptography {
- /// Generates a cryptographically secure random nonce, to be included in a
- /// credential request.
- static String generateNonce([int length = 32]) {
- const charset =
- '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._';
- final random = Random.secure();
- return List.generate(length, (_) => charset[random.nextInt(charset.length)])
- .join();
- }
-
- /// Returns the sha256 hash of [input] in hex notation.
- static String sha256ofString(String input) {
- final bytes = utf8.encode(input);
- final digest = sha256.convert(bytes);
- return digest.toString();
- }
-}
diff --git a/packages/wyatt_authentication_bloc/lib/src/core/utils/utils.dart b/packages/wyatt_authentication_bloc/lib/src/core/utils/utils.dart
deleted file mode 100644
index 81005a25..00000000
--- a/packages/wyatt_authentication_bloc/lib/src/core/utils/utils.dart
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (C) 2022 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 .
-
-export 'cryptography.dart';
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/data.dart b/packages/wyatt_authentication_bloc/lib/src/data/data.dart
index 42218c55..35d3fdd1 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/data.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/data.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/local/authentication_cache_data_source_impl.dart b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/local/authentication_cache_data_source_impl.dart
index 57b1191a..13f537bb 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/local/authentication_cache_data_source_impl.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/local/authentication_cache_data_source_impl.dart
@@ -20,11 +20,11 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
class AuthenticationCacheDataSourceImpl
extends AuthenticationCacheDataSource {
+ AuthenticationCacheDataSourceImpl();
+
Account? _account;
T? _data;
- AuthenticationCacheDataSourceImpl();
-
@override
Future storeAccount(Account? account) async {
_account = account;
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart
index 131e160a..e24fb231 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_firebase_data_source_impl.dart
@@ -20,12 +20,12 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
class AuthenticationFirebaseDataSourceImpl
extends AuthenticationRemoteDataSource {
- final FirebaseAuth _firebaseAuth;
- UserCredential? _latestCreds;
-
AuthenticationFirebaseDataSourceImpl({FirebaseAuth? firebaseAuth})
: _firebaseAuth = firebaseAuth ?? FirebaseAuth.instance;
+ final FirebaseAuth _firebaseAuth;
+ UserCredential? _latestCreds;
+
Account _mapper(User user) => AccountModel(
uid: user.uid,
emailVerified: user.emailVerified,
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_mock_data_source_impl.dart b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_mock_data_source_impl.dart
index 67ef28cd..e1478f88 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_mock_data_source_impl.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/data_sources/remote/authentication_mock_data_source_impl.dart
@@ -21,6 +21,11 @@ import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
class AuthenticationMockDataSourceImpl extends AuthenticationRemoteDataSource {
+ AuthenticationMockDataSourceImpl({
+ this.idToken = 'fake-id-token',
+ this.registeredAccounts,
+ });
+
Pair? _connectedMock;
Pair? _registeredMock;
DateTime _lastSignInTime = DateTime.now();
@@ -30,11 +35,6 @@ class AuthenticationMockDataSourceImpl extends AuthenticationRemoteDataSource {
final List>? registeredAccounts;
final String idToken;
- AuthenticationMockDataSourceImpl({
- this.idToken = 'fake-id-token',
- this.registeredAccounts,
- });
-
Future _randomDelay() async {
await Future.delayed(
Duration(milliseconds: Random().nextInt(400) + 200),
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/models/account_model.dart b/packages/wyatt_authentication_bloc/lib/src/data/models/account_model.dart
index d886d329..0077378b 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/models/account_model.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/models/account_model.dart
@@ -72,16 +72,17 @@ class AccountModel extends Account {
String? phoneNumber,
String? photoURL,
String? providerId,
- }) => AccountModel(
- uid: uid ?? this.uid,
- email: email ?? this.email,
- creationTime: creationTime ?? this.creationTime,
- emailVerified: emailVerified ?? this.emailVerified,
- isAnonymous: isAnonymous ?? this.isAnonymous,
- isNewUser: isNewUser ?? this.isNewUser,
- lastSignInTime: lastSignInTime ?? this.lastSignInTime,
- phoneNumber: phoneNumber ?? this.phoneNumber,
- photoURL: photoURL ?? this.photoURL,
- providerId: providerId ?? this.providerId,
- );
+ }) =>
+ AccountModel(
+ uid: uid ?? this.uid,
+ email: email ?? this.email,
+ creationTime: creationTime ?? this.creationTime,
+ emailVerified: emailVerified ?? this.emailVerified,
+ isAnonymous: isAnonymous ?? this.isAnonymous,
+ isNewUser: isNewUser ?? this.isNewUser,
+ lastSignInTime: lastSignInTime ?? this.lastSignInTime,
+ phoneNumber: phoneNumber ?? this.phoneNumber,
+ photoURL: photoURL ?? this.photoURL,
+ providerId: providerId ?? this.providerId,
+ );
}
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/models/account_wrapper_model.dart b/packages/wyatt_authentication_bloc/lib/src/data/models/account_wrapper_model.dart
index e99b774e..4dae7f6b 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/models/account_wrapper_model.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/models/account_wrapper_model.dart
@@ -29,8 +29,9 @@ class AccountWrapperModel extends AccountWrapper {
AccountWrapperModel copyWith({
Account? account,
T? data,
- }) => AccountWrapperModel(
- account ?? this.account,
- data ?? this.data,
- );
+ }) =>
+ AccountWrapperModel(
+ account ?? this.account,
+ data ?? this.data,
+ );
}
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/models/models.dart b/packages/wyatt_authentication_bloc/lib/src/data/models/models.dart
index 09cc76bf..14f991fe 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/models/models.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/models/models.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/repositories/authentication_repository_impl.dart b/packages/wyatt_authentication_bloc/lib/src/data/repositories/authentication_repository_impl.dart
index c0f2c8e1..294e1096 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/repositories/authentication_repository_impl.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/repositories/authentication_repository_impl.dart
@@ -42,19 +42,6 @@ typedef OnAuthChange = FutureOrResult Function(
class AuthenticationRepositoryImpl
extends AuthenticationRepository {
- final AuthenticationCacheDataSource _authenticationLocalDataSource;
- final AuthenticationRemoteDataSource _authenticationRemoteDataSource;
-
- late FormRepository _formRepository;
-
- final OnSignUpSuccess? _onSignUpSuccess;
-
- final OnAuthChange? _onAccountChanges;
- final StreamController>> _signUpStream =
- StreamController();
-
- bool _pause = false; // Semaphore
-
AuthenticationRepositoryImpl({
required AuthenticationCacheDataSource authenticationCacheDataSource,
required AuthenticationRemoteDataSource authenticationRemoteDataSource,
@@ -107,6 +94,19 @@ class AuthenticationRepositoryImpl
);
}
+ final AuthenticationCacheDataSource _authenticationLocalDataSource;
+ final AuthenticationRemoteDataSource _authenticationRemoteDataSource;
+
+ late FormRepository _formRepository;
+
+ final OnSignUpSuccess? _onSignUpSuccess;
+
+ final OnAuthChange? _onAccountChanges;
+ final StreamController>> _signUpStream =
+ StreamController();
+
+ bool _pause = false;
+
@override
FormRepository get formRepository => _formRepository;
diff --git a/packages/wyatt_authentication_bloc/lib/src/data/repositories/repositories.dart b/packages/wyatt_authentication_bloc/lib/src/data/repositories/repositories.dart
index 7858c9e7..d5979688 100644
--- a/packages/wyatt_authentication_bloc/lib/src/data/repositories/repositories.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/data/repositories/repositories.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/domain/domain.dart b/packages/wyatt_authentication_bloc/lib/src/domain/domain.dart
index 7727f7ee..6f4ec438 100644
--- a/packages/wyatt_authentication_bloc/lib/src/domain/domain.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/domain/domain.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/domain/entities/entities.dart b/packages/wyatt_authentication_bloc/lib/src/domain/entities/entities.dart
index 8ecf9215..e9a858fe 100644
--- a/packages/wyatt_authentication_bloc/lib/src/domain/entities/entities.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/domain/entities/entities.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/domain/repositories/authentication_repository.dart b/packages/wyatt_authentication_bloc/lib/src/domain/repositories/authentication_repository.dart
index d4b2c23b..56f1697b 100644
--- a/packages/wyatt_authentication_bloc/lib/src/domain/repositories/authentication_repository.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/domain/repositories/authentication_repository.dart
@@ -105,8 +105,8 @@ abstract class AuthenticationRepository extends BaseRepository {
});
/// {@template reauthenticate}
- /// Some security-sensitive actions—such as deleting an account,
- /// setting a primary email address, and changing a password—require that
+ /// 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.
///
/// Throws a ReauthenticateFailureInterface if
@@ -129,7 +129,7 @@ abstract class AuthenticationRepository extends BaseRepository {
/// Stream of [AccountWrapper] which will emit the current account when
/// the authentication state changes.
///
- /// Emits [AccountWrapper] with null [Account] if the user is not
+ /// Emits [AccountWrapper] with null [Account] if the user is not
/// authenticated.
/// {@endtemplate}
Stream>> streamAccount();
diff --git a/packages/wyatt_authentication_bloc/lib/src/domain/repositories/repositories.dart b/packages/wyatt_authentication_bloc/lib/src/domain/repositories/repositories.dart
index 85f8ae88..8ff4eae1 100644
--- a/packages/wyatt_authentication_bloc/lib/src/domain/repositories/repositories.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/domain/repositories/repositories.dart
@@ -1,16 +1,16 @@
// Copyright (C) 2022 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 .
diff --git a/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_cubit.dart b/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_cubit.dart
index cf648917..eab1ffbb 100644
--- a/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_cubit.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_cubit.dart
@@ -26,14 +26,13 @@ import 'package:wyatt_type_utils/wyatt_type_utils.dart';
part 'authentication_state.dart';
class AuthenticationCubit extends Cubit> {
- final AuthenticationRepository _authenticationRepository;
-
AuthenticationCubit({
required AuthenticationRepository authenticationRepository,
}) : _authenticationRepository = authenticationRepository,
super(const AuthenticationState.unknown()) {
_listenForAuthenticationChanges();
}
+ final AuthenticationRepository _authenticationRepository;
void _listenForAuthenticationChanges() {
_authenticationRepository.streamAccount().listen((accountFutureResult) {
diff --git a/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_state.dart b/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_state.dart
index bfd1e871..a5733bf2 100644
--- a/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_state.dart
+++ b/packages/wyatt_authentication_bloc/lib/src/features/authentication/cubit/authentication_state.dart
@@ -17,13 +17,8 @@
part of 'authentication_cubit.dart';
class AuthenticationState extends Equatable {
- final AuthenticationStatus status;
- final AccountWrapper? accountWrapper;
-
- const AuthenticationState._({required this.status, this.accountWrapper});
-
- const AuthenticationState.unknown()
- : this._(status: AuthenticationStatus.unknown);
+ const AuthenticationState.unauthenticated()
+ : this._(status: AuthenticationStatus.unauthenticated);
const AuthenticationState.authenticated(AccountWrapper accountWrapper)
: this._(
@@ -31,8 +26,12 @@ class AuthenticationState extends Equatable {
accountWrapper: accountWrapper,
);
- const AuthenticationState.unauthenticated()
- : this._(status: AuthenticationStatus.unauthenticated);
+ const AuthenticationState.unknown()
+ : this._(status: AuthenticationStatus.unknown);
+
+ const AuthenticationState._({required this.status, this.accountWrapper});
+ final AuthenticationStatus status;
+ final AccountWrapper? accountWrapper;
@override
List