raavailability 0.1.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 80

raavailability #

A flutter plugin that check if AR is available for Android and IOS. To check for android we use com.google.ar.core and to check for IOS we use ARKit.

Getting Started #

You have to put in your AndroidManifest.xml inside application <meta-data android:name="com.google.ar.core" android:value="required" /> or <meta-data android:name="com.google.ar.core" android:value="optional" />

Android #

If device supported RA and already have Google Play Services for RA installed, the method Raavailability.isSupported returns true, if Google Play Services for RA isn't installed yet, we ask the user to install, open the Google Play Services for RA page at play store and Raavailability.isSupported returns false.
After that, if the device is able to install and the user install, the Raavailability.isSupported will return true. If the user dont install, the Raavailability.isSupported will keep returning false.

IOS #

For Ios if device have IOS 11 or higher we check ARKit.isSupported, otherwise will return false.

Example #

See the example file.

0.0.1 #

Implementing the isSupported function for android.

0.0.2 #

Changing plugin name, running flutter format and add a homepage url.

0.0.3 #

Changing min sdk version from 14 to 16.

0.0.4 #

Improoving Example file.

0.0.5 #

Changing dependencies place.

0.0.6 #

Changing google ar core version.

0.1.0 #

Using requestInstall instead of isSupported

0.1.1 #

Implementing IOS check for ARKit.

0.1.2 #

Request install now is always true for android.

0.1.3 #

Removing unused variables and updating readme.

0.1.4 #

Updating readme.

0.1.5 #

Correcting a error that make the google play store open forever after user close it.

0.1.6 #

Using another implementation fo arcoreApk.request install.

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:raavailability/raavailability.dart';

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

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

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

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

  Future<void> initPlatformState() async {
    bool supported;
    try {
      supported = await Raavailability.isSupported;
    } on PlatformException {
      supported = false;
    }

    if (!mounted) return;

    setState(() {
      _supported = supported;
      exibirResultado = true;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('RA Availability example'),
        ),
        body: Column(
          children: <Widget>[
            SizedBox(
              height: 24,
            ),
            Center(
              child: Text(
                'Click at the button bellow to check if device support AR.',
                textAlign: TextAlign.center,
                style: TextStyle(
                    fontSize: 16,
                    color: Colors.blue,
                    fontWeight: FontWeight.w800),
              ),
            ),
            FlatButton(
              color: Colors.black,
              onPressed: () {
                initPlatformState();
              },
              child: Text(
                "Check",
                style: TextStyle(color: Colors.white),
              ),
            ),
            exibirResultado
                ? Text(
                    _supported.toString(),
                    style: TextStyle(
                      fontSize: 32,
                    ),
                  )
                : Container(),
          ],
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  raavailability: ^0.1.6

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:raavailability/raavailability.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
60
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
80
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:raavailability/raavailability.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:raavailability/raavailability.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:raavailability/raavailability.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:raavailability/raavailability.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [raavailability] that is in a package requiring null.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test