Skip to content

magicleon94/flutter_hms_gms_checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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'),
        ),
      ),
    );
  }
}

About

Check whether gms or hms services are available on device.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published