Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iakashpattnaik/dart_dotenv
A simple bridge between dotenv and dartlang.
https://github.com/iakashpattnaik/dart_dotenv
dart dotenv
Last synced: about 2 months ago
JSON representation
A simple bridge between dotenv and dartlang.
- Host: GitHub
- URL: https://github.com/iakashpattnaik/dart_dotenv
- Owner: iAkashPattnaik
- License: agpl-3.0
- Created: 2021-08-12T04:24:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T16:07:24.000Z (about 3 years ago)
- Last Synced: 2024-11-05T11:00:35.155Z (2 months ago)
- Topics: dart, dotenv
- Language: Dart
- Homepage: https://pub.dev/packages/dart_dotenv
- Size: 17.6 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
#
dart_dotenv
A simple and easy to use dotenv library for Dart (dartlang).
## Usage
A simple usage example:
```dart
import 'package:dart_dotenv/dart_dotenv.dart';main(List args) {
final dotEnv = DotEnv(filePath: '.env');// Check if file exists or not.
print('.env exists ? - ${dotEnv.exists()}');
// Create a new [filePath] file if not exists.
print('.env Created New ? - ${dotEnv.createNew()}');
// Get a specific value from [.env] file.
print('.env value of "someSpecificKey" ? - ${dotEnv.get("someSpecificKey")}');
// Get the whole data of [.env] file as [Map].
print('.env data ? - ${dotEnv.getDotEnv()}');
// Set a new value to and existing key or a completely new set of key and value.
print('.env append new data ? - ${dotEnv.set("newKey", "newValue")}');
// Save the new data to `[filePath]` file.
print('.env save to file ? - ${dotEnv.saveDotEnv()}');
}
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: htts://github.com/BLUE-DEVIL1134/dart_dotenv/issues