5#ifndef FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_METHOD_RESULT_FUNCTIONS_H_
6#define FLUTTER_SHELL_PLATFORM_COMMON_CLIENT_WRAPPER_INCLUDE_FLUTTER_METHOD_RESULT_FUNCTIONS_H_
23 const std::string& error_message,
24 const T* error_details)>;
30template <
typename T = EncodableValue>
38 : on_success_(on_success),
40 on_not_implemented_(
std::move(on_not_implemented)) {}
58 const std::string& error_message,
59 const T* error_details)
override {
61 on_error_(error_code, error_message, error_details);
67 if (on_not_implemented_) {
68 on_not_implemented_();
virtual ~MethodResultFunctions()=default
void SuccessInternal(const T *result) override
void NotImplementedInternal() override
MethodResultFunctions(ResultHandlerSuccess< T > on_success, ResultHandlerError< T > on_error, ResultHandlerNotImplemented< T > on_not_implemented)
MethodResultFunctions(MethodResultFunctions const &)=delete
void ErrorInternal(const std::string &error_code, const std::string &error_message, const T *error_details) override
MethodResultFunctions & operator=(MethodResultFunctions const &)=delete
Dart_NativeFunction function
std::function< void()> ResultHandlerNotImplemented
std::function< void(const std::string &error_code, const std::string &error_message, const T *error_details)> ResultHandlerError
std::function< void(const T *result)> ResultHandlerSuccess