queryThreads method

Future<List<SmsThread>> queryThreads(
  1. List<int> threadsId, {
  2. List<SmsQueryKind> kinds = const [SmsQueryKind.Inbox],
})

Query multiple thread by id

Implementation

Future<List<SmsThread>> queryThreads(List<int> threadsId,
    {List<SmsQueryKind> kinds = const [SmsQueryKind.Inbox]}) async {
  List<SmsThread> threads = <SmsThread>[];
  for (var id in threadsId) {
    final messages = await querySms(threadId: id, kinds: kinds);
    final thread = SmsThread.fromMessages(messages);
    await thread.findContact();
    threads.add(thread);
  }
  return threads;
}