flutter_secure_dotenv 1.0.1 copy "flutter_secure_dotenv: ^1.0.1" to clipboard
flutter_secure_dotenv: ^1.0.1 copied to clipboard

Package to securely manage environment variables and perform AES encryption/decryption in Flutter and Dart.

example/flutter_secure_dotenv_example.dart

import 'package:flutter_secure_dotenv/flutter_secure_dotenv.dart';

part 'env.g.dart';

@DotEnvGen(
  filename: '.env',
  fieldRename: FieldRename.screamingSnake,
)
abstract class Env {
  static Env create() {
    String encryptionKey = const String.fromEnvironment(
        "APP_ENCRYPTION_KEY"); // On build, change with your generated encryption key (use dart-define for String.fromEnvironment)
    String iv = const String.fromEnvironment(
        "APP_IV_KEY"); // On build, change with your generated iv (use dart-define for String.fromEnvironment)
    return Env(encryptionKey, iv);
  }

  const factory Env(String encryptionKey, String iv) = _$Env;

  const Env._();

  @FieldKey(defaultValue: "")
  String get apiBaseUrl;

  @FieldKey(defaultValue: "")
  String get apiWebSocketUrl;
}
copied to clipboard
5
likes
160
points
93
downloads

Publisher

verified publishermfazrinizar.com

Weekly Downloads

2024.09.05 - 2025.03.20

Package to securely manage environment variables and perform AES encryption/decryption in Flutter and Dart.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

pointycastle

More

Packages that depend on flutter_secure_dotenv