flutter_sms_inbox 1.0.4 copy "flutter_sms_inbox: ^1.0.4" to clipboard
flutter_sms_inbox: ^1.0.4 copied to clipboard

PlatformAndroid

Flutter SMS Inbox Plugin (Android only). This library allows users to easily query inbox messages.

Flutter SMS Inbox #

pub package pub points

Flutter android SMS inbox library based on Flutter SMS.

Dependencies #

This package in turn uses the permission handler package for permission handling, Permission Handler.

You need to add it to your project:

dependencies:
  permission_handler: ^10.2.0
copied to clipboard

Querying SMS messages #

Add the import statement for sms and create an instance of the SmsQuery class:

import 'package:flutter_sms_inbox/flutter_sms_inbox.dart';

void main() {
  SmsQuery query = SmsQuery();
}
copied to clipboard

Getting all SMS messages #

List<SmsMessage> messages = await query.getAllSms;

Filtering SMS messages #

The method querySms from the SmsQuery class returns a list of sms depending of the supplied parameters. For example, for querying all the sms messages sent and received write the followed code:

await query.querySms(
    kinds: [SmsQueryKind.inbox, SmsQueryKind.sent],
);
copied to clipboard

You can also query all the sms messages sent and received from a specific contact:

await query.querySms(
    address: getContactAddress()
);
copied to clipboard
84
likes
150
points
3.71k
downloads

Publisher

unverified uploader

Weekly Downloads

2024.06.11 - 2025.05.06

Flutter SMS Inbox Plugin (Android only). This library allows users to easily query inbox messages.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_sms_inbox