telephony_sms 0.0.4 copy "telephony_sms: ^0.0.4" to clipboard
telephony_sms: ^0.0.4 copied to clipboard

PlatformAndroid

A Flutter plugin that allows you to send SMS messages in the background.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:telephony_sms/telephony_sms.dart';

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

class MyApp extends StatefulWidget {
  const MyApp({super.key});

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

class _MyAppState extends State<MyApp> {
  final _telephonySMS = TelephonySMS();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('TelephonySMS Plugin example app'),
        ),
        body: SizedBox(
          width: double.infinity,
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              ElevatedButton(
                onPressed: () async {
                  await _telephonySMS.requestPermission();
                },
                child: const Text('Check Permission'),
              ),
              ElevatedButton(
                onPressed: () async {
                  await _telephonySMS.sendSMS(
                      phone: "PHONE", message: "MESSAGE");
                },
                child: const Text('Send SMS'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
7
likes
160
points
141
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin that allows you to send SMS messages in the background.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on telephony_sms