path_provider 1.5.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 98

path_provider #

pub package

Flutter插件,用于查找文件系统上的常用位置. 支持iOS和Android.

Usage #

要使用此插件,请将path_provider作为依赖项添加到pubspec.yaml文件中 .

Example #

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;

请参阅此插件的示例应用程序以获取完整示例.

1.5.1 #

  • 从pubspec.yaml中删除不推荐使用的author:字段
  • 将插件迁移到pubspec平台清单.
  • 需要Flutter SDK 1.10.0或更高版本.

1.5.0 #

  • 添加macOS支持.

1.4.5 #

  • 添加对v2插件API的支持.

1.4.4 #

  • 将示例应用程序中的驱动程序测试更新为e2e测试.

1.4.3 #

  • 将示例应用程序中的驱动程序测试更新为e2e测试.
  • 添加缺少的DartDocs和棉绒以防止进一步退化.

1.4.2 #

  • 通过删除flutter_assets,将" English"更改为" en",删除无关的xcconfig,更新为Xcode 11构建设置,删除ARCHS以及将Pod构建为库而不是框架来更新和迁移iOS示例项目.

1.4.1 #

  • 删除AndroidX警告.

1.4.0 #

  • 支持通过多个外部存储选项检索Android设备上的存储路径. 这将添加一个新类AndroidEnvironment ,该类可AndroidEnvironment Androids android.os.Environment类的目录名称.
  • 修复了getLibraryDirectory语义和测试.

1.3.1 #

  • 定义iOS的clang模块.

1.3.0 #

  • getLibraryDirectory添加了仅iOS支持.
  • 更新集成测试和示例测试.
  • 更新示例应用程序用户界面以使用ListView显示内容列表.
  • 更新.gitignore以包括Xcode构建输出文件夹**/DerivedData/

1.2.2 #

  • 更正Android的getApplicationSupportDirectory调用的集成测试.
  • 介绍用于API的setMockPathProviderPlatform以进行测试.
  • Adds missing unit and integration tests.

1.2.1 #

  • 修复由于错误而导致的崩溃.

1.2.0 #

  • 在Android上,现在使用getFilesDir支持getApplicationSupportDirectory .
  • 现在,如果没有可用的外部文件目录,则getExternalStorageDirectory返回null而不是引发异常.

1.1.2 #

  • getExternalStorageDirectory现在使用getExternalFilesDir在Android上.

1.1.1 #

  • 在iOS错误字符串中将错误代码强制转换为long,以确保arm32和arm64之间的兼容性.

1.1.0 #

  • Added getApplicationSupportDirectory.
  • 更新了getApplicationDocumentsDirectory文档,以建议在iOS上使用getApplicationSupportDirectory ,在Android上使用getExternalStorageDirectory .
  • 更新了getTemporaryDirectory文档,建议将其用于不需要备份的文件的缓存.
  • 更新了集成测试和示例以反映上述更改.

1.0.0 #

  • 添加了集成测试.

0.5.0+1 #

  • 在构建时记录有关先前AndroidX迁移的更详细的警告.

0.5.0 #

  • 零钱 . 从已弃用的原始Android支持库迁移到AndroidX. 这不应该导致任何功能上的变化,但是如果使用原始支持库的话,则要求使用此插件的所有Android应用程序也要迁移 .

0.4.1 #

  • 更新了Gradle工具以匹配Android Studio 3.1.2.

0.4.0 #

  • 零钱 . 设置SDK约束以匹配Flutter beta版本.

0.3.1 #

  • 将Android项目模板简化并升级到Android SDK 27.
  • 更新了软件包说明.

0.3.0 #

  • 零钱 . 升级到Gradle 4.1和Android Studio Gradle插件3.0.1. 较早的Flutter项目也需要升级其Gradle设置才能使用此版本的插件. 说明可以在这里找到.

0.2.2 #

  • 将FLT前缀添加到iOS类型

0.2.1+1 #

  • 更新的自述文件

0.2.1 #

  • 添加功能以确定外部存储目录.

0.2.0 #

0.1.3 #

  • 将Android SDK构建工具升级到25.0.3.

0.1.2 #

  • 添加测试.

0.1.1 #

  • 更改为README.md.

0.1.0 #

  • 初始开源版本.

example/README.md

path_provider_example #

演示如何使用path_provider插件.

Getting Started #

要获得Flutter入门方面的帮助,请查看我们的在线文档 .

Use this package as a library

1. Depend on it

将此添加到包的pubspec.yaml文件中:


dependencies:
  path_provider: ^1.5.1

2. Install it

您可以从命令行安装软件包:

使用Flutter:


$ flutter pub get

另外,您的编辑器可能支持flutter pub get . 查看您的编辑器文档以了解更多信息.

3. Import it

现在,在Dart代码中,您可以使用:


import 'package:path_provider/path_provider.dart';
  
Popularity:
描述该程序包相对于其他程序包的受欢迎程度. [更多]
100
Health:
从静态分析得出的代码运行状况. [更多]
100
Maintenance:
反映出软件包的整洁和最新状态. [更多]
90
Overall:
以上的加权分数. [更多]
98
了解有关得分的更多信息.

我们在2020年1月21日对该程序包进行了分析,并在下面提供了得分,详细信息和建议. using: 分析已完成,状态使用以下命令 :

  • 飞镖:2.7.0
  • 高达:0.13.4
  • Flutter:1.12.13 + hotfix.5

Maintenance issues and suggestions

确保dartdoc在包的源文件上成功运行. (-10分)

运行dartdoc失败,并显示以下输出:DetailedApiRequestError(状态:504,消息dartdoc

#0      _validateResponse (package:_discoveryapis_commons/src/clients.dart:852:9)
<asynchronous suspension>
#1      ApiRequester.request (package:_discoveryapis_commons/src/clients.dart:74:22)
<asynchronous suspension>
#2      ObjectsResourceApi.list (package:googleapis/storage/v1.dart:3481:32)
#3      _BucketImpl._listObjects (package:gcloud/src/storage_impl.dart:274:25)
#4      _BucketImpl.list.firstPage (package:gcloud/src/storage_impl.dart:240:14)
#5      StreamFromPages._onListen (package:gcloud/common.dart:72:5)
#6      _runGuarded (dart:async/stream_controller.dart:807:24)
#7      _StreamController._subscribe.<anonymous closure> (dart:async/stream_controller.dart:686:7)
#8      _BufferingStreamSubscription._guardCallback (dart:async/stream_impl.dart:416:13)
#9      _StreamController._subscribe (dart:async/stream_controller.dart:685:18)
#10     _ControllerStream._createSubscription (dart:async/stream_controller.dart:820:19)
#11     _StreamImpl.listen (dart:async/stream_impl.dart:474:9)
#12     _StreamIterator._initializeOrDone (dart:async/stream_impl.dart:1006:30)
#13     _StreamIterator.moveNext (dart:async/stream_impl.dart:993:12)
#14     DartdocBackend._listEntries.<anonymous closure> (package:pub_dev/dartdoc/backend.dart)
#15     RetryOptions.retry (package:retry/retry.dart:130:24)
<asynchronous suspension>
#16     retry (package:retry/retry.dart:187:7)
#17     DartdocBackend._listEntries (package:pub_dev/dartdoc/backend.dart:379:12)
#18     DartdocBackend.getLatestEntry (package:pub_dev/dartdoc/backend.dart:228:15)
#19     DartdocJobProcessor.process (package:pub_dev/dartdoc/dartdoc_runner.dart:236:45)
<asynchronous suspension>
#20     JobProcessor.run (package:pub_dev/job/job.dart:55:28)
<asynchronous suspension>
#21     JobMaintenance.run (package:pub_dev/job/job.dart:95:18)
#22     _workerMain.<anonymous closure> (package:pub_dev/service/entrypoint/dartdoc.dart:105:26)
#23     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#24     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#25     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#26     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#27     _rootRunUnary (dart:async/zone.dart:1134:38)
#28     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#29     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#30     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#31     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#32     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#33     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#34     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#35     DartdocJobProcessor.generateDocsForSdk (package:pub_dev/dartdoc/dartdoc_runner.dart)
#36     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#37     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#38     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#39     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#40     _rootRunUnary (dart:async/zone.dart:1134:38)
#41     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#42     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#43     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#44     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#45     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#46     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#47     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#48     VersionedJsonStorage.hasCurrentData (package:pub_dev/shared/storage.dart)
#49     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#50     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#51     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#52     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#53     _rootRunUnary (dart:async/zone.dart:1134:38)
#54     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#55     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#56     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#57     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#58     Future._completeWithValue (dart:async/future_impl.dart:524:5)
#59     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:32:15)
#60     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:290:13)
#61     ApiRequester.request (package:_discoveryapis_commons/src/clients.dart)
#62     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
#63     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#64     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#65     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#66     _rootRunUnary (dart:async/zone.dart:1134:38)
#67     _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#68     _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
#69     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
#70     Future._propagateToListeners (dart:async/future_impl.dart:709:32)
#71     Future._complete (dart:async/future_impl.dart:514:7)
#72     Stream.join.<anonymous closure> (dart:async/stream.dart:844:18)
#73     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#74     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#75     _rootRun (dart:async/zone.dart:1122:38)
#76     _CustomZone.run (dart:async/zone.dart:1023:19)
#77     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#78     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:391:13)
#79     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:401:15)
#80     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:285:7)
#81     _SinkTransformerStreamSubscription._close (dart:async/stream_transformers.dart:98:11)
#82     _EventSinkWrapper.close (dart:async/stream_transformers.dart:25:11)
#83     _StringAdapterSink.close (dart:convert/string_conversion.dart:251:11)
#84     _Utf8ConversionSink.close (dart:convert/string_conversion.dart:302:20)
#85     _ConverterStreamEventSink.close (dart:convert/chunked_conversion.dart:82:18)
#86     _SinkTransformerStreamSubscription._handleDone (dart:async/stream_transformers.dart:143:24)
#87     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#88     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#89     _rootRun (dart:async/zone.dart:1122:38)
#90     _CustomZone.run (dart:async/zone.dart:1023:19)
#91     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#92     _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:391:13)
#93     _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:401:15)
#94     _BufferingStreamSubscription._close (dart:async/stream_impl.dart:285:7)
#95     _ForwardingStream._handleDone (dart:async/stream_pipe.dart:108:10)
#96     _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:174:13)
#97     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#98     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#99     _rootRun (dart:async/zone.dart:1122:38)
#100    _CustomZone.run (dart:async/zone.dart:1023:19)
#101    _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#102    _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:391:13)
#103    _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:401:15)
#104    _BufferingStreamSubscription._close (dart:async/stream_impl.dart:285:7)
#105    _ForwardingStream._handleDone (dart:async/stream_pipe.dart:108:10)
#106    _ForwardingStreamSubscription._handleDone (dart:async/stream_pipe.dart:174:13)
#107    StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#108    StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#109    _rootRun (dart:async/zone.dart:1122:38)
#110    _CustomZone.run (dart:async/zone.dart:1023:19)
#111    _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#112    _BufferingStreamSubscription._sendDone.sendDone (dart:async/stream_impl.dart:391:13)
#113    _BufferingStreamSubscription._sendDone (dart:async/stream_impl.dart:401:15)
#114    _BufferingStreamSubscription._close (dart:async/stream_impl.dart:285:7)
#115    _SyncStreamControllerDispatch._sendDone (dart:async/stream_controller.dart:774:19)
#116    _StreamController._closeUnchecked (dart:async/stream_controller.dart:631:7)
#117    _StreamController.close (dart:async/stream_controller.dart:624:5)
#118    _HttpParser._closeIncoming (dart:_http/http_parser.dart:1039:23)
#119    _HttpParser._doParse (dart:_http/http_parser.dart:777:15)
#120    _HttpParser._parse (dart:_http/http_parser.dart:320:7)
#121    _HttpParser._onData (dart:_http/http_parser.dart:812:5)
#122    StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#123    StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#124    StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#125    _rootRunUnary (dart:async/zone.dart:1134:38)
#126    _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#127    _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#128    _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:338:11)
#129    _BufferingStreamSubscription._add (dart:async/stream_impl.dart:265:7)
#130    _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:766:19)
#131    _StreamController._add (dart:async/stream_controller.dart:642:7)
#132    _StreamController.add (dart:async/stream_controller.dart:588:5)
#133    _Socket._onData (dart:io-patch/socket_patch.dart:1831:41)
#134    StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#135    StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#136    StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#137    _rootRunUnary (dart:async/zone.dart:1134:38)
#138    _CustomZone.runUnary (dart:async/zone.dart:1031:19)
#139    _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
#140    _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:338:11)
#141    _BufferingStreamSubscription._add (dart:async/stream_impl.dart:265:7)
#142    _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:766:19)
#143    _StreamController._add (dart:async/stream_controller.dart:642:7)
#144    _StreamController.add (dart:async/stream_controller.dart:588:5)
#145    _RawSecureSocket._sendReadEvent (dart:io/secure_socket.dart:1018:19)
#146    StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#147    StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#148    _rootRun (dart:async/zone.dart:1122:38)
#149    _CustomZone.run (dart:async/zone.dart:1023:19)
#150    _CustomZone.runGuarded (dart:async/zone.dart:925:7)
#151    _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
#152    StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#153    StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#154    _rootRun (dart:async/zone.dart:1126:13)
#155    _CustomZone.run (dart:async/zone.dart:1023:19)
#156    _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
#157    Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
#158    _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
#159    _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
#160    _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

Dependencies

Package Constraint Resolved Available
直接依赖
Dart SDK > = 2.0.0-dev.28.0 <3.0.0
flutter 0.0.0
meta ^1.0.5 1.1.8
platform ^2.0.0 2.2.1
传递依存关系
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
开发依赖
e2e ^0.2.1
flutter_driver
flutter_test
test any
uuid ^1.0.0

by  ICOPY.SITE