flutter_env_native 0.1.0 copy "flutter_env_native: ^0.1.0" to clipboard
flutter_env_native: ^0.1.0 copied to clipboard

A plugin/utility that provides compile-time variables for native platforms.

example/lib/main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String name = const String.fromEnvironment("APP_NAME");
  String suffix = const String.fromEnvironment("APP_SUFFIX");

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('name: $name\n'),
              Text('suffix: $suffix\n'),
            ],
          ),
        ),
      ),
    );
  }
}
25
likes
160
points
1.99k
downloads

Publisher

verified publishermastersam.tech

Weekly Downloads

A plugin/utility that provides compile-time variables for native platforms.

Repository (GitHub)
View/report issues

Topics

#dotenv #environment-variables #env

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_env_native