flutter - 为localStorage运行“flutter run -d chrome”时如何设置Chrome的端口?
问题描述
运行“flutter run -d chrome”时,有什么方法可以设置 Chrom 的端口吗?没有它,由于新的端口/来源,我的 localStorage 在每次运行时都会丢失。
或者是否有另一种方法可以跨不同端口保持 localStorage
解决方案
我也面临同样的问题。因此,我查找了与 flutter run 命令相关的资源,并找到了该命令的 Web 选项。
--web-port
您可以使用该选项设置任何端口。
flutter run -d chrome --web-port 8080
推荐阅读
- swift - WatchOS 6.0、Swift 5.0:无背景触觉
- c# - Azure Function v3 中的 System.Text.Json:JsonResult.SerializerSettings 必须是 JsonSerializerSettings 类型的实例
- c# - 将 DataTable 插入 MySQL 数据库表时缺少行
- php - PHP每天重命名文件
- python-3.x - 拥有 .dbf、.prj、.shp 和 .shx 文件时,如何在 geopandas 中读取 shapefile?
- angular - webapi核心无法上传被cors策略阻止的大文件
- azure - 从 Azure Web App Bot 获取 Qna Maker 错误
- swift - 如何在 Swift 中定义单例
- php - Laravel - 未定义的变量:模块
- powershell - PowerShell,术语“xxxxxx”未被识别为 cmdlet 的名称