flutter_dotenv_remote 0.0.2 copy "flutter_dotenv_remote: ^0.0.2" to clipboard
flutter_dotenv_remote: ^0.0.2 copied to clipboard

Load dotenv config from the web into your app. With offline caching and optional self-hosted Supabase support.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_dotenv_remote/flutter_dotenv_remote.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  await dotenv.loadRemote(configId: 'b9420180-b53c-434e-9fe6-f62424720fbc');

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    final envVars = dotenv.env.entries.toList();

    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Remote Env Example')),
        body: Padding(
          padding: const EdgeInsets.all(16.0),
          child: envVars.isEmpty
              ? const Text('No environment variables loaded.')
              : ListView.builder(
                  itemCount: envVars.length,
                  itemBuilder: (context, index) {
                    final entry = envVars[index];
                    return ListTile(
                      title: Text(entry.key),
                      subtitle: Text(entry.value),
                    );
                  },
                ),
        ),
      ),
    );
  }
}
1
likes
160
points
22
downloads

Publisher

unverified uploader

Weekly Downloads

Load dotenv config from the web into your app. With offline caching and optional self-hosted Supabase support.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_dotenv, shared_preferences, supabase_flutter

More

Packages that depend on flutter_dotenv_remote