CashedARViewer class

A cross-platform AR viewer that automatically handles iOS and Android platforms

Inheritance

Constructors

CashedARViewer({Key? key, required String androidModelUrl, required String iosModelUrl, required String productId, required String productName, bool autoRotate = true, bool ar = true, bool disableZoom = false, bool disablePan = false, String cameraControls = 'auto', Color? backgroundColor, Widget? loadingWidget, Widget? errorWidget, ARCacheOptions cacheOptions = const ARCacheOptions(), VoidCallback? onModelLoading, VoidCallback? onModelLoaded, void onError(String error)?, VoidCallback? onIOSARPresented, VoidCallback? onIOSARDismissed})
const

Properties

androidModelUrl String
The URL of the Android 3D model (GLB format)
final
ar bool
Whether to enable AR mode
final
autoRotate bool
Whether to enable auto-rotation of the model (Android only)
final
backgroundColor Color?
Background color for the viewer
final
cacheOptions ARCacheOptions
Cache options for downloading and storing models
final
cameraControls String
Camera controls settings (Android only)
final
disablePan bool
Whether to disable pan functionality (Android only)
final
disableZoom bool
Whether to disable zoom functionality (Android only)
final
errorWidget Widget?
Error widget to show if model fails to load
final
hashCode int
The hash code for this object.
no setterinherited
iosModelUrl String
The URL of the iOS 3D model (USDZ format)
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingWidget Widget?
Loading widget to show while preparing the model
final
onError → void Function(String error)?
Callback called when an error occurs
final
onIOSARDismissed VoidCallback?
Callback called when iOS AR viewer is dismissed
final
onIOSARPresented VoidCallback?
Callback called when iOS AR viewer is presented
final
onModelLoaded VoidCallback?
Callback called when the model finishes loading
final
onModelLoading VoidCallback?
Callback called when the model starts loading
final
productId String
Unique identifier for the product (used for caching)
final
productName String
Display name for the product
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

showARModal(BuildContext context, {required String androidModelUrl, required String iosModelUrl, required String productId, required String productName, bool autoRotate = true, bool ar = true, bool disableZoom = false, bool disablePan = false, String cameraControls = 'auto', Color? backgroundColor, ARCacheOptions cacheOptions = const ARCacheOptions(), VoidCallback? onModelLoading, VoidCallback? onModelLoaded, void onError(String error)?, VoidCallback? onIOSARPresented, VoidCallback? onIOSARDismissed}) Future<void>
Shows AR content in a full-screen modal