raavailability 0.0.3 copy "raavailability: ^0.0.3" to clipboard
raavailability: ^0.0.3 copied to clipboard

outdated

Plugin to check if AR is available on android and ios devices.

example/lib/main.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 = false;
  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>[
            Center(
              child: Text(
                  'Click at the button bellow to check if device support AR.'),
            ),
            FlatButton(
              color: Colors.green,
              onPressed: () {
                initPlatformState();
              },
              child: Text("Check"),
            ),
            exibirResultado ? Text(_supported.toString()) : Container(),
          ],
        ),
      ),
    );
  }
}
1
likes
0
pub points
42%
popularity

Publisher

unverified uploader

Plugin to check if AR is available on android and ios devices.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on raavailability