https://github.com/nicosnicolaou16/securedataflutter
This example project tested how we keep secure the data in Flutter, example, api key(s).
https://github.com/nicosnicolaou16/securedataflutter
dart flutter flutter-app flutter-example secure secure-api-key
Last synced: 7 months ago
JSON representation
This example project tested how we keep secure the data in Flutter, example, api key(s).
- Host: GitHub
- URL: https://github.com/nicosnicolaou16/securedataflutter
- Owner: NicosNicolaou16
- Created: 2023-12-29T22:15:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-08T21:31:59.000Z (over 1 year ago)
- Last Synced: 2024-12-25T05:13:29.929Z (over 1 year ago)
- Topics: dart, flutter, flutter-app, flutter-example, secure, secure-api-key
- Language: Dart
- Homepage:
- Size: 104 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Secure Data Flutter
[](https://linktr.ee/nicos_nicolaou)
[](https://nicosnicolaou16.github.io/)
[](https://twitter.com/nicolaou_nicos)
[](https://linkedin.com/in/nicos-nicolaou-a16720aa)
[](https://medium.com/@nicosnicolaou)
[](https://androiddev.social/@nicolaou_nicos)
[](https://bsky.app/profile/nicolaounicos.bsky.social)
[](https://dev.to/nicosnicolaou16)
[](https://www.youtube.com/@nicosnicolaou16)
[](https://g.dev/nicolaou_nicos)
This example project tests how we secure data in Flutter, such as API keys.
# Steps
1) Create the `.env` file inside the main directory.
2) Create the `env.dart` file.
3) For static variable ```static String apiKey = _Env``` and run the new command (the old one
deprecated) `dart run build_runner build` or
`dart run build_runner build--delete-conflicting-outputs`.
4) Generated.
5) Add the Key ```static String apiKey = _Env.apiKey```.
### Important Note:
For this example, keep the files with dummy/test API keys, but for a real project, you should add
them to the `.gitignore` file.
### Commands for Generation
`dart run build_runner build` or `dart run build_runner build --delete-conflicting-outputs`
## Versioning
Flutter SDK version: 3.35.2
Dart Version: 3.9.0
# References
https://pub.dev/packages/envied
https://medium.com/@r1n1os/securing-sensitive-data-in-flutter-d0a8e060a11e
https://github.com/r1n1os/Secure-Sensitive-Data-Example