thl 6 gadi atpakaļ
vecāks
revīzija
af15bb6a9c
5 mainītis faili ar 15 papildinājumiem un 10 dzēšanām
  1. 4 0
      CHANGELOG.md
  2. 1 1
      README.md
  3. 8 7
      lib/src/directory_util.dart
  4. 1 1
      lib/src/sp_util.dart
  5. 1 1
      pubspec.yaml

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+### 0.2.6+1
+
+* TODO: fix path_provider compatible.
+
 ### 0.2.6
 
 * TODO: dependencies common_utils ,new DirectoryUtil, SpUtil add getObj,getObjList, ScreenUtil add getAdapterSize, getAdapterSizeCtx.

+ 1 - 1
README.md

@@ -14,7 +14,7 @@ flustars依赖于Dart常用工具类库[common_utils](https://github.com/Sky24n/
 ### 使用方式:
 ```dart
 dependencies:
-  flustars: ^0.2.6
+  flustars: ^0.2.6+1
   
 import 'package:flustars/flustars.dart';  
 ```

+ 8 - 7
lib/src/directory_util.dart

@@ -74,7 +74,7 @@ class DirectoryUtil {
 
   DirectoryUtil._();
 
-  void _init() async {
+  Future _init() async {
     if (_initTempDir) {
       await initTempDir();
     }
@@ -86,26 +86,27 @@ class DirectoryUtil {
     }
   }
 
-  static void initTempDir() async {
+  static Future initTempDir() async {
     if (_tempDir == null) {
       _tempDir = await getTemporaryDirectory();
     }
   }
 
-  static void initAppDocDir() async {
+  static Future initAppDocDir() async {
     if (_appDocDir == null) {
       _appDocDir = await getApplicationDocumentsDirectory();
     }
   }
 
-  static void initStorageDir() async {
+  static Future initStorageDir() async {
     if (_storageDir == null) {
       if (Platform.isAndroid) {
         _storageDir = await getExternalStorageDirectory();
       }
-      if (Platform.isIOS) {
-        _storageDir = await getApplicationSupportDirectory();
-      }
+// 考虑旧版兼容问题,暂时屏蔽。该方法在v1.1.0才有。
+//      if (Platform.isIOS) {
+//        _storageDir = await getApplicationSupportDirectory();
+//      }
     }
   }
 

+ 1 - 1
lib/src/sp_util.dart

@@ -36,7 +36,7 @@ class SpUtil {
 
   SpUtil._();
 
-  void _init() async {
+  Future _init() async {
     _prefs = await SharedPreferences.getInstance();
   }
 

+ 1 - 1
pubspec.yaml

@@ -1,6 +1,6 @@
 name: flustars
 description: Flutter common utils library. SpUtil, ScreenUtil, WidgetUtil. SharedPreferences Util. Screen info & Screen adaptation. get image size.
-version: 0.2.6
+version: 0.2.6+1
 author: Sky24n <863764940@qq.com>
 homepage: https://github.com/Sky24n/flustars