From d51550b6c0bea0e3bd168e20b26e55f044ce7be4 Mon Sep 17 00:00:00 2001
From: Weller <1812208341@qq.com>
Date: Wed, 30 Mar 2022 14:22:23 +0800
Subject: [PATCH] null-safe
---
example/.flutter-plugins-dependencies | 2 +-
example/ios/Flutter/AppFrameworkInfo.plist | 2 +-
.../ios/Flutter/flutter_export_environment.sh | 14 ++--
example/ios/Runner.xcodeproj/project.pbxproj | 10 +--
.../contents.xcworkspacedata | 2 +-
.../xcshareddata/xcschemes/Runner.xcscheme | 2 +-
example/pubspec.lock | 45 ++++++-----
lib/albc_tools.dart | 4 +-
lib/alibc_model.dart | 44 +++++-----
lib/flutter_alibc.dart | 80 +++++++++----------
pubspec.lock | 45 ++++++-----
pubspec.yaml | 2 +-
12 files changed, 132 insertions(+), 120 deletions(-)
diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies
index 3940a51..30666d3 100644
--- a/example/.flutter-plugins-dependencies
+++ b/example/.flutter-plugins-dependencies
@@ -1 +1 @@
-{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"/Users/fnuser04/Documents/flutterAPP/zhiying_flutter_alibc/","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"/Users/fnuser04/Documents/flutterAPP/zhiying_flutter_alibc/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2021-04-17 11:06:38.571844","version":"1.22.0"}
\ No newline at end of file
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_alibc","path":"/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/","dependencies":[]}],"android":[{"name":"flutter_alibc","path":"/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_alibc","dependencies":[]}],"date_created":"2022-03-30 14:17:04.674376","version":"2.10.3"}
\ No newline at end of file
diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist
index 6b4c0f7..f2872cf 100644
--- a/example/ios/Flutter/AppFrameworkInfo.plist
+++ b/example/ios/Flutter/AppFrameworkInfo.plist
@@ -21,6 +21,6 @@
CFBundleVersion
1.0
MinimumOSVersion
- 8.0
+ 9.0
diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh
index f3ad506..223afaf 100755
--- a/example/ios/Flutter/flutter_export_environment.sh
+++ b/example/ios/Flutter/flutter_export_environment.sh
@@ -1,16 +1,14 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
-export "FLUTTER_ROOT=/Users/fnuser04/Documents/flutterModel/flutter"
-export "FLUTTER_APPLICATION_PATH=/Users/fnuser04/Documents/flutterAPP/zhiying_flutter_alibc/example"
-export "FLUTTER_TARGET=/Users/fnuser04/Documents/flutterAPP/zhiying_flutter_alibc/example/lib/main.dart"
+export "FLUTTER_ROOT=/Users/fnuouser/Documents/code/flutter"
+export "FLUTTER_APPLICATION_PATH=/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/example"
+export "COCOAPODS_PARALLEL_CODE_SIGN=true"
+export "FLUTTER_TARGET=/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
-export "SYMROOT=${SOURCE_ROOT}/../build/ios"
-export "OTHER_LDFLAGS=$(inherited) -framework Flutter"
-export "FLUTTER_FRAMEWORK_DIR=/Users/fnuser04/Documents/flutterModel/flutter/bin/cache/artifacts/engine/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
-export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
+export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
-export "PACKAGE_CONFIG=.packages"
+export "PACKAGE_CONFIG=/Users/fnuouser/Documents/code/zhiying/zhiying_flutter_alibc/example/.dart_tool/package_config.json"
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index abdfcb9..26fc84d 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 46;
+ objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
@@ -191,7 +191,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1020;
+ LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "The Chromium Authors";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
@@ -394,7 +394,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -483,7 +483,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -532,7 +532,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+ IPHONEOS_DEPLOYMENT_TARGET = 9.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
index 1d526a1..919434a 100644
--- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -2,6 +2,6 @@
+ location = "self:">
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a28140c..3db53b6 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
=2.10.0-110 <2.11.0"
+ dart: ">=2.14.0 <3.0.0"
diff --git a/lib/albc_tools.dart b/lib/albc_tools.dart
index 78554bf..a8df917 100644
--- a/lib/albc_tools.dart
+++ b/lib/albc_tools.dart
@@ -46,8 +46,8 @@ class AlibcTools {
}
// 设置淘宝客数据
- static Map getTaokeMap(TaokeParams taokeParams) {
- Map taoKe;
+ static Map? getTaokeMap(TaokeParams? taokeParams) {
+ Map? taoKe;
if (taokeParams != null) {
taoKe = {
"adzoneId": taokeParams.adzoneId ?? "",
diff --git a/lib/alibc_model.dart b/lib/alibc_model.dart
index 7e91142..b3702b0 100644
--- a/lib/alibc_model.dart
+++ b/lib/alibc_model.dart
@@ -3,20 +3,20 @@ import 'alibc_const_key.dart';
class InitModel {
// 错误码
- final String errorCode;
+ final String? errorCode;
// 错误信息
- final String errorMessage;
+ final String? errorMessage;
InitModel(this.errorCode, this.errorMessage);
}
class LoginModel {
// 错误码
- final String errorCode;
+ final String? errorCode;
// 错误信息
- final String errorMessage;
+ final String? errorMessage;
- UserModel data;
+ UserModel? data;
LoginModel(this.errorCode, this.errorMessage, {this.data});
}
@@ -24,13 +24,13 @@ class LoginModel {
// 用户信息
class UserModel {
// 用户昵称
- final String nick;
+ final String? nick;
// 头像地址
- final String avatarUrl;
- final String openId;
- final String openSid;
- final String topAccessToken;
- final String topAuthCode;
+ final String? avatarUrl;
+ final String? openId;
+ final String? openSid;
+ final String? topAccessToken;
+ final String? topAuthCode;
UserModel(this.nick, this.avatarUrl, this.openId, this.openSid,
this.topAccessToken, this.topAuthCode);
}
@@ -38,11 +38,11 @@ class UserModel {
// 淘宝客的参数
class TaokeParams {
//有adzoneId则pid失效
- String adzoneId;
- String pid;
- String unionId;
- String subPid;
- Map extParams;
+ String? adzoneId;
+ String? pid;
+ String? unionId;
+ String? subPid;
+ Map? extParams;
TaokeParams(
{this.adzoneId, this.pid, this.unionId, this.subPid, this.extParams});
}
@@ -50,13 +50,13 @@ class TaokeParams {
// url打开或者page打开等的数据
class TradeResult {
// 错误码,0为成功,非0为失败
- String errorCode;
+ String? errorCode;
// 错误信息
- String errorMessage;
+ String? errorMessage;
- TradeResultType type;
+ TradeResultType? type;
- PayResult payResult;
+ PayResult? payResult;
// AddCardResult addCardResult;
// Android没有,所以去掉
// TradeFailResult tradeFailResult;
@@ -73,9 +73,9 @@ class TradeResult {
// 付款成功的result
class PayResult {
// 支付成功的订单
- final List paySuccessOrders;
+ final List? paySuccessOrders;
// 支付失败的订单
- final List payFailedOrders;
+ final List? payFailedOrders;
PayResult(this.paySuccessOrders, this.payFailedOrders);
}
diff --git a/lib/flutter_alibc.dart b/lib/flutter_alibc.dart
index 9994ab3..f47b9e6 100644
--- a/lib/flutter_alibc.dart
+++ b/lib/flutter_alibc.dart
@@ -24,8 +24,8 @@ class FlutterAlibc {
// ..setMethodCallHandler(_handler);
- static Future get platformVersion async {
- final String version = await _channel.invokeMethod('getPlatformVersion');
+ static Future get platformVersion async {
+ final String? version = await _channel.invokeMethod('getPlatformVersion');
return version;
}
@@ -36,8 +36,8 @@ class FlutterAlibc {
/// errorCode, //0为初始化成功,其他为失败
/// errorMessage, //message
///}
- static Future initAlibc({String version, String appName}) async {
- Map result = await _channel.invokeMethod("initAlibc", {"version": version, "appName": appName});
+ static Future initAlibc({String? version, String? appName}) async {
+ Map result = await (_channel.invokeMethod("initAlibc", {"version": version, "appName": appName}) as FutureOr