@@ -12,7 +12,6 @@ static constexpr char kChannelName[] = "flutter/platform";
12
12
static constexpr char kBadArgumentsError [] = " Bad Arguments" ;
13
13
static constexpr char kUnknownClipboardFormatError [] =
14
14
" Unknown Clipboard Format" ;
15
- static constexpr char kClipboardRequestError [] = " Clipboard Request Failed" ;
16
15
static constexpr char kFailedError [] = " Failed" ;
17
16
static constexpr char kGetClipboardDataMethod [] = " Clipboard.getData" ;
18
17
static constexpr char kSetClipboardDataMethod [] = " Clipboard.setData" ;
@@ -43,17 +42,14 @@ static void clipboard_text_cb(GtkClipboard* clipboard,
43
42
gpointer user_data) {
44
43
g_autoptr (FlMethodCall) method_call = FL_METHOD_CALL (user_data);
45
44
46
- g_autoptr (FlMethodResponse) response = nullptr ;
45
+ g_autoptr (FlValue) result = nullptr ;
47
46
if (text != nullptr ) {
48
- g_autoptr (FlValue) result = fl_value_new_map ();
47
+ result = fl_value_new_map ();
49
48
fl_value_set_string_take (result, kTextKey , fl_value_new_string (text));
50
- response = FL_METHOD_RESPONSE (fl_method_success_response_new (nullptr ));
51
- } else {
52
- response = FL_METHOD_RESPONSE (fl_method_error_response_new (
53
- kClipboardRequestError , " Failed to retrieve clipboard text from GTK" ,
54
- nullptr ));
55
49
}
56
50
51
+ g_autoptr (FlMethodResponse) response =
52
+ FL_METHOD_RESPONSE (fl_method_success_response_new (result));
57
53
send_response (method_call, response);
58
54
}
59
55
0 commit comments