📱Device profile

Once a user is registered, the device profile information is automatically created. However, it's important to keep this profile up to date. This can be achieved with the below function.

Update Profile

The heading of the reports displays information about the version of the app and the last used device. This information can be updated with the sdk.updateProfile function.

import 'package:flutter_fibricheck_sdk/flutter_fibricheck_sdk.dart';
import 'package:device_info_plus/device_info_plus.dart';

var deviceInfo = DeviceInfoPlugin();
    AndroidDeviceInfo androidInfo;
    IosDeviceInfo iosInfo;

    String? os;
    String? model;
    String? manufacturer;

    if (Platform.isAndroid) {
      androidInfo = await deviceInfo.androidInfo;
      os = androidInfo.version.release;
      model = androidInfo.model;
      manufacturer = androidInfo.manufacturer;
    } else if (Platform.isIOS) {
      iosInfo = await deviceInfo.iosInfo;
      os = iosInfo.systemVersion;
      model = iosInfo.localizedModel;
      manufacturer = 'Apple';
    }

await _sdk.updateProfile(
        "",
        ProfileData(
            addressLine1: "",
            addressLine2: "",
            weight: int,
            length: int,
            smoker: bool,
            activity: ProfileActivity...,
            fibricheckInfo: FibricheckInfo(
              app: App(version: "1.0.0"),
              device: Device(
                manufacturer: manufacturer,
                type: Platform.isAndroid ? DeviceType.android : DeviceType.ios,
                model: model,
                os: iosInfo.systemVersion,
              ),
            )));

Last updated