flutter_hms_gms_checker 1.0.0 copy "flutter_hms_gms_checker: ^1.0.0" to clipboard
flutter_hms_gms_checker: ^1.0.0 copied to clipboard

Check whether gms or hms services are available on device.

flutter_hms_gms_checker #

A null safe porting of https://pub.dev/packages/flutter_hms_gms_availability

Example #

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

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

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

class _MyAppState extends State<MyApp> {
  late bool gms, hms;

  @override
  void initState() {
    super.initState();
    FlutterHmsGmsChecker.isGmsAvailable.then((t) {
      setState(() {
        gms = t;
      });
    });
    FlutterHmsGmsChecker.isHmsAvailable.then((t) {
      setState(() {
        hms = t;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('HMS/GMS Availability'),
        ),
        body: Center(
          child: Text('GMS Available:  $gms\nHMS Available:  $hms'),
        ),
      ),
    );
  }
}

3
likes
120
pub points
73%
popularity

Publisher

unverified uploader

Check whether gms or hms services are available on device.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_hms_gms_checker