Skip to content

Commit fb653ab

Browse files
committed
(#111) Deprecate non SAF members
1 parent 522fc07 commit fb653ab

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

lib/src/environment/environment.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import 'environment_directory.dart';
77
/// Equivalent to `Environment.getRootDirectory`
88
///
99
/// [Refer to details](https://developer.android.com/reference/android/os/Environment#getRootDirectory%28%29)
10+
@Deprecated(
11+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
12+
)
1013
Future<Directory?> getRootDirectory() async {
1114
const kGetRootDirectory = 'getRootDirectory';
1215

@@ -49,6 +52,9 @@ Future<Directory?> getExternalStoragePublicDirectory(
4952
/// Equivalent to `Environment.getExternalStorageDirectory`
5053
///
5154
/// [Refer to details](https://developer.android.com/reference/android/os/Environment#getExternalStorageDirectory%28%29)
55+
@Deprecated(
56+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
57+
)
5258
Future<Directory?> getExternalStorageDirectory() async {
5359
const kGetExternalStorageDirectory = 'getExternalStorageDirectory';
5460

@@ -58,6 +64,9 @@ Future<Directory?> getExternalStorageDirectory() async {
5864
/// Equivalent to `Environment.getDataDirectory`
5965
///
6066
/// [Refer to details](https://developer.android.com/reference/android/os/Environment#getDataDirectory%28%29)
67+
@Deprecated(
68+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
69+
)
6170
Future<Directory?> getDataDirectory() async {
6271
const kGetDataDirectory = 'getDataDirectory';
6372

@@ -67,6 +76,9 @@ Future<Directory?> getDataDirectory() async {
6776
/// Equivalent to `Environment.getDataDirectory`
6877
///
6978
/// [Refer to details](https://developer.android.com/reference/android/os/Environment#getDownloadCacheDirectory%28%29)
79+
@Deprecated(
80+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
81+
)
7082
Future<Directory?> getDownloadCacheDirectory() async {
7183
const kGetDownloadCacheDirectory = 'getDownloadCacheDirectory';
7284

@@ -76,6 +88,9 @@ Future<Directory?> getDownloadCacheDirectory() async {
7688
/// Equivalent to `Environment.getStorageDirectory`
7789
///
7890
/// [Refer to details](https://developer.android.com/reference/android/os/Environment#getStorageDirectory%28%29)
91+
@Deprecated(
92+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
93+
)
7994
Future<Directory?> getStorageDirectory() {
8095
const kGetStorageDirectory = 'getStorageDirectory';
8196

lib/src/environment/environment_directory.dart

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,76 @@ class EnvironmentDirectory {
2020
/// Available for Android [4.1 to 9.0]
2121
///
2222
/// Equivalent to [Environment.DIRECTORY_ALARMS]
23+
@Deprecated(
24+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
25+
)
2326
static const alarms = EnvironmentDirectory._('$_kPrefix.Alarms');
2427

2528
/// Available for Android [4.1 to 9]
2629
///
2730
/// Equivalent to:
2831
/// - [Environment.DIRECTORY_DCIM] on Android [4.1 to 9]
32+
@Deprecated(
33+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
34+
)
2935
static const dcim = EnvironmentDirectory._('$_kPrefix.DCIM');
3036

3137
/// Available for Android [4.1 to 9]
3238
///
3339
/// Equivalent to:
3440
/// - [Environment.DIRECTORY_DOWNLOADS] on Android [4.1 to 9]
41+
@Deprecated(
42+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
43+
)
3544
static const downloads = EnvironmentDirectory._('$_kPrefix.Downloads');
3645

3746
/// Available for Android [4.1 to 9]
3847
///
3948
/// - [Environment.DIRECTORY_MOVIES] on Android [4.1 to 9]
49+
@Deprecated(
50+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
51+
)
4052
static const movies = EnvironmentDirectory._('$_kPrefix.Movies');
4153

4254
/// Available for Android [4.1 to 9]
4355
///
4456
/// - [Environment.DIRECTORY_MUSIC] on Android [4.1 to 9]
57+
@Deprecated(
58+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
59+
)
4560
static const music = EnvironmentDirectory._('$_kPrefix.Music');
4661

4762
/// Available for Android [4.1 to 9]
4863
///
4964
/// - [Environment.DIRECTORY_NOTIFICATIONS] on Android [4.1 to 9]
65+
@Deprecated(
66+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
67+
)
5068
static const notifications =
5169
EnvironmentDirectory._('$_kPrefix.Notifications');
5270

5371
/// Available for Android [4.1 to 9]
5472
///
5573
/// - [Environment.DIRECTORY_PICTURES] on Android [4.1 to 9]
74+
@Deprecated(
75+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
76+
)
5677
static const pictures = EnvironmentDirectory._('$_kPrefix.Pictures');
5778

5879
/// Available for Android [4.1 to 9]
5980
///
6081
/// - [Environment.DIRECTORY_PODCASTS] on Android [4.1 to 9]
82+
@Deprecated(
83+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
84+
)
6185
static const podcasts = EnvironmentDirectory._('$_kPrefix.Podcasts');
6286

6387
/// Available for Android [4.1 to 9]
6488
///
6589
/// - [Environment.DIRECTORY_RINGTONES] on Android [4.1 to 9]
90+
@Deprecated(
91+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
92+
)
6693
static const ringtones = EnvironmentDirectory._('$_kPrefix.Ringtones');
6794

6895
@override

lib/src/media_store/media_store.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'media_store_collection.dart';
66
/// Get the directory of a given [MediaStoreCollection]
77
///
88
/// [Refer to details](https://developer.android.com/reference/android/provider/MediaStore#summary)
9+
@Deprecated(
10+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
11+
)
912
Future<Uri?> getMediaStoreContentDirectory(
1013
MediaStoreCollection collection,
1114
) async {

lib/src/media_store/media_store_collection.dart

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,36 @@ class MediaStoreCollection {
1212
///
1313
/// Equivalent to:
1414
/// - [MediaStore.Audio]
15+
@Deprecated(
16+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
17+
)
1518
static const audio = MediaStoreCollection._('$_kPrefix.Audio');
1619

1720
/// Available for Android [10 to 12]
1821
///
1922
/// Equivalent to:
2023
/// - [MediaStore.Downloads]
24+
@Deprecated(
25+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
26+
)
2127
static const downloads = MediaStoreCollection._('$_kPrefix.Downloads');
2228

2329
/// Available for Android [10 to 12]
2430
///
2531
/// Equivalent to:
2632
/// - [MediaStore.Images]
33+
@Deprecated(
34+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
35+
)
2736
static const images = MediaStoreCollection._('$_kPrefix.Images');
2837

2938
/// Available for Android [10 to 12]
3039
///
3140
/// Equivalent to:
3241
/// - [MediaStore.Video]
42+
@Deprecated(
43+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
44+
)
3345
static const video = MediaStoreCollection._('$_kPrefix.Video');
3446

3547
@override
@@ -41,5 +53,8 @@ class MediaStoreCollection {
4153
int get hashCode => id.hashCode;
4254

4355
@override
56+
@Deprecated(
57+
'Android specific APIs will be removed soon in order to be replaced with a new set of original cross-platform APIs.',
58+
)
4459
String toString() => id;
4560
}

0 commit comments

Comments
 (0)