getStoredEvents method

  1. @override
Future<Map<ForeignEventId, NativeEventId>> getStoredEvents()
override

Implementation

@override
Future<Map<ForeignEventId, NativeEventId>> getStoredEvents() async {
  var preferences = await SharedPreferences.getInstance();
  var entries = (preferences.getStringList(listKey)??[]).map((e) {
    var spliced = e.split(":");
    return MapEntry(spliced[0], spliced[1]);
  });
  return Map<ForeignEventId, NativeEventId>.fromEntries(entries);
}