sms_advanced 1.0.0 copy "sms_advanced: ^1.0.0" to clipboard
sms_advanced: ^1.0.0 copied to clipboard

outdated

This is an SMS library for Flutter. Its allow to send, receive, query sms messages, sms delivery and query contacts info in Android, and only sending in IOS.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:sms_advanced/sms_advanced.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> {
  final SmsQuery query = SmsQuery();
  List<SmsThread> threads = [];

  @override
  void initState() {
    super.initState();
    query.getAllThreads.then((value) {
      threads = value;
      setState(() {});
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: Scaffold(
          appBar: AppBar(
            title: const Text("Example"),
          ),
          body: ListView.builder(
            itemCount: threads.length,
            itemBuilder: (BuildContext context, int index) {
              return Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                  ListTile(
                    minVerticalPadding: 8,
                    minLeadingWidth: 4,
                    title: Text(threads[index].messages.last.body ?? 'empty'),
                    subtitle: Text(threads[index].contact?.address ?? 'empty'),
                  ),
                  const Divider()
                ],
              );
            },
          ),
        ));
  }
}
95
likes
0
points
670
downloads

Publisher

verified publisherphan-tec.com

Weekly Downloads

This is an SMS library for Flutter. Its allow to send, receive, query sms messages, sms delivery and query contacts info in Android, and only sending in IOS.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sms_advanced