getRaw method
Implementation
@override
Stream<int> getRaw() {
var timestampAtLastCall = DateTime.now().millisecondsSinceEpoch;
return ProximitySensor.events.where((event) {
if (DateTime.now().millisecondsSinceEpoch - timestampAtLastCall > inMillis) {
timestampAtLastCall = DateTime.now().millisecondsSinceEpoch;
return true;
}
return false;
});
}