Sky24n 4 年之前
父节点
当前提交
0b30865169
共有 7 个文件被更改,包括 24 次插入20 次删除
  1. 4 0
      CHANGELOG.md
  2. 1 1
      README-EN.md
  3. 2 2
      README.md
  4. 0 0
      example/.flutter-plugins-dependencies
  5. 13 13
      example/lib/main.dart
  6. 1 1
      example/pubspec.yaml
  7. 3 3
      pubspec.yaml

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+## 2.0.1
+
+* TODO: dependencies update.
+
 ## 2.0.0
 
 * TODO: Migrate to null-safety.

+ 1 - 1
README-EN.md

@@ -14,7 +14,7 @@ Pub [flustars](https://pub.flutter-io.cn/packages/flustars)
 ### Add dependency
 ```yaml
 dependencies:
-  flustars: ^2.0.0
+  flustars: ^2.01
   
 import 'package:flustars/flustars.dart';
 

+ 2 - 2
README.md

@@ -12,11 +12,11 @@ flustars依赖于Dart常用工具类库[common_utils](https://github.com/Sky24n/
 ### Pub
 ```yaml
 dependencies:
-  flustars: ^2.0.0
+  flustars: ^2.0.1
   
   # https://github.com/Sky24n/sp_util
   # sp_util分拆成单独的库,可以直接引用
-  sp_util: ^2.0.0
+  sp_util: ^2.0.3
 ```
 
 ### [Change Log](CHANGE_LOG.md)

文件差异内容过多而无法显示
+ 0 - 0
example/.flutter-plugins-dependencies


+ 13 - 13
example/lib/main.dart

@@ -27,27 +27,27 @@ class _MyAppState extends State<MyApp> {
     await SpUtil.getInstance();
 
     SpUtil.putString("username", "sky24");
-    String userName = SpUtil.getString("username", defValue: "");
-    LogUtil.e("userName: " + userName);
+    String? userName = SpUtil.getString("username", defValue: "");
+    LogUtil.e("userName: $userName");
 
     /// save object example.
     /// 存储实体对象示例。
-    City city = City();
-    city.name = "成都市";
+    City city = City(name: "成都市");
     SpUtil.putObject("loc_city", city);
 
-    City hisCity = SpUtil.getObj("loc_city", (v) => City.fromJson(v));
+    City? hisCity = SpUtil.getObj(
+        "loc_city", (v) => City.fromJson(v as Map<String, dynamic>));
     LogUtil.e("City: " + (hisCity == null ? "null" : hisCity.toString()));
 
     /// save object list example.
     /// 存储实体对象list示例。
-    List<City> list = List();
+    List<City> list = [];
     list.add(City(name: "成都市"));
     list.add(City(name: "北京市"));
     SpUtil.putObjectList("loc_city_list", list);
 
-    List<City> dataList =
-        SpUtil.getObjList("loc_city_list", (v) => City.fromJson(v));
+    List<City>? dataList = SpUtil.getObjList(
+        "loc_city_list", (v) => City.fromJson(v as Map<String, dynamic>));
     LogUtil.e("CityList: " + (dataList == null ? "null" : dataList.toString()));
   }
 
@@ -74,19 +74,19 @@ class MainPageState extends State<MainPage> {
   void test2() async {
     LogUtil.e("xxxxxxxxxxx test7......");
     await DirectoryUtil.getInstance();
-    String tempPath = DirectoryUtil.getTempPath(
+    String? tempPath = DirectoryUtil.getTempPath(
         category: 'Pictures', fileName: 'demo', format: 'png');
     LogUtil.e("tempPath: $tempPath");
 
-    String appDocPath = DirectoryUtil.getAppDocPath(
+    String? appDocPath = DirectoryUtil.getAppDocPath(
         category: 'Pictures', fileName: 'demo', format: 'png');
     LogUtil.e("appDocPath: $appDocPath");
 
-    String appSupportPath = DirectoryUtil.getAppSupportPath(
+    String? appSupportPath = DirectoryUtil.getAppSupportPath(
         category: 'Pictures', fileName: 'demo', format: 'png');
     LogUtil.e("appSupportPath: $appSupportPath");
 
-    String storagePath = DirectoryUtil.getStoragePath(
+    String? storagePath = DirectoryUtil.getStoragePath(
         category: 'Pictures', fileName: 'demo', format: 'png');
     LogUtil.e("storagePath: $storagePath");
   }
@@ -338,7 +338,7 @@ class SecondPageState extends State<SecondPage> {
 class City {
   String name;
 
-  City({this.name});
+  City({required this.name});
 
   /// must.
   City.fromJson(Map<String, dynamic> json) : name = json['name'];

+ 1 - 1
example/pubspec.yaml

@@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 version: 1.0.0+1
 
 environment:
-  sdk: ">=2.7.0 <3.0.0"
+  sdk: ">=2.12.0 <3.0.0"
 
 dependencies:
   flutter:

+ 3 - 3
pubspec.yaml

@@ -1,6 +1,6 @@
 name: flustars
 description: Flutter common utils library. SpUtil, ScreenUtil, WidgetUtil, DirectoryUtil, ImageUtil. SharedPreferences Util. Screen info & Screen adaptation. get image size.
-version: 2.0.0
+version: 2.0.1
 homepage: https://github.com/Sky24n/flustars
 
 environment:
@@ -10,9 +10,9 @@ dependencies:
   flutter:
     sdk: flutter
   # Dart common utils library. https://github.com/Sky24n/common_utils
-  common_utils: '>=2.0.0 <3.0.0'
+  common_utils: '>=2.0.2 <3.0.0'
   # https://github.com/Sky24n/sp_util
-  sp_util: '>=2.0.0 <3.0.0'
+  sp_util: '>=2.0.3 <3.0.0'
   # https://github.com/tekartik/synchronized.dart
   synchronized: '>=3.0.0 <5.0.0'
   # https://github.com/flutter/plugins/tree/master/packages/path_provider

部分文件因为文件数量过多而无法显示