flutter_ar_plugin 0.0.2 copy "flutter_ar_plugin: ^0.0.2" to clipboard
flutter_ar_plugin: ^0.0.2 copied to clipboard

flutter_ar_plugin is a Flutter plugin that allows users to load and display 3D models dynamically using ARKit. The plugin supports loading models and reference images from URLs and provides options fo [...]

flutter_ar_plugin #

flutter_ar_plugin is a Flutter plugin that allows users to load and display 3D models dynamically using ARKit. The plugin supports loading models and reference images from URLs and provides options for setting the model's scale factor.

Features #

  • Load 3D models (.glb format) dynamically from a URL.

  • Detect and track images as AR anchors.

  • Apply a dynamic scale factor to the loaded model.

  • Simple API to launch AR from Flutter.

Getting started #

To use this package, add flutter_ar_plugin as a dependency in your pubspec.yaml file:

    dependencies:
  flutter:
    sdk: flutter
  flutter_ar_plugin: latest

Usage #

Import the Plugin

    import 'package:flutter_ar_plugin/flutter_ar_plugin.dart';

Minimal example: Launch AR View

Use the FlutterArPlugin.launchARView method to load a model dynamically:

FlutterArPlugin.launchARView(
  modelUrl: "https://yourstorage.com/path-to-model.glb",
  imageUrl: "https://yourstorage.com/path-to-image.jpg",
  scaleFactor: 5.0, // Adjust the scale as needed
);

Example #

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text("AR Plugin Example")),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              String modelUrl = "https://yourstorage.com/path-to-model.glb";
              String imageUrl = "https://yourstorage.com/path-to-image.jpg";
              FlutterArPlugin.launchARView(
                  modelUrl: modelUrl, imageUrl: imageUrl, scaleFactor: 5.0);
            },
            child: Text("Launch AR"),
          ),
        ),
      ),
    );
  }
}

See also #

2
likes
140
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

flutter_ar_plugin is a Flutter plugin that allows users to load and display 3D models dynamically using ARKit. The plugin supports loading models and reference images from URLs and provides options for setting the model's scale factor.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_ar_plugin

Packages that implement flutter_ar_plugin