configure static method

Future<bool> configure({
  1. required SahhaEnvironment environment,
  2. List<SahhaSensor> sensors = sensorList,
  3. Map<String, String> notificationSettings = const <String, String>{},
})

Implementation

static Future<bool> configure(
    {required SahhaEnvironment environment,
    List<SahhaSensor> sensors = sensorList,
    Map<String, String> notificationSettings =
        const <String, String>{}}) async {
  // Convert to strings
  List<String> sensorStrings = sensors.map((sensor) => sensor.name).toList();
  try {
    bool success = await _channel.invokeMethod('configure', {
      'environment': environment.name,
      'notificationSettings': notificationSettings,
      'sensors': sensorStrings
    });
    return success;
  } on PlatformException catch (error) {
    return Future.error(error);
  }
}