SmsBaoGateway class

短信宝 gateway.

API reference: https://www.smsbao.com/openapi

Usage:

import 'package:odroe/easysms/smsbao.dart';

final smsbao = SmsBaoGateway(
  username: 'username',
  password: 'password',
);

final easysms = EasySms(gateways: [smsbao]);

final result = await easysms.send(...);
Implemented types

Constructors

SmsBaoGateway({required String username, String? password, String? apiKey, String? projectId})
Creates a new smsbao gateway.
const

Properties

apiKey String?
Your api key of smsbao.
final
authorization String
Authorization parameter
no setter
hashCode int
The hash code for this object.
no setterinherited
password String?
Your password of smsbao.
final
projectId String?
Your project id of smsbao.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
username String
Your username of smsbao.
final

Methods

generatePath(bool isChineseMainland) String
Generate path.
generatePhoneNumber(PhoneNumber phone, bool isChineseMainland) String
Generate phone number.
generateRequestUrl(Iterable<PhoneNumber> to, Message message, bool isChineseMainland) Future<Uri>
Generates the request url.
groupRequests(Iterable<PhoneNumber> to, Message message) Future<Iterable<MapEntry<Request, Iterable<PhoneNumber>>>>
Groups requests.
isChineseMainland(PhoneNumber phone) bool
Is Chinese Mainland.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(Iterable<PhoneNumber> to, Message message, Client client) Future<Iterable<Response>>
Convert a list of phone numbers and a message to a list of requests
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

endpoint String
Endpoint of 短信宝
final