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

Returns information about the method used to install your app.

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:installer_info/installer_info.dart';

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

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

class _MyAppState extends State<MyApp> {
  InstallerInfo installerInfo;

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

  Future<void> initPlatformState() async {
    InstallerInfo installerInfo;
    try {
      installerInfo = await getInstallerInfo();
    } on PlatformException {}

    if (!mounted) return;

    setState(() => this.installerInfo = installerInfo);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Installer Info'),
        ),
        body: Center(
          child: Text(
            'Installed by:\n${installerInfo?.installer}\n${installerInfo?.installerName}',
            textAlign: TextAlign.center,
          ),
        ),
      ),
    );
  }
}
9
likes
0
pub points
85%
popularity

Publisher

verified publishercaiopo.com

Returns information about the method used to install your app.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on installer_info