Forráskód Böngészése

v2.0.0 migrate to null-safety

thl 4 éve
szülő
commit
77387b5200

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+## 2.0.0
+
+* TODO: Migrate to null-safety.
+
 ## 0.3.3
 
 * TODO: split [sp_util](https://github.com/Sky24n/sp_util) as a separate library.

+ 9 - 7
README-EN.md

@@ -7,14 +7,14 @@ Flutter common utils library, SharedPreferences Util, Screen Util, Directory Uti
 
 Pub [flustars](https://pub.flutter-io.cn/packages/flustars)
 
-[✓] Flutter (Channel stable, v1.17.0, locale zh-Hans-CN)
+[✓] Flutter (Channel stable, v2.0.0, locale zh-Hans-CN)
 
 ## Get started
 
 ### Add dependency
 ```yaml
 dependencies:
-  flustars: ^0.3.2
+  flustars: ^2.0.0
   
 import 'package:flustars/flustars.dart';
 
@@ -28,6 +28,8 @@ dependencies:
 ```
 
 ### [Change Log](CHANGE_LOG.md)
+v2.0.0  
+Migrate to null-safety.
 
 v0.3.2
 remove MyAppBar。
@@ -534,10 +536,6 @@ I/flutter ( 5922): [response  ]:   {data: {curPage: 1, datas: [], offset: 0, ove
 >    - |-- timer_page.dart 倒计时/定时任务示例
 >    - |-- widget_page.dart 获取Widget尺寸/屏幕坐标示例
 
-## 点击下载APK : [v0.1.x][flutter_wanandroid_apk] 
-## 扫码下载APK :
-  ![flutter_wanandroid][flutter_wanandroid_qr] 
-
 ### Screenshots
 <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20181003-234414.jpg" width="200">   <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20181003-211011.jpg" width="200">   <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20180930-012302.jpg" width="200">  
 <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20180930-012431.jpg" width="200">  <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20180919-231618.jpg" width="200">   <img src="https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppImgs/flutter_demos/Screenshot_20180926-144840.png" width="200">  
@@ -546,7 +544,11 @@ I/flutter ( 5922): [response  ]:   {data: {curPage: 1, datas: [], offset: 0, ove
 ### 关于作者
 GitHub : [Sky24n](https://github.com/Sky24n)  
 简书 &nbsp;&nbsp;&nbsp;&nbsp;: [Sky24n](https://www.jianshu.com/u/cbf2ad25d33a)  
-掘金 &nbsp;&nbsp;&nbsp;&nbsp;: [Sky24n](https://juejin.im/user/5b9e8a92e51d453df0440422/posts)  
+掘金 &nbsp;&nbsp;&nbsp;&nbsp;: [Sky24n](https://juejin.im/user/5b9e8a92e51d453df0440422/posts)
+
+### Apps
+[flutter_wanandroid](https://github.com/Sky24n/flutter_wanandroid)  
+[Moss App](https://github.com/Sky24n/Moss)
  
 [flutter_wanandroid_github]: https://github.com/Sky24n/flutter_wanandroid
 [flutter_wanandroid_apk]: https://raw.githubusercontent.com/Sky24n/LDocuments/master/AppStore/flutter_wanandroid.apk

+ 9 - 10
README.md

@@ -7,19 +7,22 @@ Language: [English](README-EN.md) | 中文简体
 flustars依赖于Dart常用工具类库[common_utils](https://github.com/Sky24n/common_utils),以及对其他第三方库封装,致力于为大家分享简单易用工具类。如果你有好的工具类欢迎PR.  
 目前包含SharedPreferences Util, Screen Util, Directory Util, Widget Util, Image Util。
 
-[✓] Flutter (Channel stable, v1.17.0, locale zh-Hans-CN)
+[✓] Flutter (Channel stable, v2.0.0, locale zh-Hans-CN)
 
 ### Pub
 ```yaml
 dependencies:
-  flustars: ^0.3.3
+  flustars: ^2.0.0
   
   # https://github.com/Sky24n/sp_util
   # sp_util分拆成单独的库,可以直接引用
-  sp_util: ^1.0.1
+  sp_util: ^2.0.0
 ```
 
 ### [Change Log](CHANGE_LOG.md)
+v2.0.0  
+Migrate to null-safety.
+
 v0.3.3  
 分拆[sp_util](https://github.com/Sky24n/sp_util)成单独的库,可以直接引用
 
@@ -350,19 +353,15 @@ I/flutter ( 5922): [reqdata   ]:   null
 I/flutter ( 5922): [response  ]:   {data: {curPage: 1, datas: [], offset: 0, over: true, pageCount: 0, size: 20, total: 0}, errorCode: 0, errorMsg: }
 ```
 
-### App
-Github:[flutter_wanandroid](https://github.com/Sky24n/flutter_wanandroid)  
-Apk &nbsp;&nbsp;&nbsp;&nbsp;:[Demos](https://github.com/Sky24n/Doc)
-
 ### 关于作者
 GitHub &nbsp;&nbsp;&nbsp;: [Sky24n](https://github.com/Sky24n)  
 简书 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: [Sky24n](https://www.jianshu.com/u/cbf2ad25d33a)  
 掘金 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: [Sky24n](https://juejin.im/user/5b9e8a92e51d453df0440422/posts)  
 项目合集 : [FlutterRepos](https://github.com/Sky24n/FlutterRepos)
 
-⭐⭐⭐ 最新开源 ⭐⭐⭐  
-[nine_grid_view](https://github.com/flutterchina/nine_grid_view)  
-Flutter仿微信/微博九宫格、拖拽排序,钉钉群组,微信群组,QQ讨论组头像。
+### Apps
+[flutter_wanandroid](https://github.com/Sky24n/flutter_wanandroid)  
+[Moss App](https://github.com/Sky24n/Moss)
 
 
 [flutter_wanandroid_github]: https://github.com/Sky24n/flutter_wanandroid

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1
example/.flutter-plugins-dependencies


+ 51 - 51
lib/src/directory_util.dart

@@ -33,10 +33,10 @@ bool _initStorageDir = false;
 
 /// 配置初始化Directory。
 void setInitDir({
-  bool initTempDir,
-  bool initAppDocDir,
-  bool initAppSupportDir,
-  bool initStorageDir,
+  bool? initTempDir,
+  bool? initAppDocDir,
+  bool? initAppSupportDir,
+  bool? initStorageDir,
 }) {
   _initTempDir = initTempDir ?? _initTempDir;
   _initAppDocDir = initAppDocDir ?? _initAppDocDir;
@@ -54,16 +54,16 @@ void setInitDir({
 
 /// DirectoryUtil。
 class DirectoryUtil {
-  static DirectoryUtil _singleton;
+  static DirectoryUtil? _singleton;
 
   static Lock _lock = Lock();
 
-  static Directory _tempDir;
-  static Directory _appDocDir;
-  static Directory _appSupportDir;
-  static Directory _storageDir;
+  static Directory? _tempDir;
+  static Directory? _appDocDir;
+  static Directory? _appSupportDir;
+  static Directory? _storageDir;
 
-  static Future<DirectoryUtil> getInstance() async {
+  static Future<DirectoryUtil?> getInstance() async {
     if (_singleton == null) {
       await _lock.synchronized(() async {
         if (_singleton == null) {
@@ -98,28 +98,28 @@ class DirectoryUtil {
         "thll DirectoryUtil init : ${DateTime.now().millisecondsSinceEpoch - old}");
   }
 
-  static Future<Directory> initTempDir() async {
+  static Future<Directory?> initTempDir() async {
     if (_tempDir == null) {
       _tempDir = await getTemporaryDirectory();
     }
     return _tempDir;
   }
 
-  static Future<Directory> initAppDocDir() async {
+  static Future<Directory?> initAppDocDir() async {
     if (_appDocDir == null) {
       _appDocDir = await getApplicationDocumentsDirectory();
     }
     return _appDocDir;
   }
 
-  static Future<Directory> initAppSupportDir() async {
+  static Future<Directory?> initAppSupportDir() async {
     if (_appSupportDir == null) {
       _appSupportDir = await getApplicationSupportDirectory();
     }
     return _appSupportDir;
   }
 
-  static Future<Directory> initStorageDir() async {
+  static Future<Directory?> initStorageDir() async {
     if (_storageDir == null) {
       if (Platform.isAndroid) {
         _storageDir = await getExternalStorageDirectory();
@@ -129,7 +129,7 @@ class DirectoryUtil {
   }
 
   /// 同步创建文件夹
-  static Directory createDirSync(String path) {
+  static Directory? createDirSync(String? path) {
     if (path == null) return null;
     Directory dir = Directory(path);
     if (!dir.existsSync()) {
@@ -139,7 +139,7 @@ class DirectoryUtil {
   }
 
   /// 异步创建文件夹
-  static Future<Directory> createDir(String path) async {
+  static Future<Directory?> createDir(String? path) async {
     if (path == null) return null;
     Directory dir = Directory(path);
     bool exist = await dir.exists();
@@ -154,11 +154,11 @@ class DirectoryUtil {
   /// category 分类,例如:Download,Pictures, Music等等
   /// fileName 文件名
   /// format 文件格式,如果文件名包含格式,则不需要
-  static String getPath(
-    Directory dir, {
-    String category,
-    String fileName,
-    String format,
+  static String? getPath(
+    Directory? dir, {
+    String? category,
+    String? fileName,
+    String? format,
   }) {
     if (dir == null) return null;
     StringBuffer sb = StringBuffer("${dir.path}");
@@ -176,10 +176,10 @@ class DirectoryUtil {
   /// String path = DirectoryUtil.getTempPath(category: 'Pictures', fileName: 'demo', format: 'png');
   /// Android: /data/user/0/com.thl.flustars_example/cache/Pictures/demo.png
   /// iOS: xxx;
-  static String getTempPath({
-    String category,
-    String fileName,
-    String format,
+  static String? getTempPath({
+    String? category,
+    String? fileName,
+    String? format,
   }) {
     return getPath(_tempDir,
         category: category, fileName: fileName, format: format);
@@ -193,10 +193,10 @@ class DirectoryUtil {
   /// String path = DirectoryUtil.getAppDocPath(category: 'Pictures', fileName: 'demo', format: 'png');
   /// Android: /data/user/0/com.thl.flustars_example/app_flutter/Pictures/demo.png
   /// iOS: xxx;
-  static String getAppDocPath({
-    String category,
-    String fileName,
-    String format,
+  static String? getAppDocPath({
+    String? category,
+    String? fileName,
+    String? format,
   }) {
     return getPath(_appDocDir,
         category: category, fileName: fileName, format: format);
@@ -210,10 +210,10 @@ class DirectoryUtil {
   /// String path = DirectoryUtil.getAppSupportPath(category: 'Pictures', fileName: 'demo', format: 'png');
   /// Android: /data/user/0/com.thl.flustars_example/files/Pictures/demo.png
   /// iOS: xxx;
-  static String getAppSupportPath({
-    String category,
-    String fileName,
-    String format,
+  static String? getAppSupportPath({
+    String? category,
+    String? fileName,
+    String? format,
   }) {
     return getPath(_appSupportDir,
         category: category, fileName: fileName, format: format);
@@ -227,8 +227,8 @@ class DirectoryUtil {
   /// String path = DirectoryUtil.getStoragePath(category: 'Download', fileName: 'demo', format: 'apk');
   /// Android: /storage/emulated/0/Android/data/com.thl.flustars_example/files/Download/demo.apk
   /// iOS: xxx;
-  static String getStoragePath(
-      {String category, String fileName, String format}) {
+  static String? getStoragePath(
+      {String? category, String? fileName, String? format}) {
     return getPath(
       _storageDir,
       category: category,
@@ -237,47 +237,47 @@ class DirectoryUtil {
     );
   }
 
-  static Directory createTempDirSync({String category}) {
-    String path = getTempPath(category: category);
+  static Directory? createTempDirSync({String? category}) {
+    String? path = getTempPath(category: category);
     return createDirSync(path);
   }
 
-  static Directory createAppDocDirSync({String category}) {
-    String path = getAppDocPath(category: category);
+  static Directory? createAppDocDirSync({String? category}) {
+    String? path = getAppDocPath(category: category);
     return createDirSync(path);
   }
 
-  static Directory createAppSupportDirSync({String category}) {
-    String path = getAppSupportPath(category: category);
+  static Directory? createAppSupportDirSync({String? category}) {
+    String? path = getAppSupportPath(category: category);
     return createDirSync(path);
   }
 
-  static Directory createStorageDirSync({String category}) {
-    String path = getStoragePath(category: category);
+  static Directory? createStorageDirSync({String? category}) {
+    String? path = getStoragePath(category: category);
     return createDirSync(path);
   }
 
-  static Future<Directory> createTempDir({String category}) async {
+  static Future<Directory?> createTempDir({String? category}) async {
     await initTempDir();
-    String path = getTempPath(category: category);
+    String? path = getTempPath(category: category);
     return createDir(path);
   }
 
-  static Future<Directory> createAppDocDir({String category}) async {
+  static Future<Directory?> createAppDocDir({String? category}) async {
     await initAppDocDir();
-    String path = getAppDocPath(category: category);
+    String? path = getAppDocPath(category: category);
     return createDir(path);
   }
 
-  static Future<Directory> createAppSupportDir({String category}) async {
+  static Future<Directory?> createAppSupportDir({String? category}) async {
     await initAppSupportDir();
-    String path = getAppSupportPath(category: category);
+    String? path = getAppSupportPath(category: category);
     return createDir(path);
   }
 
-  static Future<Directory> createStorageDir({String category}) async {
+  static Future<Directory?> createStorageDir({String? category}) async {
     await initStorageDir();
-    String path = getStoragePath(category: category);
+    String? path = getStoragePath(category: category);
     return createDir(path);
   }
 }

+ 14 - 13
lib/src/image_util.dart

@@ -12,8 +12,8 @@ import 'package:flutter/widgets.dart';
 
 /// Image Util.
 class ImageUtil {
-  ImageStreamListener _listener;
-  ImageStream _imageStream;
+  late ImageStreamListener _listener;
+  late ImageStream _imageStream;
 
   /// get image width height,load error throw exception.(unit px)
   /// 获取图片宽高,加载错误会抛出异常.(单位 px)
@@ -21,11 +21,11 @@ class ImageUtil {
   /// url network
   /// local url , package
   Future<Rect> getImageWH({
-    Image image,
-    String url,
-    String localUrl,
-    String package,
-    ImageConfiguration configuration,
+    Image? image,
+    String? url,
+    String? localUrl,
+    String? package,
+    ImageConfiguration? configuration,
   }) {
     Completer<Rect> completer = Completer<Rect>();
     _listener = ImageStreamListener(
@@ -36,7 +36,7 @@ class ImageUtil {
               0, 0, info.image.width.toDouble(), info.image.height.toDouble()));
         }
       },
-      onError: (dynamic exception, StackTrace stackTrace) {
+      onError: (dynamic exception, StackTrace? stackTrace) {
         _imageStream.removeListener(_listener);
         if (!completer.isCompleted) {
           completer.completeError(exception, stackTrace);
@@ -49,11 +49,12 @@ class ImageUtil {
         (localUrl == null || localUrl.isEmpty)) {
       return Future.value(Rect.zero);
     }
-    Image img = image != null
-        ? image
-        : ((url != null && url.isNotEmpty)
-            ? Image.network(url)
-            : Image.asset(localUrl, package: package));
+    Image? img = image;
+    if (img == null) {
+      img = (url != null && url.isNotEmpty)
+          ? Image.network(url)
+          : Image.asset(localUrl!, package: package);
+    }
     _imageStream = img.image.resolve(configuration ?? ImageConfiguration());
     _imageStream.addListener(_listener);
     return completer.future;

+ 6 - 6
lib/src/screen_util.dart

@@ -23,7 +23,7 @@ double _designD = 3.0;
 
 /// 配置设计稿尺寸 屏幕 宽,高,密度。
 /// Configuration design draft size  screen width, height, density.
-void setDesignWHD(double w, double h, {double density = 3.0}) {
+void setDesignWHD(double? w, double? h, {double? density = 3.0}) {
   _designW = w ?? _designW;
   _designH = h ?? _designH;
   _designD = density ?? _designD;
@@ -37,7 +37,7 @@ class ScreenUtil {
   double _statusBarHeight = 0.0;
   double _bottomBarHeight = 0.0;
   double _appBarHeight = 0.0;
-  MediaQueryData _mediaQueryData;
+  MediaQueryData? _mediaQueryData;
 
   static final ScreenUtil _singleton = ScreenUtil();
 
@@ -83,7 +83,7 @@ class ScreenUtil {
   double get bottomBarHeight => _bottomBarHeight;
 
   /// media Query Data
-  MediaQueryData get mediaQueryData => _mediaQueryData;
+  MediaQueryData? get mediaQueryData => _mediaQueryData;
 
   /// screen width
   /// 当前屏幕 宽
@@ -131,7 +131,7 @@ class ScreenUtil {
   /// 返回根据屏幕宽适配后尺寸(单位 dp or pt)
   /// size 单位 dp or pt
   static double getScaleW(BuildContext context, double size) {
-    if (context == null || getScreenW(context) == 0.0) return size;
+    if (getScreenW(context) == 0.0) return size;
     return size * getScreenW(context) / _designW;
   }
 
@@ -140,7 +140,7 @@ class ScreenUtil {
   /// 返回根据屏幕高适配后尺寸 (单位 dp or pt)
   /// size unit dp or pt
   static double getScaleH(BuildContext context, double size) {
-    if (context == null || getScreenH(context) == 0.0) return size;
+    if (getScreenH(context) == 0.0) return size;
     return size * getScreenH(context) / _designH;
   }
 
@@ -149,7 +149,7 @@ class ScreenUtil {
   /// 返回根据屏幕宽适配后字体尺寸
   /// fontSize 字体尺寸
   static double getScaleSp(BuildContext context, double fontSize) {
-    if (context == null || getScreenW(context) == 0.0) return fontSize;
+    if (getScreenW(context) == 0.0) return fontSize;
     return fontSize * getScreenW(context) / _designW;
   }
 

+ 45 - 36
lib/src/widget_util.dart

@@ -12,8 +12,8 @@ import 'package:flutter/widgets.dart';
 /// Widget Util.
 class WidgetUtil {
   bool _hasMeasured = false;
-  double _width;
-  double _height;
+  double _width = 0;
+  double _height = 0;
 
   /// Widget rendering listener.
   /// Widget渲染监听.
@@ -21,11 +21,11 @@ class WidgetUtil {
   /// isOnce: true,Continuous monitoring  false,Listen only once.
   /// onCallBack: Widget Rect CallBack.
   void asyncPrepare(
-      BuildContext context, bool isOnce, ValueChanged<Rect> onCallBack) {
+      BuildContext context, bool isOnce, ValueChanged<Rect>? onCallBack) {
     if (_hasMeasured) return;
-    WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
-      RenderBox box = context.findRenderObject();
-      if (box != null && box.semanticBounds != null) {
+    WidgetsBinding.instance?.addPostFrameCallback((Duration timeStamp) {
+      RenderBox? box = getRenderBox(context);
+      if (box != null) {
         if (isOnce) _hasMeasured = true;
         double width = box.semanticBounds.width;
         double height = box.semanticBounds.height;
@@ -39,27 +39,34 @@ class WidgetUtil {
   }
 
   /// Widget渲染监听.
-  void asyncPrepares(bool isOnce, ValueChanged<Rect> onCallBack) {
+  void asyncPrepares(bool isOnce, ValueChanged<Rect>? onCallBack) {
     if (_hasMeasured) return;
-    WidgetsBinding.instance.addPostFrameCallback((Duration timeStamp) {
+    WidgetsBinding.instance?.addPostFrameCallback((Duration timeStamp) {
       if (isOnce) _hasMeasured = true;
-      if (onCallBack != null) onCallBack(null);
+      if (onCallBack != null) onCallBack(Rect.zero);
     });
   }
 
   ///get Widget Bounds (width, height, left, top, right, bottom and so on).Widgets must be rendered completely.
   ///获取widget Rect
   static Rect getWidgetBounds(BuildContext context) {
-    RenderBox box = context.findRenderObject();
-    return (box != null && box.semanticBounds != null)
-        ? box.semanticBounds
-        : Rect.zero;
+    RenderBox? box = getRenderBox(context);
+    return box?.semanticBounds ?? Rect.zero;
+  }
+
+  static RenderBox? getRenderBox(BuildContext context) {
+    RenderObject? renderObject = context.findRenderObject();
+    RenderBox? box;
+    if (renderObject != null) {
+      box = renderObject as RenderBox;
+    }
+    return box;
   }
 
   ///Get the coordinates of the widget on the screen.Widgets must be rendered completely.
   ///获取widget在屏幕上的坐标,widget必须渲染完成
   static Offset getWidgetLocalToGlobal(BuildContext context) {
-    RenderBox box = context.findRenderObject();
+    RenderBox? box = getRenderBox(context);
     return box == null ? Offset.zero : box.localToGlobal(Offset.zero);
   }
 
@@ -72,11 +79,11 @@ class WidgetUtil {
   /// url network
   /// local url , package
   static Future<Rect> getImageWH({
-    Image image,
-    String url,
-    String localUrl,
-    String package,
-    ImageConfiguration configuration,
+    Image? image,
+    String? url,
+    String? localUrl,
+    String? package,
+    ImageConfiguration? configuration,
   }) {
     if (image == null &&
         (url == null || url.isEmpty) &&
@@ -84,11 +91,12 @@ class WidgetUtil {
       return Future.value(Rect.zero);
     }
     Completer<Rect> completer = Completer<Rect>();
-    Image img = image != null
-        ? image
-        : ((url != null && url.isNotEmpty)
-            ? Image.network(url)
-            : Image.asset(localUrl, package: package));
+    Image? img = image;
+    if (img == null) {
+      img = (url != null && url.isNotEmpty)
+          ? Image.network(url)
+          : Image.asset(localUrl!, package: package);
+    }
     img.image
         .resolve(configuration ?? ImageConfiguration())
         .addListener(ImageStreamListener(
@@ -98,7 +106,7 @@ class WidgetUtil {
                   info.image.width.toDouble(), info.image.height.toDouble()));
             }
           },
-          onError: (dynamic exception, StackTrace stackTrace) {
+          onError: (dynamic exception, StackTrace? stackTrace) {
             if (!completer.isCompleted) {
               completer.complete(Rect.zero);
             }
@@ -117,11 +125,11 @@ class WidgetUtil {
   /// local url (full path/全路径,example:"assets/images/ali_connors.png",""assets/images/3.0x/ali_connors.png"" );
   /// package
   static Future<Rect> getImageWHE({
-    Image image,
-    String url,
-    String localUrl,
-    String package,
-    ImageConfiguration configuration,
+    Image? image,
+    String? url,
+    String? localUrl,
+    String? package,
+    ImageConfiguration? configuration,
   }) {
     if (image == null &&
         (url == null || url.isEmpty) &&
@@ -129,11 +137,12 @@ class WidgetUtil {
       return Future.error("image is null.");
     }
     Completer<Rect> completer = Completer<Rect>();
-    Image img = image != null
-        ? image
-        : ((url != null && url.isNotEmpty)
-            ? Image.network(url)
-            : Image.asset(localUrl, package: package));
+    Image? img = image;
+    if (img == null) {
+      img = (url != null && url.isNotEmpty)
+          ? Image.network(url)
+          : Image.asset(localUrl!, package: package);
+    }
     img.image
         .resolve(configuration ?? ImageConfiguration())
         .addListener(ImageStreamListener(
@@ -143,7 +152,7 @@ class WidgetUtil {
                   info.image.width.toDouble(), info.image.height.toDouble()));
             }
           },
-          onError: (dynamic exception, StackTrace stackTrace) {
+          onError: (dynamic exception, StackTrace? stackTrace) {
             if (!completer.isCompleted) {
               completer.completeError(exception, stackTrace);
             }

+ 6 - 7
pubspec.yaml

@@ -1,20 +1,19 @@
 name: flustars
 description: Flutter common utils library. SpUtil, ScreenUtil, WidgetUtil, DirectoryUtil, ImageUtil. SharedPreferences Util. Screen info & Screen adaptation. get image size.
-version: 0.3.3
-author: Sky24n <863764940@qq.com>
+version: 2.0.0
 homepage: https://github.com/Sky24n/flustars
 
 environment:
-  sdk: ">=2.0.0 <3.0.0"
+  sdk: ">=2.12.0-259.9.beta <3.0.0"
 
 dependencies:
   flutter:
     sdk: flutter
   # Dart common utils library. https://github.com/Sky24n/common_utils
-  common_utils: '>=1.2.1 <3.0.0'
+  common_utils: '>=2.0.0 <3.0.0'
   # https://github.com/Sky24n/sp_util
-  sp_util: '>=1.0.0 <3.0.0'
+  sp_util: '>=2.0.0 <3.0.0'
   # https://github.com/tekartik/synchronized.dart
-  synchronized: '>=1.5.1 <4.0.0'
+  synchronized: '>=3.0.0 <5.0.0'
   # https://github.com/flutter/plugins/tree/master/packages/path_provider
-  path_provider: '>=1.2.0 <3.0.0'
+  path_provider: '>=2.0.0 <4.0.0'

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott