smsURI property

String smsURI

Implementation

String get smsURI {
  final result = StringBuffer();
  result.write('sms:');
  bool first = true;
  for (int i = 0; i < _numbers.length; i++) {
    if (first) {
      first = false;
    } else {
      result.write(',');
    }
    result.write(_numbers[i]);
    if (_vias != null && _vias!.length > i) {
      result.write(';via=');
      result.write(_vias![i]);
    }
  }
  final hasBody = body != null;
  final hasSubject = subject != null;
  if (hasBody || hasSubject) {
    result.write('?');
    if (hasBody) {
      result.write('body=');
      result.write(body);
    }
    if (hasSubject) {
      if (hasBody) {
        result.write('&');
      }
      result.write('subject=');
      result.write(subject);
    }
  }
  return result.toString();
}