startWithConfiguration static method
Starts UXCam with the given config.
Smart events are enabled by default. Set config.enableSmartEvents = false to disable.
Implementation
static Future<bool> startWithConfiguration(FlutterUxConfig config) async {
WidgetsFlutterBinding.ensureInitialized();
if (Platform.isAndroid) {
// Ensure occlusion channel handler is registered before native polling.
final _ = OcclusionRegistry.instance;
await _channel.invokeMethod('registerEngine');
}
uxCam = UxCam();
final bool? status = await _channel.invokeMethod<bool>(
'startWithConfiguration', {"config": config.toJson()});
if (status == true) {
final enableSmartEvents = config.enableSmartEvents ?? true;
_smartEvents.initialize(enableGestureTracking: enableSmartEvents);
}
return status!;
}