shoutsms 0.1.1 copy "shoutsms: ^0.1.1" to clipboard
shoutsms: ^0.1.1 copied to clipboard

A composable, multi-platform, Future-based plugin for shoutout sms gateway

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:shoutsms/shoutsms.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  // String _platformVersion = 'Unknown';
  final _scaffoldKey = GlobalKey<ScaffoldState>();

  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          key: _scaffoldKey,
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: Center(
            child: TextButton(
              style: TextButton.styleFrom(
                textStyle: const TextStyle(fontSize: 20),
              ),
              onPressed: () async {
                await Shoutsms.call(
                        destination: "94XXXXXXXX",
                        code: "9890",
                        customMessage: "Your verification sms cose is",
                        apiKey: "shoutout api")
                    .then((value) {
                  if (value?.statusCode == 200) {
                    print('Code has been sent successfully');
                  } else {
                    print('Code has send failed');
                  }
                });
              },
              child: const Text('Send SMS'),
            ),
          )),
    );
  }
}
1
likes
100
points
2
downloads

Publisher

unverified uploader

Weekly Downloads

A composable, multi-platform, Future-based plugin for shoutout sms gateway

Documentation

API reference

License

unknown (license)

Dependencies

equatable, flutter, http

More

Packages that depend on shoutsms

Packages that implement shoutsms