From e6dd0739d0e43dc78cdce3e901ecf351984e25a2 Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Tue, 25 Jun 2019 12:06:26 +0200 Subject: [PATCH] [Lists] Fix callback names --- lib/src/Client.dart | 7 +++---- lib/src/Room.dart | 4 +++- lib/src/RoomList.dart | 12 ++++++------ lib/src/Timeline.dart | 8 ++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/src/Client.dart b/lib/src/Client.dart index 266e00f..d2e13b4 100644 --- a/lib/src/Client.dart +++ b/lib/src/Client.dart @@ -196,10 +196,9 @@ class Client { {bool onlyLeft = false, bool onlyDirect = false, bool onlyGroups = false, - onUpdateCallback onUpdate, - onInsertCallback, - onInsert, - onRemoveCallback onRemove}) async { + onRoomListUpdateCallback onUpdate, + onRoomListInsertCallback onInsert, + onRoomListRemoveCallback onRemove}) async { List rooms = await store.getRoomList( onlyLeft: onlyLeft, onlyGroups: onlyGroups, onlyDirect: onlyDirect); return RoomList( diff --git a/lib/src/Room.dart b/lib/src/Room.dart index c34b542..d63ef2f 100644 --- a/lib/src/Room.dart +++ b/lib/src/Room.dart @@ -399,7 +399,9 @@ class Room { return room; } - Future getTimeline({onUpdate, onInsert}) async { + Future getTimeline( + {onTimelineUpdateCallback onUpdate, + onTimelineInsertCallback onInsert}) async { List events = await loadEvents(); return Timeline( room: this, diff --git a/lib/src/RoomList.dart b/lib/src/RoomList.dart index 0faeb9f..aafeb63 100644 --- a/lib/src/RoomList.dart +++ b/lib/src/RoomList.dart @@ -46,13 +46,13 @@ class RoomList { /// Will be called, when the room list has changed. Can be used e.g. to update /// the state of a StatefulWidget. - final onUpdateCallback onUpdate; + final onRoomListUpdateCallback onUpdate; /// Will be called, when a new room is added to the list. - final onInsertCallback onInsert; + final onRoomListInsertCallback onInsert; /// Will be called, when a room has been removed from the list. - final onRemoveCallback onRemove; + final onRoomListRemoveCallback onRemove; StreamSubscription eventSub; StreamSubscription roomSub; @@ -160,6 +160,6 @@ class RoomList { } } -typedef onUpdateCallback = void Function(); -typedef onInsertCallback = void Function(int insertID); -typedef onRemoveCallback = void Function(int insertID); +typedef onRoomListUpdateCallback = void Function(); +typedef onRoomListInsertCallback = void Function(int insertID); +typedef onRoomListRemoveCallback = void Function(int insertID); diff --git a/lib/src/Timeline.dart b/lib/src/Timeline.dart index 04a23b5..1749999 100644 --- a/lib/src/Timeline.dart +++ b/lib/src/Timeline.dart @@ -34,8 +34,8 @@ class Timeline { final Room room; List events = []; - final onUpdateCallback onUpdate; - final onInsertCallback onInsert; + final onTimelineUpdateCallback onUpdate; + final onTimelineInsertCallback onInsert; StreamSubscription sub; @@ -76,5 +76,5 @@ class Timeline { } } -typedef onUpdateCallback = void Function(); -typedef onInsertCallback = void Function(int insertID); +typedef onTimelineUpdateCallback = void Function(); +typedef onTimelineInsertCallback = void Function(int insertID);