Flutter Engine
The Flutter Engine
|
Go to the source code of this file.
Macros | |
#define | FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark() |
Enumerations | |
enum | FlMethodResponseError { FL_METHOD_RESPONSE_ERROR_FAILED , FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR , FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED } |
Functions | |
G_MODULE_EXPORT GQuark | fl_method_response_error_quark (void) G_GNUC_CONST |
G_MODULE_EXPORT | G_DECLARE_DERIVABLE_TYPE (FlMethodResponse, fl_method_response, FL, METHOD_RESPONSE, GObject) struct _FlMethodResponseClass |
G_MODULE_EXPORT | G_DECLARE_FINAL_TYPE (FlMethodSuccessResponse, fl_method_success_response, FL, METHOD_SUCCESS_RESPONSE, FlMethodResponse) G_MODULE_EXPORT G_DECLARE_FINAL_TYPE(FlMethodErrorResponse |
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT | G_DECLARE_FINAL_TYPE (FlMethodNotImplementedResponse, fl_method_not_implemented_response, FL, METHOD_NOT_IMPLEMENTED_RESPONSE, FlMethodResponse) FlValue *fl_method_response_get_result(FlMethodResponse *response |
FlMethodSuccessResponse * | fl_method_success_response_new (FlValue *result) |
FlValue * | fl_method_success_response_get_result (FlMethodSuccessResponse *response) |
Variables | |
G_MODULE_EXPORT | fl_method_error_response |
G_MODULE_EXPORT | FL |
G_MODULE_EXPORT | METHOD_ERROR_RESPONSE |
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT GError ** | error |
#define FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark() |
FlMethodResponseError: @FL_METHOD_RESPONSE_ERROR_FAILED: Call failed due to an unspecified error. @FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR: An error was returned by the other side of the channel. @FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED: The requested method is not implemented.
Errors set by fl_method_response_get_result
when the method call response is not #FlMethodSuccessResponse.
Definition at line 30 of file fl_method_response.h.
Enumerator | |
---|---|
FL_METHOD_RESPONSE_ERROR_FAILED | |
FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR | |
FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED |
Definition at line 32 of file fl_method_response.h.
G_MODULE_EXPORT GQuark fl_method_response_error_quark | ( | void | ) |
FlValue * fl_method_success_response_get_result | ( | FlMethodSuccessResponse * | response | ) |
fl_method_success_response_get_result: @response: an #FlMethodSuccessResponse.
Gets the result of the method call.
Returns: an FlValue.
Definition at line 138 of file fl_method_response.cc.
FlMethodSuccessResponse * fl_method_success_response_new | ( | FlValue * | result | ) |
fl_method_success_response_new:
Creates a response to a method call when that method has successfully completed.
Returns: a new #FlMethodResponse.
Definition at line 126 of file fl_method_response.cc.
G_MODULE_EXPORT G_DECLARE_DERIVABLE_TYPE | ( | FlMethodResponse | , |
fl_method_response | , | ||
FL | , | ||
METHOD_RESPONSE | , | ||
GObject | |||
) |
Definition at line 44 of file fl_method_response.h.
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT G_DECLARE_FINAL_TYPE | ( | FlMethodNotImplementedResponse | , |
fl_method_not_implemented_response | , | ||
FL | , | ||
METHOD_NOT_IMPLEMENTED_RESPONSE | , | ||
FlMethodResponse | |||
) |
FlMethodResponse:
#FlMethodResponse contains the information returned when an #FlMethodChannel method call returns. If you expect the method call to be successful use fl_method_response_get_result(). If you want to handle error cases then you should use code like:
|[ if (FL_IS_METHOD_SUCCESS_RESPONSE (response)) { FlValue *result = fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE (response)); handle_result (result); } else if (FL_IS_METHOD_ERROR_RESPONSE (response)) { FlMethodErrorResponse *error_response = FL_METHOD_ERROR_RESPONSE (response); handle_error (fl_method_error_response_get_code (error_response), fl_method_error_response_get_message (error_response), fl_method_error_response_get_details (error_response)); } else if (FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE (response)) { handle_not_implemented (); } } ]| FlMethodSuccessResponse:
#FlMethodSuccessResponse is the #FlMethodResponse returned when a method call has successfully completed. The result of the method call is obtained using fl_method_success_response_get_result
. FlMethodErrorResponse:
#FlMethodErrorResponse is the #FlMethodResponse returned when a method call results in an error. The error details are obtained using fl_method_error_response_get_code
, fl_method_error_response_get_message
and fl_method_error_response_get_details
. FlMethodNotImplementedResponse:
#FlMethodNotImplementedResponse is the #FlMethodResponse returned when a method call is not implemented. fl_method_response_get_result: @response: an #FlMethodResponse. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.
Gets the result of a method call, or an error if the response wasn't successful.
Returns: an FlValue or NULL on error.
G_MODULE_EXPORT G_DECLARE_FINAL_TYPE | ( | FlMethodSuccessResponse | , |
fl_method_success_response | , | ||
FL | , | ||
METHOD_SUCCESS_RESPONSE | , | ||
FlMethodResponse | |||
) |
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT GError** error |
Definition at line 139 of file fl_method_response.h.
G_MODULE_EXPORT FL |
Definition at line 64 of file fl_method_response.h.
G_MODULE_EXPORT fl_method_error_response |
Definition at line 63 of file fl_method_response.h.
G_MODULE_EXPORT METHOD_ERROR_RESPONSE |
Definition at line 65 of file fl_method_response.h.