HeartBPMDialog constructor

HeartBPMDialog({
  1. Key? key,
  2. required BuildContext context,
  3. int sampleDelay = 2000 ~/ 30,
  4. required void onBPM(
    1. int
    ),
  5. void onRawData(
    1. SensorValue
    )?,
  6. double alpha = 0.8,
  7. Widget? child,
})

Obtains heart beats per minute using camera sensor

Using the smartphone camera, the widget estimates the skin tone variations over time. These variations are due to the blood flow in the arteries present below the skin of the fingertips.

This is a Dialog widget and hence needs to be displayer using showDialog function. For example:

await showDialog(
  context: context,
  builder: (context) => HeartBPMDialog(
    onData: (value) => print(value),
  ),
);

Implementation

HeartBPMDialog({
  Key? key,
  required this.context,
  this.sampleDelay = 2000 ~/ 30,
  required this.onBPM,
  this.onRawData,
  this.alpha = 0.8,
  this.child,
});