shoutsms 0.1.0
shoutsms: ^0.1.0 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: "94786036092",
code: "9890",
customMessage: "Your verification sms cose is",
apiKey:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI1ZTc0OWZhMC04MGI1LTExZWMtODBiYS05N2M2Mzc5ZjFiMDkiLCJzdWIiOiJTSE9VVE9VVF9BUElfVVNFUiIsImlhdCI6MTY0MzQyNzcwMCwiZXhwIjoxOTU4OTYwNTAwLCJzY29wZXMiOnsiYWN0aXZpdGllcyI6WyJyZWFkIiwid3JpdGUiXSwibWVzc2FnZXMiOlsicmVhZCIsIndyaXRlIl0sImNvbnRhY3RzIjpbInJlYWQiLCJ3cml0ZSJdfSwic29fdXNlcl9pZCI6IjY0NDkzIiwic29fdXNlcl9yb2xlIjoidXNlciIsInNvX3Byb2ZpbGUiOiJhbGwiLCJzb191c2VyX25hbWUiOiIiLCJzb19hcGlrZXkiOiJub25lIn0.XtCMlzZq21s9Zgoqv4Nw2NlyKiA32_DE6mE6M7qtYVQ")
.then((value) {
if (value?.statusCode == 200) {
print('Code has been sent successfully');
} else {
print('Code has send failed');
}
});
},
child: const Text('Send SMS'),
),
)),
);
}
}