listThreads method
All stored threads, newest first.
Implementation
@override
Future<List<ChatThread>> listThreads() async {
final threads = _threads.values.toList();
threads.sort((a, b) {
final at = a.updatedAt, bt = b.updatedAt;
if (at == null || bt == null) return 0;
return bt.compareTo(at); // newest first
});
return threads;
}