vitallens_flutter 0.1.0 copy "vitallens_flutter: ^0.1.0" to clipboard
vitallens_flutter: ^0.1.0 copied to clipboard

Flutter plugin for Rouast VitalLens contactless facial physiological vital signs estimation (Heart Rate, HRV, Respiration, rPPG waveforms).

vitallens_flutter #

A Flutter plugin wrapping the Rouast VitalLens SDK for contactless facial vital sign estimation (Heart Rate, HRV, Respiration, and real-time rPPG pulse waveforms) using ordinary camera video.

pub points License: MIT


Features #

  • πŸ«€ Heart Rate (HR): High-accuracy resting pulse estimation in Beats Per Minute (BPM).
  • πŸ“ˆ Heart Rate Variability (HRV): Autonomic stress & resilience metrics (SDNN and RMSSD in ms).
  • 🫁 Respiration Rate (RR): Breathing frequency in Breaths Per Minute (BrPM).
  • πŸ“Š Real-time Waveforms: Raw photoplethysmogram (rPPG) and respiratory time-series signals.
  • 🎯 Turnkey Guided UI: Pre-built 30-second scanning screen with face mesh alignment guidance.
  • ⚑ Continuous Live Monitor: Real-time physiological waveform streaming.
  • πŸ›‘οΈ Android 15+ 16 KB Compatible: Zero crashes on modern 16 KB page-size kernels.

Installation #

Add vitallens_flutter to your pubspec.yaml:

flutter pub add vitallens_flutter

Platform Setup #

Android #

  1. In your android/app/build.gradle (or build.gradle.kts), set minSdkVersion to at least 26:
android {
    defaultConfig {
        minSdk = 26
    }
}
  1. Ensure your android/app/src/main/AndroidManifest.xml includes camera permissions:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

Usage #

1. 30-Second Guided Vital Scan #

Obtain an API key from Rouast Labs. Pass it dynamically when starting a scan:

import 'package:flutter/material.dart';
import 'package:vitallens_flutter/vitallens_flutter.dart';

Future<void> runFaceScan(BuildContext context) async {
  // Pass your VitalLens API key dynamically
  final VitalLensResult result = await VitalLens.startScan(
    apiKey: const String.fromEnvironment('ROUAST_API_KEY'),
    method: 'vitallens',
    mode: VitalLensMode.eco, // 15 FPS (or VitalLensMode.standard for 30 FPS)
  );

  if (result.isCompleted && !result.isCancelled) {
    print('Heart Rate: ${result.heartRate?.toStringAsFixed(1)} BPM');
    print('HRV (SDNN): ${result.hrvSdnn?.toStringAsFixed(1)} ms');
    print('Respiration: ${result.respiratoryRate?.toStringAsFixed(1)} BrPM');
    print('Confidence: ${(result.faceConfidence! * 100).toInt()}%');
  } else if (result.isCancelled) {
    print('Scan cancelled by user');
  } else {
    print('Scan error: ${result.message}');
  }
}

2. Rendering Real-Time rPPG Waveforms #

The package includes a ready-to-use PpgWaveformView widget for rendering raw pulse signals:

import 'package:flutter/material.dart';
import 'package:vitallens_flutter/vitallens_flutter.dart';

Widget buildPulseWave(List<double> ppgSamples) {
  return SizedBox(
    height: 120,
    child: PpgWaveformView(
      dataPoints: ppgSamples,
      strokeColor: Colors.cyanAccent,
      strokeWidth: 2.5,
      showGrid: true,
    ),
  );
}

3. Continuous Live Monitor #

To launch continuous real-time waveform monitoring:

await VitalLens.startMonitor(
  apiKey: myApiKey,
  mode: VitalLensMode.standard,
);

Security Best Practice #

Important

Never hardcode production API keys in your public source repository. Use --dart-define or flutter_dotenv to supply keys at build/run time:

flutter run --dart-define=ROUAST_API_KEY=your_key_here

License #

This project is licensed under the MIT License - see the LICENSE file for details.

0
likes
150
points
83
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for Rouast VitalLens contactless facial physiological vital signs estimation (Heart Rate, HRV, Respiration, rPPG waveforms).

Repository (GitHub)
View/report issues

Topics

#health #camera #computer-vision #vitals #photoplethysmography

License

MIT (license)

Dependencies

flutter

More

Packages that depend on vitallens_flutter

Packages that implement vitallens_flutter