custom_advanced_sms 1.2.0 copy "custom_advanced_sms: ^1.2.0" to clipboard
custom_advanced_sms: ^1.2.0 copied to clipboard

An advanced SMS library for Flutter with enhanced functionality. Allows sending, receiving, and querying SMS messages, SMS delivery status, and contact information on Android, with sending capabilitie [...]

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:custom_advanced_sms/custom_advanced_sms.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()
                ],
              );
            },
          ),
        ));
  }
}
0
likes
135
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

An advanced SMS library for Flutter with enhanced functionality. Allows sending, receiving, and querying SMS messages, SMS delivery status, and contact information on Android, with sending capabilities on iOS & Web.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins, plugin_platform_interface, url_launcher

More

Packages that depend on custom_advanced_sms

Packages that implement custom_advanced_sms