From ed6f9c06b749605757daa43e9406976903ef2740 Mon Sep 17 00:00:00 2001 From: TheOneWithTheBraid Date: Wed, 26 Jan 2022 11:45:03 +0100 Subject: [PATCH] feat: expose Timeline.onChange to Room.getTimeline Signed-off-by: TheOneWithTheBraid --- lib/src/room.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/src/room.dart b/lib/src/room.dart index 0399c179..67378580 100644 --- a/lib/src/room.dart +++ b/lib/src/room.dart @@ -1117,9 +1117,12 @@ class Room { } /// Creates a timeline from the store. Returns a [Timeline] object. - Future getTimeline( - {void Function()? onUpdate, - void Function(int insertID)? onInsert}) async { + Future getTimeline({ + void Function(int index)? onChange, + void Function(int index)? onRemove, + void Function(int insertID)? onInsert, + void Function()? onUpdate, + }) async { await postLoad(); var events; events = await client.database?.getEventList( @@ -1144,8 +1147,10 @@ class Room { final timeline = Timeline( room: this, events: events, - onUpdate: onUpdate, + onChange: onChange, + onRemove: onRemove, onInsert: onInsert, + onUpdate: onUpdate, ); if (client.database == null) { await requestHistory(historyCount: 10);