private void SendError(FlutnetMethodInfo methodInfo, PlatformOperationException exception)
        {
            FlutnetMessage message = new FlutnetMessage
            {
                MethodInfo = methodInfo,
                // NOTE: Please consider remove ErrorCode and ErrorMessage
                ErrorCode    = FlutnetErrorCode.OperationFailed,
                ErrorMessage = exception.Message,
                Exception    = exception
            };

            Send(message);
        }
Exemple #2
0
        private void SendError(FlutnetMethodInfo methodInfo, PlatformOperationException exception)
        {
            FlutnetMessage message = new FlutnetMessage
            {
                MethodInfo = methodInfo,
                // NOTE: Please consider removing ErrorCode and ErrorMessage
                ErrorCode    = FlutnetErrorCode.OperationFailed,
                ErrorMessage = exception.Message,
                Exception    = exception
            };

            NSObject dartReturnValue = FlutterInterop.ToMethodChannelResult(message);

            Console.WriteLine("Sending error to Flutter...");
            MainThread.BeginInvokeOnMainThread(() => _methodChannelIncoming.InvokeMethod("error", dartReturnValue));
        }