healthrian_ble_support_for_wearcardiot 1.0.30 copy "healthrian_ble_support_for_wearcardiot: ^1.0.30" to clipboard
healthrian_ble_support_for_wearcardiot: ^1.0.30 copied to clipboard

unlisted

Healthrian BLE support library for WearCardioT

example/README.md

Example for Healthrian BLE support library for WearCardioT #

![coverage][coverage_badge] [![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link] [![License: MIT][license_badge]][license_link]

Generated by the [Very Good CLI][very_good_cli_link] 🤖

Example for Healthrian BLE support library for WearCardioT

Example code #

lib/ble/view/ble_page.dart

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

class BLEPage extends StatelessWidget {
  const BLEPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Column(
        children: const [
          EcgWearT(),
          OxiWearT(),
        ],
      ),
      floatingActionButton: const ControlPanel(),
    );
  }
}

Change the minSdkVersion for Android #

flutter_blue_plus is compatible only from version 19 of Android SDK so you should change this in android/app/build.gradle:

Android {
  defaultConfig {
     minSdkVersion: 19

Add permissions for Bluetooth #

We need to add the permission to use Bluetooth and access location:

Android

In the android/app/src/main/AndroidManifest.xml let’s add:

	 <uses-permission android:name="android.permission.BLUETOOTH" />  
	 <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />  
	 <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>  
 <application

IOS

In the ios/Runner/Info.plist let’s add:

	<dict>  
	    <key>NSBluetoothAlwaysUsageDescription</key>  
	    <string>Need BLE permission</string>  
	    <key>NSBluetoothPeripheralUsageDescription</key>  
	    <string>Need BLE permission</string>  
	    <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>  
	    <string>Need Location permission</string>  
	    <key>NSLocationAlwaysUsageDescription</key>  
	    <string>Need Location permission</string>  
	    <key>NSLocationWhenInUseUsageDescription</key>  
	    <string>Need Location permission</string>

edit pubspec.yaml file #

Add dependencies of both BLE support and visualization support libraries. pubspec.yaml

dependencies:
  healthrian_ble_support_for_wearcardiot: ^1.0.4

  healthrian_visualization_support: ^1.0.8+1

And then run a pub get in the terminal.

flutter pub get

from scratch via very good cli #

very_good.bat create example --desc "Example for Healthrian BLE support library for WearCardioT" --org "com.healthrian.library.ble.example"