Skip to content

[webview_flutter] Update webview_flutter (2.3.0) #269

Merged
bbrto21 merged 2 commits intoflutter-tizen:masterfrom
bwikbs:webview_update
Nov 9, 2021
Merged

[webview_flutter] Update webview_flutter (2.3.0) #269
bbrto21 merged 2 commits intoflutter-tizen:masterfrom
bwikbs:webview_update

Conversation

@bwikbs
Copy link
Copy Markdown
Member

@bwikbs bwikbs commented Nov 9, 2021

webview_flutter

  • Update base to 2.3.0

#267

@github-actions github-actions Bot added needs-publishing The package should be published after merge p: webview_flutter labels Nov 9, 2021
@bwikbs bwikbs changed the title [webview_flutter] Update webview_flutter (2.3.0) [multi-packages] Replace deprecated API Nov 9, 2021
@bwikbs bwikbs marked this pull request as draft November 9, 2021 04:43
Signed-off-by: MuHong Byun <mh.byun@samsung.com>
@bwikbs bwikbs changed the title [multi-packages] Replace deprecated API [webview_flutter] Update webview_flutter (2.3.0) Nov 9, 2021
@bwikbs bwikbs marked this pull request as ready for review November 9, 2021 05:45
@bwikbs
Copy link
Copy Markdown
Member Author

bwikbs commented Nov 9, 2021

@HakkyuKim
Now, webview is ready. Google Maps should be after this.

@seungsoo47 @bbrto21
Plz, check this PR

@bbrto21
Copy link
Copy Markdown
Contributor

bbrto21 commented Nov 9, 2021

The problem below can be fixed after this PR. we can ignore it.

   info - google_maps_flutter/lib/src/circle.dart:31:32 - 'evaluateJavascript' is deprecated and shouldn't be used. Use [runJavascript] or [runJavascriptReturningResult]. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use

Comment on lines +863 to +876
} else if (method_name.compare("runJavascript") == 0) {
if (std::holds_alternative<std::string>(arguments)) {
std::string js_string = std::get<std::string>(arguments);
webview_instance_->EvaluateJavaScript(
js_string, [res = result.release()](std::string value) {
LOG_DEBUG("value: %s\n", value.c_str());
if (res) {
res->Success();
delete res;
}
});
} else {
result->Error("InvalidArguments", "Please set javascript string");
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about:

else if (method_name.compare("evaluateJavascript") == 0 ||
             method_name.compare("runJavascriptReturningResult") == 0 ||
             method_name.compare("runJavascript") == 0) {
    if (std::holds_alternative<std::string>(arguments)) {
      std::string js_string = std::get<std::string>(arguments);
      webview_instance_->EvaluateJavaScript(
          js_string, [res = result.release()](std::string value) {
            LOG_DEBUG("value: %s\n", value.c_str());
            if (res) {
              bool returns_value =
                  method_name.compare("runJavascript") == 0 ? false : true;
              if (returns_value) {
                res->Success(flutter::EncodableValue(value));
              } else {
                res->Success();
              }
              delete res;
            }
          });
    } else {
      result->Error("InvalidArguments", "Please set javascript string");
    }
  }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is much better, thank you! 👍

@HakkyuKim
Copy link
Copy Markdown
Contributor

HakkyuKim commented Nov 9, 2021

The problem below can be fixed after this PR. we can ignore it.

   info - google_maps_flutter/lib/src/circle.dart:31:32 - 'evaluateJavascript' is deprecated and shouldn't be used. Use [runJavascript] or [runJavascriptReturningResult]. Try replacing the use of the deprecated member with the replacement. - deprecated_member_use

OK, all analyze errors are related to google_maps_flutter, we can force merge this first, then #270 can rebase afterwards.

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
Copy link
Copy Markdown
Contributor

@HakkyuKim HakkyuKim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bbrto21 bbrto21 merged commit 656fbab into flutter-tizen:master Nov 9, 2021
bwikbs added a commit to bwikbs/plugins that referenced this pull request Mar 26, 2022
* [webview_flutter] Update webview_flutter (2.3.0)

Signed-off-by: MuHong Byun <mh.byun@samsung.com>

* Apply reviewer's comment

Signed-off-by: MuHong Byun <mh.byun@samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-publishing The package should be published after merge p: webview_flutter

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants