Skip to content

Commit ad7f868

Browse files
Nika HassaniNikaHsn
authored andcommitted
chore(core)!: make asyncConfig internal
1 parent 7cbffbe commit ad7f868

File tree

7 files changed

+7
-23
lines changed

7 files changed

+7
-23
lines changed

packages/amplify_core/lib/src/amplify_class.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ abstract class AmplifyClass {
9292
bool get isConfigured => _configCompleter.isCompleted;
9393

9494
/// A future when completes when Amplify has been successfully configured.
95-
@Deprecated('Will be removed in 2.0.0')
95+
@internal
9696
Future<AmplifyConfig> get asyncConfig => _configCompleter.future;
9797

9898
/// Configures Amplify with the provided configuration string.

packages/amplify_core/test/amplify_class_test.dart

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@ void main() {
1919
});
2020

2121
test('completes', () async {
22-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
23-
// ignore: deprecated_member_use_from_same_package
2422
expect(Amplify.asyncConfig, completes);
2523
await Amplify.addPlugin(SuccessPlugin());
2624
expect(Amplify.configure(dummyConfiguration), completes);
2725
});
2826

2927
test('plugin is configured even if addPlugin is not awaited', () async {
30-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
31-
// ignore: deprecated_member_use_from_same_package
3228
expect(Amplify.asyncConfig, completes);
3329
final plugin = AsyncAddPlugin();
3430
unawaited(Amplify.addPlugin(plugin));
@@ -40,8 +36,6 @@ void main() {
4036

4137
test('throws for invalid JSON', () async {
4238
expect(
43-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
44-
// ignore: deprecated_member_use_from_same_package
4539
Amplify.asyncConfig,
4640
throwsA(isA<ConfigurationError>()),
4741
);
@@ -53,8 +47,6 @@ void main() {
5347

5448
test('throws for configuration exceptions', () async {
5549
expect(
56-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
57-
// ignore: deprecated_member_use_from_same_package
5850
Amplify.asyncConfig,
5951
throwsA(isA<ConfigurationError>()),
6052
);
@@ -66,8 +58,6 @@ void main() {
6658
});
6759

6860
test('throws non-configuration exceptions', () async {
69-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
70-
// ignore: deprecated_member_use_from_same_package
7161
expect(Amplify.asyncConfig, completes);
7262
await Amplify.addPlugin(NonConfigErrorPlugin());
7363
expect(

packages/auth/amplify_auth_cognito/example/integration_test/sign_out_test.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ void main() {
4949
environmentName: environmentName,
5050
);
5151

52-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
53-
// ignore: deprecated_member_use
52+
// ignore: invalid_use_of_internal_member
5453
final config = await Amplify.asyncConfig;
5554
final authConfig = config.auth!.awsPlugin!.cognitoUserPool!.default$!;
5655
client = AWSHttpClient()

packages/auth/amplify_auth_cognito_dart/example/web/components/app_component.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,12 @@ class AppComponent extends StatefulComponent {
6262
if (Amplify.isConfigured) return;
6363
try {
6464
await configure();
65-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
66-
// ignore: deprecated_member_use
65+
// ignore: invalid_use_of_internal_member
6766
config = await Amplify.asyncConfig;
6867

6968
Amplify.Hub.listen(HubChannel.Auth, (AuthHubEvent event) {
7069
if (event.type == AuthHubEventType.signedIn) {
71-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
72-
// ignore: deprecated_member_use
70+
// ignore: invalid_use_of_internal_member
7371
Amplify.asyncConfig.then((_) {
7472
if (!appState.authState.isAuthenticatedRoute) {
7573
setState(

packages/authenticator/amplify_authenticator/lib/amplify_authenticator.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,7 @@ class _AuthenticatorState extends State<Authenticator> {
633633
}
634634

635635
Future<void> _waitForConfiguration() async {
636-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
637-
// ignore: deprecated_member_use
636+
// ignore: invalid_use_of_internal_member
638637
final config = await Amplify.asyncConfig;
639638
if (!mounted) return;
640639
setState(() {

packages/authenticator/amplify_authenticator/lib/src/services/amplify_auth_service.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ class AmplifyAuthService
332332
);
333333
});
334334
try {
335-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
336-
// ignore: deprecated_member_use
335+
// ignore: invalid_use_of_internal_member
337336
return await Amplify.asyncConfig;
338337
} finally {
339338
timer.cancel();

packages/storage/amplify_storage_s3_dart/lib/src/amplify_storage_s3_dart_impl.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ class AmplifyStorageS3Dart extends StoragePluginInterface
120120
);
121121

122122
scheduleMicrotask(() async {
123-
// TODO(nikahsn): remove after making the api internal in 2.0.0.
124-
// ignore: deprecated_member_use
123+
// ignore: invalid_use_of_internal_member
125124
await Amplify.asyncConfig;
126125
if (_zIsTest) {
127126
return;

0 commit comments

Comments
 (0)