env_builder_cli 1.0.0+1 copy "env_builder_cli: ^1.0.0+1" to clipboard
env_builder_cli: ^1.0.0+1 copied to clipboard

A Flutter CLI tool to automate the creation and maintenance of the env Flutter package from multiple .env files.

example/lib/main.dart

// import 'package:env/env.dart';
import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Env Builder CLI',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
      ),
      home: const MyHomePage(title: 'Env Builder CLI'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String baseUrl = '';
  // final appFlavor = AppFlavor.production();

  // @override
  // void initState() {
  //   if (mounted) {
  //     setState(() {
  //       baseUrl = appFlavor.getEnv(Env.baseUrl);
  //     });
  //   }
  //   super.initState();
  // }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(child: Text('App base url: $baseUrl')),
    );
  }
}
2
likes
150
points
9
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter CLI tool to automate the creation and maintenance of the env Flutter package from multiple .env files.

Repository (GitHub)

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

path, universal_io, yaml, yaml_edit

More

Packages that depend on env_builder_cli