ar_quick_look 0.2.0
ar_quick_look: ^0.2.0 copied to clipboard
Show a USDZ or Reality file in Apple's AR Quick Look, placed in the room through the camera. iOS, with the system viewer rather than a rebuilt one.
0.2.0 #
An audit of every package in this repo found three defects here, one of which served the wrong model.
Added #
AlreadyPresentingException, andrefreshonmaterializeAsset.
Fixed #
- Two assets with the same filename served each other's bytes. The cached
copy was keyed on the basename, so
assets/chairs/model.usdzandassets/tables/model.usdzwrote to one path — and since the cache check was only "exists and non-empty", whichever landed first was shown for both. The copy is namespaced by the whole asset key now, and still ends in.usdzso Quick Look sniffs it correctly. - A second
present()blanked the first viewer and stranded its future. The new session replaced the old one, which deallocated it — and the controller holds its data source weakly, so the open viewer went empty while the firstawaitnever returned. There is one screen, so a second present is now refused withAlreadyPresentingException. - Only the first file's format was checked.
presentAllexistence-checks every path and the controller opens oninitialIndex, so a bad model anywhere but position zero sailed past the precheck and failed inside Quick Look instead. Every item is checked, and the message names the offender. - A missing asset key threw a raw
FlutterError, escaping the sealed exception hierarchy — the commonest setup mistake this package has was not catchable as one of its own. It is aFileNotFoundExceptionnaming the pubspec now. - An interrupted copy is no longer cached: the write goes to a
.partfile and is renamed into place.
0.1.0 #
Initial release: Apple's AR Quick Look for Flutter.
ArQuickLook.presentshows a USDZ or Reality file in the system viewer, and completes when the user closes it rather than when it opens.canPreviewasks Quick Look whether it will actually read a file, so a wrong-format file with the right extension is refused before a viewer is put on screen.presentAssetcopies a bundled asset out to a real file first, because Quick Look needs a path and a Flutter asset is not one. The copy is cached;materializeAssetis public for anything else that needs a path.allowsContentScaling: falsefor models whose size is the point, andcanonicalWebPagefor where Quick Look's Share button should lead.presentAllfor several models the user can page between.- Errors are a sealed hierarchy, never a bare
PlatformException.
Pairs with roomplan: the USDZ it exports
goes straight into present.
Verified on a Simulator — registration, support, and every error path,
including a text file renamed .usdz being refused. The AR camera experience
itself needs a real device.