|
|
@@ -34,28 +34,28 @@ class Application { |
|
|
|
return _initStringMethods.containsKey(type); |
|
|
|
} |
|
|
|
|
|
|
|
static doStringMethod(String type) { |
|
|
|
static Future doStringMethod(String type) { |
|
|
|
if (_initStringMethods.containsKey(type)) { |
|
|
|
print("存在方法" + type); |
|
|
|
_initStringMethods[type](); |
|
|
|
} else { |
|
|
|
print("不存在方法" + type); |
|
|
|
return _initStringMethods[type](); |
|
|
|
} |
|
|
|
print("不存在方法" + type); |
|
|
|
return Future(() => false); |
|
|
|
} |
|
|
|
|
|
|
|
static addStringParamsMethod({String type , StringParamsMethod method}) { |
|
|
|
static addStringParamsMethod({String type, StringParamsMethod method}) { |
|
|
|
if (type == null || method == null) { |
|
|
|
return; |
|
|
|
} |
|
|
|
_initStringParamsMethods[type] = method; |
|
|
|
} |
|
|
|
|
|
|
|
static doStringParamsMethod(String type, {Map<String, dynamic> data}) { |
|
|
|
static Future doStringParamsMethod(String type, {Map<String, dynamic> data}) { |
|
|
|
if (_initStringParamsMethods.containsKey(type)) { |
|
|
|
print("存在方法" + type); |
|
|
|
_initStringParamsMethods[type](data); |
|
|
|
} else { |
|
|
|
print("不存在方法" + type); |
|
|
|
return _initStringParamsMethods[type](data); |
|
|
|
} |
|
|
|
print("不存在方法" + type); |
|
|
|
return Future(() => false); |
|
|
|
} |
|
|
|
} |