flutter_native_sms 0.0.1 copy "flutter_native_sms: ^0.0.1" to clipboard
flutter_native_sms: ^0.0.1 copied to clipboard

A Flutter plugin for sending native sms. for android only

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:flutter_native_sms/flutter_native_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 _sendSmsNativelyPlugin = FlutterNativeSms();

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

  TextEditingController _phoneController = TextEditingController();
  TextEditingController _smsBodyController = TextEditingController();

  _sendSms() async{
    var result = await _sendSmsNativelyPlugin.send(phone:_phoneController.value.text, smsBody:_smsBodyController.value.text);
    debugPrint(result.toString());
  }
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin sms app'),
        ),
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Column(
            children: [
              TextField(
                controller: _phoneController,
                decoration: const InputDecoration(
                    label: Text('Phone number')
                ),
              ),
              TextField(
                controller: _smsBodyController,
                decoration: const InputDecoration(
                    label: Text('Sms body')
                ),
                maxLines: 4,
              ),
              Center(
                child: ElevatedButton(onPressed: _sendSms, child: const Text('Send')),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
0
points
78
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for sending native sms. for android only

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_native_sms