सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
arkit_plugin एक Flutter पैकेज है जो विकासकर्ताओं को iOS एप्लिकेशन में Apple के ARKit को एम्बेड करने की अनुमति देता है, जिससे एडवांस्ड रियलिटी अनुभव संभव होते हैं। यह ARKit की मुख्य सुविधाओं जैसे समतल डिटेक्शन, ऑब्जेक्ट ट्रैकिंग और 3D रेंडरिंग को Flutter-अनुकूल इंटरफ़ेस के माध्यम से प्रदान करता है। iOS के लिए विशेष रूप से डिज़ाइन किया गया, यह प्लगइन Flutter ऐप्स में AR कंटेंट को बिना किसी दिक्कत के एम्बेड करने की अनुमति देता है, नेटिव प्रदर्शन और क्षमताओं का उपयोग करता है। विकासकर्ता न्यूनतम बॉयलरप्लेट के साथ अंतर्निहित AR ऐप्स बना सकते हैं, जिसमें Dart का उपयोग AR सेशन को नियंत्रित करने और वास्तविक दुनिया के वातावरण से बातचीत करने के लिए किया जाता है।
उपयोग
AR उत्पाद विज़ुअलाइज़र्स बनाना
इंटरैक्टिव AR गेम्स बनाना
आभासी फर्नीचर स्थापना सक्षम करें
शैक्षिक AR अनुभव विकसित करना
मुख्य विशेषताएँ
मूल एआरकिट एन्टीग्रेशन
समतल और छवि डिटेक्शन
3D मॉडल रेंडरिंग
रियल-टाइम कैमरा और मोशन ट्रैकिंग
Flutter-समर्थित API
इनके लिए उपयुक्त
iOS AR ऐप विकासकर्ता
उत्पाद विज़ुअलाइज़ेशन ऐप्स
शैक्षिक AR उपकरण
इंटरैक्टिव गेमिंग एप्लिकेशन्स
विचार योग्य बातें
iOS-केवल प्लेटफॉर्म समर्थन
ARKit समर्थित उपकरणों की आवश्यकता है
Apple इकोसिस्टम तक सीमित
AR सत्र जीवनचक्र का सावधानीपूर्वक प्रबंधन की आवश्यकता है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
Note: ARKit is only supported by mobile devices with A9 or later processors (iPhone 6s/7/SE/8/X, iPad 2017/Pro) on iOS 11 and newer. For some features iOS 12 or newer is required. Flutter >=3.19.0 supports iOS 12.0 and newer, if iOS 11 support is needed use the plugin version before 1.1.0.
ARKit uses the device camera, so do not forget to provide the NSCameraUsageDescription. You may specify it in Info.plist like that:
<key>NSCameraUsageDescription</key><string>Describe why your app needs AR here.</string>
Update Podfile
At the top level of the ios folder uncomment the second line in the Podfile and change the iOS minimum version from 9.0 to the appropriate one.
The minimum supported iOS version is 13.0.
From:
# platform :ios, '9.0'
To:
platform :ios, '13.0'
NOTE: If when running for the first time you get a cocoapods error, delete the Podfile.lock file in the ios folder. Open the ios folder in the terminal and run:
If you prefer video here is a playlist with "AR in Flutter" videos:
UX advice
You might want to check the device capabilities before establishing an AR session. Review the Check Support sample for the implementation details.
If your app requires placing objects consider using coaching overlays. Review the Custom Object sample for the implementation details.
TrueDepth / Face Tracking
TrueDepth/face-tracking code is not compiled in by default, so most apps are App Store-safe without any extra configuration.
If your app uses face tracking, opt in by enabling the ENABLE_TRUEDEPTH_API Swift flag. Flutter 3.44+ builds plugins with Swift Package Manager, so follow the SPM steps below. The CocoaPods section applies only to older Flutter versions that still build with CocoaPods — if you've configured SPM, you don't need it.
SPM (Flutter 3.44+) — Add a key to ios/Runner/Info.plist:
<key>ARKitFaceTrackingEnabled</key><true/>
Then clear the SwiftPM manifest cache and DerivedData so Xcode re-evaluates the package manifest with the new value:
Important: clearing the manifest cache is required. SwiftPM caches the
evaluated Package.swift keyed on the manifest's own contents, so a change to
Info.plist alone does not invalidate it — flutter clean and Xcode's
Clean Build Folder are not enough on their own.
For monorepos or other layouts where ios/Runner/Info.plist is not found automatically, use an environment variable instead:
# When building from terminal (flutter run / flutter build)export ARKIT_FACE_TRACKING_ENABLED=1
# When building from Xcode GUI
launchctl setenv ARKIT_FACE_TRACKING_ENABLED 1
Then clear the SwiftPM manifest cache and DerivedData as above.
CocoaPods (older Flutter versions only) — if your project still builds with CocoaPods instead of SPM, add to ios/Podfile:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
if target.name == 'arkit_plugin'
target.build_configurations.each do |config|
config.build_settings['OTHER_SWIFT_FLAGS'] = '$(inherited) -DENABLE_TRUEDEPTH_API'
end
end
end
end
FAQ
Is it possible to use this plugin on Android?
No, as ARKit is not available on Android. You might want to try ARCore plugin instead.
My app crashes when I open the AR scene several times. Why?
Most probably that's because you didn't call dispose method on the ARKit controller.
One of the features I need is merged in the repository, but is not available on pub.dev. How can I use the latest version?
You may use the latest version by changing the pubspec.yaml dependency to: