env_reader 1.1.0 copy "env_reader: ^1.1.0" to clipboard
env_reader: ^1.1.0 copied to clipboard

Enhance the rock-solid integrity of your .env configuration by seamlessly encrypting and decrypting data sourced from a dynamic range of origins—be it assets, files, strings, memory, or networks—spann [...]

example/lib/main.dart

import 'package:env_reader/env_reader.dart';
import 'package:example/src/env_model.dart';
import 'package:flutter/material.dart';

Future<void> main(List<String> arguments) async {
  WidgetsFlutterBinding.ensureInitialized();
  await Env.load(
    source: EnvLoader.asset('assets/env/.env'),
    password: "MyStrongPassword",
  );
  runApp(
    const MaterialApp(
      title: "Env Reader",
      debugShowCheckedModeBanner: false,
      home: MyApp(),
    ),
  );
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.max,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text(Env.read<String>("MY_STRING") ?? "Oops"),
            Text(EnvModel.apiKey),
          ],
        ),
      ),
    );
  }
}
23
likes
0
points
75
downloads

Publisher

verified publisherinidia.app

Weekly Downloads

Enhance the rock-solid integrity of your .env configuration by seamlessly encrypting and decrypting data sourced from a dynamic range of origins—be it assets, files, strings, memory, or networks—spanning a multitude of platforms. What's more, experience the sheer simplicity of generating Dart models directly from your .env data. Your configuration, fortified and efficient, ready to elevate your development journey.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, encryptor, flutter, http, universal_file

More

Packages that depend on env_reader