AfroMessage class
Dart client for the AfroMessage Ethiopian SMS API.
Mirrors the Node.js afromessage
package: send SMS, bulk SMS, OTPs, and verify codes.
final sms = AfroMessage(
AfroMessageConfig(
apiKey: 'YOUR_TOKEN',
senderName: 'YOUR_SENDER',
identifierId: 'YOUR_IDENTIFIER',
),
);
final result = await sms.sendSms(
SendSmsRequest(to: '0912345678', message: 'Hello from Dart'),
);
Constructors
- AfroMessage(AfroMessageConfig config, {Client? client})
Properties
- config → AfroMessageConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Closes the underlying HTTP client. Call when disposing long-lived instances.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendBulkSms(
BulkSmsRequest request) → Future< BulkSmsResponse> -
Sends bulk SMS via
POST /bulk_send. -
sendSecurityCode(
SendSecurityCodeRequest request) → Future< SendSecurityCodeResponse> -
Sends an OTP / security code via
GET /challenge. -
sendSms(
SendSmsRequest request) → Future< SendSmsResponse> -
Sends a single SMS via
POST /send. -
toString(
) → String -
A string representation of this object.
inherited
-
verifyCode(
VerifyCodeRequest request) → Future< VerifyCodeResponse> -
Verifies an OTP / security code via
GET /verify.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited