object_3d 0.0.1 copy "object_3d: ^0.0.1" to clipboard
object_3d: ^0.0.1 copied to clipboard

Simple Flutter renderer for .obj files

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Object 3D Example'),
      ),
      body: const Center(
        child: Object3D(
          size: Size(400.0, 400.0),
          path: "assets/file.obj",
        ),
      ),
    );
  }
}