[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-MkupBlpP-1625178380167)(https://ducafecat.tech/2021/07/02/translation/learn-the-best-way-to-hide-sensitive-keys-in-your-flutter-app/2021-07-02-06-19-17.png)]
猫哥说
有的时候我们需要在项目中隐藏敏感信息,比如你的阿里 OSS 账号 AccessKey ,写入代码中上传 git 仓库,是一件很危险的事情,所以我们需要用环境变量的方案来隐藏,记得你的 .env 文件要加入 .gitignore 文件中进行过滤呀。
老铁记得 转发 ,猫哥会呈现更多 Flutter 好文~~~~
微信群 ducafecat
b 站 https://space.bilibili.com/404904528
原文
https://medium.com/flutter-community/learn-the-best-way-to-hide-sensitive-keys-in-your-flutter-app-ac7638435401
代码
https://github.com/Wizpna/flutter_dotenv_tutorial.git
参考
- https://pub.dev/packages/flutter_dotenv