-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added DartAppPathProvider and changed logger plugin constructor
- Loading branch information
1 parent
4aecab2
commit edece6d
Showing
6 changed files
with
81 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...es/logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export 'app_path_provider_stub.dart' | ||
if (dart.library.html) 'app_path_provider_html.dart' | ||
if (dart.library.io) 'app_path_provider_io.dart'; |
22 changes: 22 additions & 0 deletions
22
...gging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_html.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
/// {@template aws_logging_cloudwatch.app_path_provider} | ||
/// Provides App paths for amplify_storage_s3_dart package. | ||
/// {@endtemplate} | ||
class DartAppPathProvider implements AppPathProvider { | ||
/// {@macro aws_logging_cloudwatch.app_path_provider} | ||
const DartAppPathProvider(); | ||
|
||
@override | ||
Future<String> getApplicationSupportPath() async { | ||
return ''; | ||
} | ||
|
||
@override | ||
Future<String> getTemporaryPath() async { | ||
return ''; | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...logging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_io.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'dart:io'; | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
/// {@template aws_logging_cloudwatch.app_path_provider} | ||
/// Provides App paths for amplify_storage_s3_dart package. | ||
/// {@endtemplate} | ||
class DartAppPathProvider implements AppPathProvider { | ||
/// {@macro aws_logging_cloudwatch.app_path_provider} | ||
const DartAppPathProvider(); | ||
|
||
@override | ||
Future<String> getApplicationSupportPath() async { | ||
return Directory.current.path; | ||
} | ||
|
||
@override | ||
Future<String> getTemporaryPath() async { | ||
return Directory.systemTemp.path; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...gging_cloudwatch/aws_logging_cloudwatch/lib/src/path_provider/app_path_provider_stub.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import 'package:amplify_core/amplify_core.dart'; | ||
|
||
/// {@template aws_logging_cloudwatch.app_path_provider} | ||
/// Provides App paths for amplify_storage_s3_dart package. | ||
/// {@endtemplate} | ||
class DartAppPathProvider implements AppPathProvider { | ||
/// {@macro aws_logging_cloudwatch.app_path_provider} | ||
const DartAppPathProvider(); | ||
|
||
@override | ||
Future<String> getApplicationSupportPath() async { | ||
throw UnimplementedError( | ||
'getApplicationSupportPath() has not been implemented in the current platform.', | ||
); | ||
} | ||
|
||
@override | ||
Future<String> getTemporaryPath() async { | ||
throw UnimplementedError( | ||
'getTemporaryPath() has not been implemented in the current platform.', | ||
); | ||
} | ||
} |