fluent_environment 0.4.0 copy "fluent_environment: ^0.4.0" to clipboard
fluent_environment: ^0.4.0 copied to clipboard

Package that provides a way to register your environment globally and display it.

example/lib/main.dart

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

import 'app_environment.dart';

void main() async {
  await Fluent.build([EnvironmentModule(environment: AppEnvironment())]);

  runApp(const MainApp());
}

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

  @override
  Widget build(BuildContext context) {
    // Return environment banner to display the current environment

    // Return the current environment
    final environment = Fluent.get<EnvironmentApi>().environment;

    return MaterialApp(
      title: 'Fluent Environment Example',
      builder: (context, child) => EnvironmentBanner(child: child!),
      home: Scaffold(
        body: Center(child: Text("Environment: ${environment.name}")),
      ),
    );
  }
}
0
likes
150
points
173
downloads

Publisher

unverified uploader

Weekly Downloads

Package that provides a way to register your environment globally and display it.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

fluent_environment_api, fluent_sdk, flutter

More

Packages that depend on fluent_environment