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

PlatformAndroid

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 _isInFirebaseTestLab = 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 inFirebaseTestLab();
    setState(() {
      _isInFirebaseTestLab = result;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('is in FirebaseTest Lab'),
        ),
        body: Center(
          child: Text('is in FirebaseTest Lab: $_isInFirebaseTestLab\n'),
        ),
      ),
    );
  }
}
2
likes
130
pub points
62%
popularity

Publisher

verified publishergitjournal.io

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

Homepage

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_runtime_env