feat: 添加一个新的sdk初始化方法,参数为config和uiConfig

master
wangtao 2023-03-20 10:43:14 +08:00
parent d86d2e232b
commit 01c782236a
3 changed files with 254 additions and 139 deletions

View File

@ -90,9 +90,10 @@
uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue]; uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue];
uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue]; uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue];
uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue]; uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue];
// uiconfig. = [_uiConfig[@"isHideRefreshMenu"] integerValue]; uiconfig.hideShareAppletMenu = [_uiConfig[@"isHideShareAppletMenu"] boolValue];
uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue]; uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue];
uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue]; uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] integerValue];
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
if (_uiConfig[@"progressBarColor"]) { if (_uiConfig[@"progressBarColor"]) {
uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"progressBarColor"] intValue]]; uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"progressBarColor"] intValue]];
} }
@ -102,7 +103,6 @@
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue]; uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
uiconfig.appletText = _uiConfig[@"appletText"]; uiconfig.appletText = _uiConfig[@"appletText"];
uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] boolValue];
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue]; uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
if (_uiConfig[@"capsuleConfig"]) { if (_uiConfig[@"capsuleConfig"]) {
NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"]; NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"];
@ -127,10 +127,122 @@
uiconfig.capsuleConfig = capsuleConfig; uiconfig.capsuleConfig = capsuleConfig;
} }
if (_uiConfig[@"navHomeConfig"]) {
NSDictionary *navHomeConfigDic = _uiConfig[@"navHomeConfig"];
FATNavHomeConfig *navHomeConfig = [[FATNavHomeConfig alloc]init];
navHomeConfig.width = [navHomeConfigDic[@"width"] floatValue];
navHomeConfig.height = [navHomeConfigDic[@"height"] floatValue];
navHomeConfig.leftMargin = [navHomeConfigDic[@"leftMargin"] floatValue];
navHomeConfig.cornerRadius = [navHomeConfigDic[@"cornerRadius"] floatValue];
navHomeConfig.borderWidth = [navHomeConfigDic[@"width"] floatValue];
if (navHomeConfigDic[@"borderLightColor"]) {
navHomeConfig.borderLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderLightColor"] intValue]];
}
if (navHomeConfigDic[@"borderDarkColor"]) {
navHomeConfig.borderDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderDarkColor"] intValue]];
}
if (navHomeConfigDic[@"bgLightColor"]) {
navHomeConfig.bgLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgLightColor"] intValue]];
}
if (navHomeConfigDic[@"bgDarkColor"]) {
navHomeConfig.bgDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgDarkColor"] intValue]];
}
uiconfig.navHomeConfig = navHomeConfig;
}
if (_uiConfig[@"authViewConfig"]) {
NSDictionary *authViewConfigDic = _uiConfig[@"authViewConfig"];
FATAuthViewConfig *authViewConfig = [[FATAuthViewConfig alloc]init];
authViewConfig.appletNameFont = [UIFont systemFontOfSize:[authViewConfigDic[@"appletNameFont"] integerValue]];
if (authViewConfigDic[@"appletNameLightColor"]) {
authViewConfig.appletNameLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameLightColor"] intValue]];
}
if (authViewConfigDic[@"appletNameDarkColor"]) {
authViewConfig.appletNameDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameDarkColor"] intValue]];
}
authViewConfig.authorizeTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeTitleFont"] integerValue] weight:UIFontWeightMedium];
if (authViewConfigDic[@"authorizeTitleLightColor"]) {
authViewConfig.authorizeTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleLightColor"] intValue]];
}
if (authViewConfigDic[@"authorizeTitleDarkColor"]) {
authViewConfig.authorizeTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleDarkColor"] intValue]];
}
authViewConfig.authorizeDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeDescriptionFont"] integerValue]];
if (authViewConfigDic[@"authorizeDescriptionLightColor"]) {
authViewConfig.authorizeDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionLightColor"] intValue]];
}
if (authViewConfigDic[@"authorizeDescriptionDarkColor"]) {
authViewConfig.authorizeDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionDarkColor"] intValue]];
}
authViewConfig.agreementTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementTitleFont"] integerValue]];
if (authViewConfigDic[@"agreementTitleLightColor"]) {
authViewConfig.agreementTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleLightColor"] intValue]];
}
if (authViewConfigDic[@"agreementTitleDarkColor"]) {
authViewConfig.agreementTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleDarkColor"] intValue]];
}
authViewConfig.agreementDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementDescriptionFont"] integerValue]];
if (authViewConfigDic[@"agreementDescriptionLightColor"]) {
authViewConfig.agreementDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionLightColor"] intValue]];
}
if (authViewConfigDic[@"agreementDescriptionDarkColor"]) {
authViewConfig.agreementDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionDarkColor"] intValue]];
}
if (authViewConfigDic[@"linkLightColor"]) {
authViewConfig.linkLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkLightColor"] intValue]];
}
if (authViewConfigDic[@"linkDarkColor"]) {
authViewConfig.linkDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkDarkColor"] intValue]];
}
if (authViewConfigDic[@"allowButtonLightConfig"]) {
FATAuthButtonConfig *allowButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonLightConfig"]];
authViewConfig.allowButtonLightConfig = allowButtonLightConfig;
}
if (authViewConfigDic[@"allowButtonDarkConfig"]) {
FATAuthButtonConfig *allowButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonDarkConfig"]];
authViewConfig.allowButtonDarkConfig = allowButtonDarkConfig;
}
if (authViewConfigDic[@"rejectButtonLightConfig"]) {
FATAuthButtonConfig *rejectButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonLightConfig"]];
authViewConfig.rejectButtonLightConfig = rejectButtonLightConfig;
}
if (authViewConfigDic[@"rejectButtonDarkConfig"]) {
FATAuthButtonConfig *rejectButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonDarkConfig"]];
authViewConfig.rejectButtonDarkConfig = rejectButtonDarkConfig;
}
uiconfig.authViewConfig = authViewConfig;
}
uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"]; uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"];
uiconfig.hideWebViewProgressBar = [_uiConfig[@"hideWebViewProgressBar"] boolValue];
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
uiconfig.transtionStyle = [_uiConfig[@"transtionStyle"] integerValue];
} }
// uiconfig.moreMenuStyle = FATMoreViewStyleNormal; // uiconfig.moreMenuStyle = FATMoreViewStyleNormal;
[[FATClient sharedClient] initWithConfig:config uiConfig:uiconfig error:&error]; [[FATClient sharedClient] initWithConfig:config uiConfig:uiconfig error:&error];
if (error) { if (error) {
@ -146,4 +258,34 @@
success(@{}); success(@{});
} }
- (FATAuthButtonConfig *)createAuthButtonConfigWithDic:(NSDictionary *)dic {
if (!dic) {
return nil;
}
FATAuthButtonConfig * authButtonConfig = [[FATAuthButtonConfig alloc]init];
if (dic[@"cornerRadius"]) {
authButtonConfig.cornerRadius = [dic[@"cornerRadius"] floatValue];
}
if (dic[@"normalBackgroundColor"]) {
authButtonConfig.normalBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"normalBackgroundColor"] intValue]];
}
if (dic[@"pressedBackgroundColor"]) {
authButtonConfig.pressedBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"pressedBackgroundColor"] intValue]];
}
if (dic[@"normalTextColor"]) {
authButtonConfig.normalTextColor = [MOPTools colorWithRGBHex:[dic[@"normalTextColor"] intValue]];
}
if (dic[@"pressedTextColor"]) {
authButtonConfig.pressedTextColor = [MOPTools colorWithRGBHex:[dic[@"pressedTextColor"] intValue]];
}
if (dic[@"normalBorderColor"]) {
authButtonConfig.normalBorderColor = [MOPTools colorWithRGBHex:[dic[@"normalBorderColor"] intValue]];
}
if (dic[@"pressedBorderColor"]) {
authButtonConfig.pressedBorderColor = [MOPTools colorWithRGBHex:[dic[@"pressedBorderColor"] intValue]];
}
return authButtonConfig;
}
@end @end

View File

@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk.
s.dependency 'Flutter' s.dependency 'Flutter'
s.ios.deployment_target = '9.0' s.ios.deployment_target = '9.0'
s.dependency 'FinApplet' , '2.39.7' s.dependency 'FinApplet' , '2.39.11'
s.dependency 'FinAppletExt' , '2.39.7' s.dependency 'FinAppletExt' , '2.39.11'
end end

View File

@ -53,73 +53,77 @@ class FinStoreConfig {
class FATConfig { class FATConfig {
/** /**
*/
List<FinStoreConfig> storeConfigs;
/**
id->->id id->->id
userId userId
//退 //退
userId userId
*/ */
String? currentUserId; String? currentUserId;
/** /**
finclipfinogeeksuserAgentfinogeeks finclipfinogeeksuserAgentfinogeeks
*/ */
String? productIdentification; String? productIdentification;
/** /**
SDK SDK
trueSDK使api trueSDK使api
*/ */
bool disableAuthorize = false; bool disableAuthorize = false;
/** /**
true true
*/ */
bool appletAutoAuthorize = false; bool appletAutoAuthorize = false;
/** /**
SDKAPIfalse SDKAPIfalse
trueSDKAPI trueSDKAPI
*/ */
bool disableGetSuperviseInfo = false; bool disableGetSuperviseInfo = false;
/** /**
webviewfalse, webviewfalse,
trueHttps trueHttps
*/ */
bool ignoreWebviewCertAuth = false; bool ignoreWebviewCertAuth = false;
/** /**
SDKwifi使x SDKwifi使x
0~5003 0~5003
*/ */
int appletIntervalUpdateLimit = 3; int appletIntervalUpdateLimit = 3;
/** /**
apm apm
*/ */
Map<String,String>? apmExtension; Map<String, String>? apmExtension;
/** Crashfalse(iOS) /** Crashfalse(iOS)
UnrecognizedSelectorKVONotificationTimerContainer(nil)String (nil) UnrecognizedSelectorKVONotificationTimerContainer(nil)String (nil)
便 便
*/ */
bool startCrashProtection = false; bool startCrashProtection = false;
Map? theme; Map? theme;
/** /**
* *
* false * false
*/ */
bool enableApmDataCompression = false; bool enableApmDataCompression = false;
/** /**
使 使
YES YES
*/ */
bool encryptServerData = false; bool encryptServerData = false;
/** /**
debug debug
@ -128,43 +132,43 @@ bool encryptServerData = false;
FATBOOLStateFalse FATBOOLStateFalse
FATBOOLStateForbiddenvconsoleapi FATBOOLStateForbiddenvconsoleapi
*/ */
@property (nonatomic, assign) FATBOOLState enableAppletDebug; FATBOOLState enableAppletDebug = FATBOOLState.FATBOOLStateUndefined;
/** /**
*/ */
bool enableWatermark = false; bool enableWatermark = false;
/** /**
*/ */
ConfigPriority watermarkPriority = ConfigPriority.ConfigGlobalPriority; ConfigPriority watermarkPriority = ConfigPriority.ConfigGlobalPriority;
/** /**
FATBaseLoadingView FATBaseLoadingView
swiftSwiftDemo.FCloadingViewSwiftDemoFCloadingView swiftSwiftDemo.FCloadingViewSwiftDemoFCloadingView
*/ */
String? baseLoadingViewClass; String? baseLoadingViewClass;
/** /**
FATBaseLoadFailedView FATBaseLoadFailedView
swiftSwiftDemo.FCloadingViewSwiftDemoFCloadingView swiftSwiftDemo.FCloadingViewSwiftDemoFCloadingView
*/ */
String? baseLoadFailedViewClass; String? baseLoadFailedViewClass;
/** /**
header header
apikey apikey
ft.requestft.downloadFileft.uploadFile ft.requestft.downloadFileft.uploadFile
*/ */
Map<String,dynamic>? header; Map<String, dynamic>? header;
/** /**
header header
*/ */
ConfigPriority headerPriority = ConfigPriority.ConfigGlobalPriority; ConfigPriority headerPriority = ConfigPriority.ConfigGlobalPriority;
/** /**
H5hook H5hook
@ -172,30 +176,34 @@ ConfigPriority headerPriority = ConfigPriority.ConfigGlobalPriority;
body宿App宿Apprequestbody body宿App宿Apprequestbody
URLProtocolbody URLProtocolbody
*/ */
bool enableH5AjaxHook = false; bool enableH5AjaxHook = false;
/** /**
enableH5AjaxHookhook requestrequest url FinClipHookBridge-RequestId=xxx enableH5AjaxHookhook requestrequest url FinClipHookBridge-RequestId=xxx
Key FinClip-RequestIdFinClip-RequestId=xxx Key FinClip-RequestIdFinClip-RequestId=xxx
*/ */
String? h5AjaxHookRequestKey; String? h5AjaxHookRequestKey;
/** /**
0 0
55navigateTo 4 55navigateTo 4
*/ */
int pageCountLimit = 0; int pageCountLimit = 0;
/** /**
scheme scheme
*/ */
List<String> schemes = []; List<String> schemes = [];
Map<String, dynamic> toMap() { FATConfig(this.storeConfigs);
Map<String, dynamic> toMap() {
List<Map<String, dynamic>>? finStoreConfigs =
storeConfigs.map((e) => e.toMap()).toList();
return { return {
"storeConfigs": finStoreConfigs,
"currentUserId": currentUserId, "currentUserId": currentUserId,
"productIdentification": productIdentification, "productIdentification": productIdentification,
"disableAuthorize": disableAuthorize, "disableAuthorize": disableAuthorize,
"appletAutoAuthorize": appletAutoAuthorize, "appletAutoAuthorize": appletAutoAuthorize,
"disableGetSuperviseInfo": disableGetSuperviseInfo, "disableGetSuperviseInfo": disableGetSuperviseInfo,
@ -204,7 +212,7 @@ List<String> schemes = [];
"apmExtension": apmExtension, "apmExtension": apmExtension,
"enableApmDataCompression": enableApmDataCompression, "enableApmDataCompression": enableApmDataCompression,
"encryptServerData": encryptServerData, "encryptServerData": encryptServerData,
"enableAppletDebug": enableAppletDebug, "enableAppletDebug": enableAppletDebug.index,
"enableWatermark": enableWatermark, "enableWatermark": enableWatermark,
"watermarkPriority": watermarkPriority.index, "watermarkPriority": watermarkPriority.index,
"baseLoadingViewClass": baseLoadingViewClass, "baseLoadingViewClass": baseLoadingViewClass,
@ -215,7 +223,7 @@ List<String> schemes = [];
"pageCountLimit": pageCountLimit, "pageCountLimit": pageCountLimit,
"schemes": schemes, "schemes": schemes,
}; };
} }
} }
class UIConfig { class UIConfig {
@ -234,19 +242,19 @@ class UIConfig {
int navigationBarBackBtnLightColor = 0xffffffff; int navigationBarBackBtnLightColor = 0xffffffff;
// //
int navigationBarBackBtnDarkColor 0xff000000; int navigationBarBackBtnDarkColor = 0xff000000;
// int? navigationBackImage; // int? navigationBackImage;
// 0: 1: // 0: 1:
int moreMenuStyle = 0; int moreMenuStyle = 0;
// FATConfigAppletFilePriority // FATConfigAppletFilePriority
ConfigPriority hideBackToHomePriority = ConfigPriority.ConfigGlobalPriority ConfigPriority hideBackToHomePriority = ConfigPriority.ConfigGlobalPriority;
/// /// ios
bool isAlwaysShowBackInDefaultNavigationBar = false; bool isAlwaysShowBackInDefaultNavigationBar = false;
/// /// ios
bool isClearNavigationBarNavButtonBackground = false; bool isClearNavigationBarNavButtonBackground = false;
///"更多""反馈与投诉" ///"更多""反馈与投诉"
@ -258,9 +266,6 @@ class UIConfig {
//... false //... false
bool isHideForwardMenu = false; bool isHideForwardMenu = false;
//... false
bool isHideFeedbackMenu = false;
//... true //... true
bool isHideShareAppletMenu = true; bool isHideShareAppletMenu = true;
@ -270,12 +275,6 @@ class UIConfig {
//... false //... false
bool isHideSettingMenu = false; bool isHideSettingMenu = false;
/// ServiceSDK
bool hideTransitionCloseButton = false;
///
bool disableSlideCloseAppletGesture = false;
/// ///
CapsuleConfig? capsuleConfig; CapsuleConfig? capsuleConfig;
@ -294,8 +293,6 @@ class UIConfig {
//H5false //H5false
bool hideWebViewProgressBar = false; bool hideWebViewProgressBar = false;
//true //true
bool autoAdaptDarkMode = true; bool autoAdaptDarkMode = true;
@ -310,7 +307,7 @@ class UIConfig {
*/ */
TranstionStyle transtionStyle = TranstionStyle.TranstionStyleUp; TranstionStyle transtionStyle = TranstionStyle.TranstionStyleUp;
//false /// ServiceSDK
bool hideTransitionCloseButton = false; bool hideTransitionCloseButton = false;
/** /**
@ -338,23 +335,20 @@ class UIConfig {
"isHideBackHome": isHideBackHome, "isHideBackHome": isHideBackHome,
"isHideForwardMenu": isHideForwardMenu, "isHideForwardMenu": isHideForwardMenu,
"isHideRefreshMenu": isHideRefreshMenu, "isHideRefreshMenu": isHideRefreshMenu,
"isHideFeedbackMenu": isHideFeedbackMenu,
"isHideShareAppletMenu": isHideShareAppletMenu, "isHideShareAppletMenu": isHideShareAppletMenu,
"isHideSettingMenu": isHideSettingMenu, "isHideSettingMenu": isHideSettingMenu,
"hideTransitionCloseButton": hideTransitionCloseButton, "hideTransitionCloseButton": hideTransitionCloseButton,
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
"capsuleConfig": capsuleConfig?.toMap(), "capsuleConfig": capsuleConfig?.toMap(),
"navHomeConfig": navHomeConfig?.toMap(), "navHomeConfig": navHomeConfig?.toMap(),
"authViewConfig": authViewConfig,toMap(,) "authViewConfig": authViewConfig?.toMap(),
"floatWindowConfig": floatWindowConfig?.toMap(), "floatWindowConfig": floatWindowConfig?.toMap(),
"progressBarColor": progressBarColor, "progressBarColor": progressBarColor,
"hideWebViewProgressBar": hideWebViewProgressBar, "hideWebViewProgressBar": hideWebViewProgressBar,
"moreMenuStyle": moreMenuStyle, "moreMenuStyle": moreMenuStyle,
"hideBackToHomePriority": hideBackToHomePriority, "hideBackToHomePriority": hideBackToHomePriority.index,
"autoAdaptDarkMode": autoAdaptDarkMode, "autoAdaptDarkMode": autoAdaptDarkMode,
"appendingCustomUserAgent": appendingCustomUserAgent, "appendingCustomUserAgent": appendingCustomUserAgent,
"transtionStyle":transtionStyle.index, "transtionStyle": transtionStyle.index,
"hideTransitionCloseButton": hideTransitionCloseButton,
"disableSlideCloseAppletGesture": disableSlideCloseAppletGesture, "disableSlideCloseAppletGesture": disableSlideCloseAppletGesture,
"appletText": appletText "appletText": appletText
}; };
@ -482,29 +476,17 @@ class NavHomeConfig {
/** /**
10 10
*/ */
double leftMargin; double leftMargin = 10;
/** /**
5 5
*/ */
double cornerRadius; double cornerRadius = 5;
/** /**
0.8 0.8
*/ */
double borderWidth; double borderWidth = 0.8;
/**
使
*/
// int? lightImage;
/**
使
*/
// int? darkImage;
/** /**
@ -530,6 +512,9 @@ class NavHomeConfig {
*/ */
int bgDarkColor; int bgDarkColor;
NavHomeConfig(this.width, this.height, this.borderLightColor,
this.borderDarkColor, this.bgLightColor, this.bgDarkColor);
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {
"width": width, "width": width,
@ -549,110 +534,90 @@ class AuthViewConfig {
/** /**
PingFangSC-Regular16 PingFangSC-Regular16
*/ */
int appletNameFont; int appletNameFont = 16;
/** /**
#202020 #202020
*/ */
int appletNameLightColor; int appletNameLightColor = 0xff202020;
/** /**
#D0D0D0 #D0D0D0
*/ */
int appletNameDarkColor; int appletNameDarkColor = 0xffd0d0d0;
/**
icon22pt@2× @3×
*/
int agreementLightImage;
/**
icon22pt@2× @3×
*/
int agreementDarkImage;
/** /**
PingFangSC-Medium17 PingFangSC-Medium17
使PingFangSC-Regular 使PingFangSC-Regular
*/ */
int authorizeTitleFont; int authorizeTitleFont = 17;
/** /**
#202020 #202020
使 使
*/ */
int authorizeTitleLightColor; int authorizeTitleLightColor = 0xff202020;
/** /**
#D0D0D0 #D0D0D0
使 使
*/ */
int authorizeTitleDarkColor; int authorizeTitleDarkColor = 0xffd0d0d0;
/** /**
PingFangSC-Regular14 PingFangSC-Regular14
*/ */
int authorizeDescriptionFont; int authorizeDescriptionFont = 14;
/** /**
#666666 #666666
*/ */
int authorizeDescriptionLightColor; int authorizeDescriptionLightColor = 0xff666666;
/** /**
#8C8C8C #8C8C8C
*/ */
int authorizeDescriptionDarkColor; int authorizeDescriptionDarkColor = 0xff8c8c8c;
/** /**
PingFangSC-Regular16 PingFangSC-Regular16
*/ */
int agreementTitleFont; int agreementTitleFont = 16;
/** /**
#202020 #202020
*/ */
int agreementTitleLightColor; int agreementTitleLightColor = 0xff202020;
/** /**
#D0D0D0 #D0D0D0
*/ */
int agreementTitleDarkColor; int agreementTitleDarkColor = 0xffd0d0d0;
/** /**
PingFangSC-Regular14 PingFangSC-Regular14
*/ */
int agreementDescriptionFont; int agreementDescriptionFont = 14;
/** /**
#202020 #202020
*/ */
int agreementDescriptionLightColor; int agreementDescriptionLightColor = 0xff202020;
/** /**
#D0D0D0 #D0D0D0
*/ */
int agreementDescriptionDarkColor; int agreementDescriptionDarkColor = 0xffd0d0d0;
/**
icon22pt@2× @3×
*/
int authorizeSelectedLightImage;
/**
icon22pt@2× @3×
*/
int authorizeSelectedDarkImage;
/** /**
#409EFF #409EFF
*/ */
int linkLightColor; int linkLightColor = 0xff409eff;
/** /**
#368CE4 #368CE4
*/ */
int linkDarkColor; int linkDarkColor = 0xff368ce4;
/** /**
@ -664,7 +629,7 @@ int linkDarkColor;
#3B77DB #3B77DB
#FFFFFF #FFFFFF
*/ */
AuthButtonConfig allowButtonLightConfig; AuthButtonConfig? allowButtonLightConfig;
/** /**
@ -676,7 +641,7 @@ AuthButtonConfig allowButtonLightConfig;
#5E97F5 #5E97F5
#FFFFFF #FFFFFF
*/ */
AuthButtonConfig allowButtonDarkConfig; AuthButtonConfig? allowButtonDarkConfig;
/** /**
@ -688,7 +653,7 @@ AuthButtonConfig allowButtonDarkConfig;
#D8D8D8 #D8D8D8
#222222 #222222
*/ */
AuthButtonConfig rejectButtonLightConfig; AuthButtonConfig? rejectButtonLightConfig;
/** /**
@ -700,9 +665,9 @@ AuthButtonConfig rejectButtonLightConfig;
#414141 #414141
#D0D0D0 #D0D0D0
*/ */
AuthButtonConfig rejectButtonDarkConfig; AuthButtonConfig? rejectButtonDarkConfig;
Map<String, dynamic> toMap() { Map<String, dynamic> toMap() {
return { return {
"appletNameFont": appletNameFont, "appletNameFont": appletNameFont,
"appletNameLightColor": appletNameLightColor, "appletNameLightColor": appletNameLightColor,
@ -713,7 +678,6 @@ Map<String, dynamic> toMap() {
"authorizeDescriptionFont": authorizeDescriptionFont, "authorizeDescriptionFont": authorizeDescriptionFont,
"authorizeDescriptionLightColor": authorizeDescriptionLightColor, "authorizeDescriptionLightColor": authorizeDescriptionLightColor,
"authorizeDescriptionDarkColor": authorizeDescriptionDarkColor, "authorizeDescriptionDarkColor": authorizeDescriptionDarkColor,
"agreementTitleFont": agreementTitleFont, "agreementTitleFont": agreementTitleFont,
"agreementTitleLightColor": agreementTitleLightColor, "agreementTitleLightColor": agreementTitleLightColor,
"agreementTitleDarkColor": agreementTitleDarkColor, "agreementTitleDarkColor": agreementTitleDarkColor,
@ -721,10 +685,10 @@ Map<String, dynamic> toMap() {
"agreementDescriptionDarkColor": agreementDescriptionDarkColor, "agreementDescriptionDarkColor": agreementDescriptionDarkColor,
"linkLightColor": linkLightColor, "linkLightColor": linkLightColor,
"linkDarkColor": linkDarkColor, "linkDarkColor": linkDarkColor,
"allowButtonLightConfig": allowButtonLightConfig.toMap(), "allowButtonLightConfig": allowButtonLightConfig?.toMap(),
"allowButtonDarkConfig": allowButtonDarkConfig.toMap(), "allowButtonDarkConfig": allowButtonDarkConfig?.toMap(),
"rejectButtonLightConfig": rejectButtonLightConfig.toMap(), "rejectButtonLightConfig": rejectButtonLightConfig?.toMap(),
"rejectButtonDarkConfig": rejectButtonDarkConfig.toMap(), "rejectButtonDarkConfig": rejectButtonDarkConfig?.toMap(),
}; };
} }
} }
@ -733,39 +697,48 @@ class AuthButtonConfig {
/** /**
*/ */
double cornerRadius; double cornerRadius;
/** /**
*/ */
int normalBackgroundColor; int normalBackgroundColor;
/** /**
*/ */
int pressedBackgroundColor; int pressedBackgroundColor;
/** /**
*/ */
int normalTextColor; int normalTextColor;
/** /**
*/ */
int pressedTextColor; int pressedTextColor;
/** /**
*/ */
int normalBorderColor; int normalBorderColor;
/** /**
*/ */
int pressedBorderColor; int pressedBorderColor;
Map<String, dynamic> toMap() { AuthButtonConfig(
this.cornerRadius,
this.normalBackgroundColor,
this.pressedBackgroundColor,
this.normalTextColor,
this.pressedTextColor,
this.normalBorderColor,
this.pressedBorderColor);
Map<String, dynamic> toMap() {
return { return {
"cornerRadius": cornerRadius, "cornerRadius": cornerRadius,
"normalBackgroundColor": normalBackgroundColor, "normalBackgroundColor": normalBackgroundColor,
@ -886,16 +859,24 @@ enum Anim {
} }
enum ConfigPriority { enum ConfigPriority {
ConfigGlobalPriority , // ConfigGlobalPriority, //
ConfigSpecifiedPriority, // ConfigSpecifiedPriority, //
ConfigAppletFilePriority, // app.ext.json ConfigAppletFilePriority, // app.ext.json
} }
enum TranstionStyle { enum TranstionStyle {
TranstionStyleUp, // present TranstionStyleUp, // present
TranstionStylePush, // push TranstionStylePush, // push
} }
enum FATBOOLState {
FATBOOLStateUndefined, //
FATBOOLStateTrue, // vconsoleapi
FATBOOLStateFalse, // setEnableDebugvconsole
FATBOOLStateForbidden, // vconsoleapi
}
class Mop { class Mop {
static final Mop _instance = new Mop._internal(); static final Mop _instance = new Mop._internal();
late MethodChannel _channel; late MethodChannel _channel;
@ -1024,18 +1005,10 @@ class Mop {
return ret; return ret;
} }
Future<Map> newInitialize( Future<Map> newInitialize(FATConfig config, {UIConfig? uiConfig}) async {
FATConfig config,
{
UIConfig? uiConfig
}
}) async {
List<Map<String, dynamic>>? storeConfigs =
finStoreConfigs?.map((e) => e.toMap()).toList();
final Map ret = await _channel.invokeMethod('newInitialize', { final Map ret = await _channel.invokeMethod('newInitialize', {
'config': config, 'config': config.toMap(),
'uiConfig': uiConfig, 'uiConfig': uiConfig?.toMap(),
}); });
return ret; return ret;
} }