首页 > 解决方案 > Flutter 中的 Google 搜索

问题描述

是否有任何插件或可能性在颤振应用程序中添加谷歌搜索?将有一个带有文本的按钮。如果用户单击该按钮,它将获取该文本并转到浏览器并在谷歌中搜索。在html中是这样的:

<form method="get" action="http://www.google.com/search"> 
<div style="border:1px solid black;padding:4px;width:20em;"> <table border="0" cellpadding="0"> 
<tr>
<td> 
<input type="text" name="q" size="25" maxlength="255" value="" /> 
<input type="submit" value="Google Search" />
</td>
</tr>
</table> 
</div>
</form>

如何在颤振中实现这一点?

标签: dartflutter

解决方案


使用url_launcher插件。要搜索特定事物,请将查询参数附加到 google url,例如:https://www.google.com/search?q=query+goes+here


推荐阅读