MockDeviceKit class

Controls the Meta Wearables Mock Device Kit.

Enables you to test your app without physical Ray-Ban glasses.

Basic usage in a Flutter test:

setUp(() async {
  await MockDeviceKit.enable();
});

tearDown(() async {
  await MockDeviceKit.reset();
});

testWidgets('streams camera feed', (tester) async {
  final device = await MockDeviceKit.pairDevice();
  await device.setCameraFeed('assets/test_video.mp4');

  await tester.pumpWidget(const MyApp());
  // ... interact and assert
});

Conditional use (debug only):

if (kDebugMode) {
  await MockDeviceKit.enable();
  final device = await MockDeviceKit.pairDevice();
  await device.setCameraFeed('assets/test_video.mp4');
}

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

pairedDeviceCount → Future<int>
Get the number of currently paired mock devices.
no setter

Static Methods

disable() → Future<void>
Disable Mock Device Kit and restore real Bluetooth behavior.
enable({bool startRegistered = true}) → Future<void>
Enable Mock Device Kit.
pairDevice() → Future<MockDevice>
Pair a mock Ray-Ban Meta glasses device.
reset() → Future<void>
Reset all mock state (unpair all devices, clear feeds).