Skip to content

Commit

Permalink
Fix a platform view bug (#33)
Browse files Browse the repository at this point in the history
* If creating a platform view instance fails, the engine has to send an error to flutter through method channel
  • Loading branch information
seungsoo47 authored Feb 3, 2021
1 parent 677661c commit 7a6dd58
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions shell/platform/tizen/channels/platform_view_channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,19 @@ void PlatformViewChannel::HandleMethodCall(

auto viewInstance =
it->second->Create(viewId, width, height, byteMessage);
view_instances_.insert(
std::pair<int, PlatformView*>(viewId, viewInstance));

if (engine_ && engine_->text_input_channel) {
Ecore_IMF_Context* context =
engine_->text_input_channel->GetImfContext();
viewInstance->SetSoftwareKeyboardContext(context);
if (viewInstance) {
view_instances_.insert(
std::pair<int, PlatformView*>(viewId, viewInstance));

if (engine_ && engine_->text_input_channel) {
Ecore_IMF_Context* context =
engine_->text_input_channel->GetImfContext();
viewInstance->SetSoftwareKeyboardContext(context);
}
result->Success(flutter::EncodableValue(viewInstance->GetTextureId()));
} else {
result->Error("Can't create a webview instance!!");
}

result->Success(flutter::EncodableValue(viewInstance->GetTextureId()));
} else {
FT_LOGE("can't find view type = %s", viewType.c_str());
result->Error("Can't find view type");
Expand Down

0 comments on commit 7a6dd58

Please sign in to comment.