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

Read Encrypted Env Configuration or Generate Dart Models from Env Files with Ease.

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>("DATABASE_URL") ?? "Oops"),
            Text(EnvModel.apiKey),
          ],
        ),
      ),
    );
  }
}
23
likes
0
pub points
2%
popularity

Publisher

verified publisherinidia.app

Read Encrypted Env Configuration or Generate Dart Models from Env Files with Ease.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, encryptor, flutter, http, universal_file

More

Packages that depend on env_reader