flutter_runtime_env 0.0.1 copy "flutter_runtime_env: ^0.0.1" to clipboard
flutter_runtime_env: ^0.0.1 copied to clipboard

outdated

Gives you some information about the runtime env. Such as if it is running in the Firebase TestLab

example/lib/main.dart

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

import 'package:flutter_runtime_env/flutter_runtime_env.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  bool _shouldBeEnabled = false;

  @override
  void initState() {
    super.initState();
    initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    var result = await shouldEnableAnalytics();
    setState(() {
      _shouldBeEnabled = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Should Enable Analytics'),
        ),
        body: Center(
          child: Text('Should Analytics be Enabled: $_shouldBeEnabled\n'),
        ),
      ),
    );
  }
}
2
likes
0
points
60
downloads

Publisher

verified publishergitjournal.io

Weekly Downloads

Gives you some information about the runtime env. Such as if it is running in the Firebase TestLab

Homepage

License

unknown (license)

Dependencies

flutter

More

Packages that depend on flutter_runtime_env