| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Use the hosted portal at https://flutterdotenv.com to create, manage and publish environment configs, then load them in your Flutter app by ID.
This package provides an extension on flutter_dotenv that fetches a JSON-based environment, loads it into dotenv, and caches the last successful result for offline fallback.
dependencies:
flutter_dotenv_remote: ^0.0.1
flutter_dotenv: ^6.0.0import '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(
// UUID from your environment entry on flutterdotenv.com
configId: '699fb309-6c5c-44fb-8612-b6a8dda08296',
useCacheOnFailure: true,
onLoadFailure: () {
// optional: UI fallback or logging
debugPrint('Failed to load config from remote and cache');
},
);
runApp(const MyApp());
}The library defaults to the Supabase instance used by the portal; you do not need to provide keys when consuming portal configs.
See Flutter Dotenv documentation for how to use the variables in your app.
If you run your own Supabase instance you can pass supabaseUrl and supabaseAnonKey, or provide a SupabaseClient instance (useful for testing or advanced scenarios):
await dotenv.loadRemote(
configId: 'your-id',
supabaseUrl: 'https://your-project.supabase.co',
supabaseAnonKey: 'your-anon-key',
// or
// supabaseClient: SupabaseClient(...),
);The portal's Supabase anon key is used solely for reading published environment configs. Do not store sensitive secrets in public configs; use appropriate server-side controls for secrets.
Open an issue or submit a PR. For portal support and account/tier questions use https://www.flutterdotenv.com.
This project is licensed under the terms in the repository LICENSE file.
| Back | FazBrowse Home | New Git URL |