From 7876e8829594c79b020b2337bf9450ef76d38087 Mon Sep 17 00:00:00 2001 From: Michael Klimushyn Date: Tue, 19 Nov 2019 10:40:17 -0800 Subject: [PATCH] [path_provider] Add missing DartDocs Also adds a lint to prevent future undocumented public APIs. --- packages/path_provider/CHANGELOG.md | 6 +++- packages/path_provider/analysis_options.yaml | 11 ++++++ packages/path_provider/example/lib/main.dart | 2 ++ packages/path_provider/lib/path_provider.dart | 36 +++++++++++++++++++ packages/path_provider/pubspec.yaml | 2 +- 5 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 packages/path_provider/analysis_options.yaml diff --git a/packages/path_provider/CHANGELOG.md b/packages/path_provider/CHANGELOG.md index 92ee15cbd918..a8c91a2071f5 100644 --- a/packages/path_provider/CHANGELOG.md +++ b/packages/path_provider/CHANGELOG.md @@ -1,6 +1,10 @@ +## 1.4.3 + +* Add missing DartDocs and a lint to prevent further regressions. + ## 1.4.2 -* Update and migrate iOS example project by removing flutter_assets, change +* Update and migrate iOS example project by removing flutter_assets, change "English" to "en", remove extraneous xcconfigs, update to Xcode 11 build settings, remove ARCHS, and build pods as libraries instead of frameworks. diff --git a/packages/path_provider/analysis_options.yaml b/packages/path_provider/analysis_options.yaml new file mode 100644 index 000000000000..4d3c53a24cab --- /dev/null +++ b/packages/path_provider/analysis_options.yaml @@ -0,0 +1,11 @@ +# This exists to add a lint for missing API docs just on this specific package, +# since not all packages have coverage for all their public members yet and +# adding it in would be non-trivial. `public_member_api_docs` should be applied +# to new packages going forward, and ideally the main `analysis_options.yaml` +# file as soon as possible. + +include: ../../analysis_options.yaml + +linter: + rules: + - public_member_api_docs diff --git a/packages/path_provider/example/lib/main.dart b/packages/path_provider/example/lib/main.dart index ea12999bf415..ce496e9d4e63 100644 --- a/packages/path_provider/example/lib/main.dart +++ b/packages/path_provider/example/lib/main.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// ignore_for_file: public_member_api_docs + import 'dart:async'; import 'dart:io'; diff --git a/packages/path_provider/lib/path_provider.dart b/packages/path_provider/lib/path_provider.dart index 3840121c8c4b..52aceb786477 100644 --- a/packages/path_provider/lib/path_provider.dart +++ b/packages/path_provider/lib/path_provider.dart @@ -14,6 +14,8 @@ const MethodChannel _channel = Platform _platform = const LocalPlatform(); +/// This API is only exposed for the unit tests. It should not be used by +/// any code outside of the plugin itself. @visibleForTesting void setMockPathProviderPlatform(Platform platform) { _platform = platform; @@ -141,15 +143,49 @@ Future> getExternalCacheDirectories() async { /// /// https://developer.android.com/reference/android/os/Environment.html#fields_1 enum StorageDirectory { + /// Contains audio files that should be treated as music. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_MUSIC. music, + + /// Contains audio files that should be treated as podcasts. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_PODCASTS. podcasts, + + /// Contains audio files that should be treated as ringtones. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_RINGTONES. ringtones, + + /// Contains audio files that should be treated as alarm sounds. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_ALARMS. alarms, + + /// Contains audio files that should be treated as notification sounds. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_NOTIFICATIONS. notifications, + + /// Contains images. See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_PICTURES. pictures, + + /// Contains movies. See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_MOVIES. movies, + + /// Contains files of any type that have been downloaded by the user. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOWNLOADS. downloads, + + /// Used to hold both pictures and videos when the device filesystem is + /// treated like a camera's. + /// + /// See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DCIM. dcim, + + /// Holds user-created documents. See https://developer.android.com/reference/android/os/Environment.html#DIRECTORY_DOCUMENTS. documents, } diff --git a/packages/path_provider/pubspec.yaml b/packages/path_provider/pubspec.yaml index 7350124ef32e..d9d39409ae7f 100644 --- a/packages/path_provider/pubspec.yaml +++ b/packages/path_provider/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for getting commonly used locations on the Android & iOS file systems, such as the temp and app data directories. author: Flutter Team homepage: https://github.com/flutter/plugins/tree/master/packages/path_provider -version: 1.4.2 +version: 1.4.3 flutter: plugin: