sendSms static method

Future<AuthResult> sendSms(
  1. String phone,
  2. String channel, [
  3. String? phoneCountryCode
])

send an SMS code.

Implementation

static Future<AuthResult> sendSms(String phone, String channel,
    [String? phoneCountryCode]) async {
  Map map = {};
  map.putIfAbsent('phoneNumber', () => phone);
  map.putIfAbsent('channel', () => channel);
  if (phoneCountryCode != null) {
    map.putIfAbsent('phoneCountryCode', () => phoneCountryCode);
  }
  final Result result = await post('/api/v3/send-sms', jsonEncode(map));
  return AuthResult(result);
}