Skip to main content

arfit_sdk 1.0.2 copy "arfit_sdk: ^1.0.2" to clipboard
arfit_sdk: ^1.0.2 copied to clipboard

ARFit SDK - Augmented Reality shopping experience for mobile and web. Flutter ve Web entegrasyonu ile 3 satırda AR deneyimi ekleyin!

example/lib/main.dart

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

void main() {
  // SDK'yı başlat
  ARFitAnalytics().initialize(
    apiUrl: 'https://arfit-api.arfitcompany.workers.dev',
  );

  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'ARFit SDK Example',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: const ProductPage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('ARFit SDK Örnek'),
        backgroundColor: const Color(0xFF0082C3),
        foregroundColor: Colors.white,
      ),
      body: Stack(
        children: [
          SingleChildScrollView(
            padding: const EdgeInsets.all(20),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Container(
                  height: 200,
                  decoration: BoxDecoration(
                    color: Colors.grey[300],
                    borderRadius: BorderRadius.circular(12),
                  ),
                  child: const Center(
                    child: Text(
                      'Ürün Görseli',
                      style: TextStyle(fontSize: 18, color: Colors.grey),
                    ),
                  ),
                ),
                const SizedBox(height: 20),
                const Text(
                  'Örnek Ürün',
                  style: TextStyle(
                    fontSize: 24,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                const SizedBox(height: 10),
                const Text(
                  '₺12.999',
                  style: TextStyle(
                    fontSize: 28,
                    color: Colors.green,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                const SizedBox(height: 20),
                const Text(
                  'Ürün Açıklaması',
                  style: TextStyle(
                    fontSize: 18,
                    fontWeight: FontWeight.bold,
                  ),
                ),
                const SizedBox(height: 10),
                const Text(
                  'Bu örnek bir üründür. ARFit SDK kullanarak AR özelliğini kolayca entegre edebilirsiniz.',
                  style: TextStyle(fontSize: 14, height: 1.5),
                ),
                const SizedBox(height: 30),
                
                // ARFit Butonu
                SizedBox(
                  width: double.infinity,
                  child: ARFitButton(
                    productId: 'example-product',
                    productName: 'Örnek Ürün',
                    modelUrl: 'https://modelviewer.dev/shared-assets/models/Astronaut.glb',
                    onAROpened: () {
                      debugPrint('AR açıldı!');
                    },
                    onARClosed: () {
                      debugPrint('AR kapandı!');
                    },
                  ),
                ),
                
                const SizedBox(height: 120),
              ],
            ),
          ),
          
          // Floating AR Bubble
          ARFitFloatingButton(
            productId: 'example-product',
            productName: 'Örnek Ürün',
            modelUrl: 'https://modelviewer.dev/shared-assets/models/Astronaut.glb',
            showDelay: const Duration(seconds: 2),
            onAROpened: () {
              debugPrint('AR baloncuktan açıldı!');
            },
          ),
        ],
      ),
    );
  }
}
0
likes
145
points
45
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

ARFit SDK - Augmented Reality shopping experience for mobile and web. Flutter ve Web entegrasyonu ile 3 satırda AR deneyimi ekleyin!

Homepage

License

MIT (license)

Dependencies

crypto, flutter, http, webview_flutter

More

Packages that depend on arfit_sdk