flutter_dexchange_sms 0.0.3 copy "flutter_dexchange_sms: ^0.0.3" to clipboard
flutter_dexchange_sms: ^0.0.3 copied to clipboard

Flutter package for dexchange sms API, you can send SMS, send OTP and verify it.

Dexchnage SMS Flutter Dexchnage SMS

Flutter Dexchange SMS #

A flutter package for sending SMS messages using the Dexchange SMS API

Features #

  • Send SMS Message
  • Send a one-time password (OTP)
  • Verify OTP

Installation #

  1. Add the latest version of package to your pubspec.yaml (and run flutter pub get flutter_dexchange_sms):
dependencies:
    flutter_dexchange_sms: ^0.0.3
  1. Import the package and use it in your Flutter App.
import 'package:flutter_dexchange_sms/flutter_dexchange_sms.dart';

Usage #

import 'package:flutter_dexchange_sms/flutter_dexchange_sms.dart';

FlutterDexchangeSms dexchangeSms = FlutterDexchangeSms(apiKey: 'YOUR API KEY');

// To send an sms

try {
    SendSmsResponse response = dexchangeSms.sendSms(request: SendSmsRequest(
        number: ["221777460452", "777460452"],
        signature: "DSMS",
        content: "YO\nCV ?"
    ));
} on DexchangeApiException catch(e) {
    print(e.toString()); // Handle the exception here
}

// To send otp sms

try {
    SendOTPResponse response = dexchangeSms.sendOTP(request: SendOTPRequest(
        number: "221777460452",
        service: "DEMO",
        lang: "en" // this field is optional
    ));
} on DexchangeApiException catch(e) {
    print(e.toString()); // Handle the exception here
}

// To verifty OTP

try {
    SendVerifyOTPResponse response = dexchangeSms.sendVerifyOTP(request: SendVerifyOTPRequest(
        number: "221777460452",
        service: "DEMO",
        otp: "214045"
    ));
} on DexchangeApiException catch(e) {
    print(e.toString()); // Handle the exception here
}

Additional information #

  • You can find the documentation on this link.
  • Get your api key by creating an account on this link.
1
likes
130
pub points
41%
popularity

Publisher

unverified uploader

Flutter package for dexchange sms API, you can send SMS, send OTP and verify it.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

either_dart, flutter, http

More

Packages that depend on flutter_dexchange_sms