未验证 提交 db6793bc 编写于 作者: R Robert Ancell 提交者: GitHub

Use constant for error code (#18913)

上级 e8c13aa0
......@@ -12,6 +12,8 @@
static constexpr char kChannelName[] = "flutter/textinput";
static constexpr char kBadArgumentsError[] = "Bad Arguments";
static constexpr char kSetClientMethod[] = "TextInput.setClient";
static constexpr char kShowMethod[] = "TextInput.show";
static constexpr char kSetEditingStateMethod[] = "TextInput.setEditingState";
......@@ -158,7 +160,7 @@ static FlMethodResponse* set_client(FlTextInputPlugin* self, FlValue* args) {
if (fl_value_get_type(args) != FL_VALUE_TYPE_LIST ||
fl_value_get_length(args) < 2) {
return FL_METHOD_RESPONSE(fl_method_error_response_new(
"Bad Arguments", "Expected 2-element list", nullptr));
kBadArgumentsError, "Expected 2-element list", nullptr));
}
self->client_id = fl_value_get_int(fl_value_get_list_value(args, 0));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册