dispose method
Implementation
@override
Future<bool> dispose() async {
try {
_trackingTimer?.cancel();
await _gazeController.close();
await _eyeStateController.close();
await _headPoseController.close();
await _faceDetectionController.close();
// Stop WebGazer
if (_webGazerStarted && js.context.hasProperty('webgazer')) {
try {
js.context['webgazer'].callMethod('end');
} catch (e) {
js.context.callMethod('eval', ['webgazer.end()']);
}
}
return true;
} catch (e) {
return false;
}
}