sms method

Future<bool> sms({
  1. required String body,
  2. int? index,
  3. required String label,
})

Sends a SMS to a contact’s phone. It requires a body. It is based on the label and, optionally, on the position of the number (index) in the list of phones with the same label. In case index is null, the 1º in the list is called.

Implementation

Future<bool> sms({
  required String body,
  int? index,
  required String label,
}) {
  final List<Phone> callablePhones =
      phones.where((phone) => phone.label == label).toList();

  return callablePhones[index ?? 0].sms(body: body);
}