如何在flutter web应用程序中设置页面描述?



我知道你可以用下面的代码设置你的web应用程序的标题:

MaterialApp(
title: 'App Title',
...

但是有可能以同样的方式设置描述元标签吗?

默认显示:

<meta name="description" content="A new Flutter project.">

我的解决方案非常简单-我只需要编辑位于web/index.html的文件。

我仍然不确定如何动态地设置描述-但这可能只是少数试图提供可被爬虫读取的flutter应用程序的情况。

你可以编辑标签meta

<meta name="description" content="Your description here...">

文件夹web和文件index.htmlweb/index . html

最新更新