[Lists] Fix callback names

This commit is contained in:
Christian Pauly 2019-06-25 12:06:26 +02:00
parent 58a911fac3
commit e6dd0739d0
4 changed files with 16 additions and 15 deletions

View File

@ -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<Room> rooms = await store.getRoomList(
onlyLeft: onlyLeft, onlyGroups: onlyGroups, onlyDirect: onlyDirect);
return RoomList(

View File

@ -399,7 +399,9 @@ class Room {
return room;
}
Future<Timeline> getTimeline({onUpdate, onInsert}) async {
Future<Timeline> getTimeline(
{onTimelineUpdateCallback onUpdate,
onTimelineInsertCallback onInsert}) async {
List<Event> events = await loadEvents();
return Timeline(
room: this,

View File

@ -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<EventUpdate> eventSub;
StreamSubscription<RoomUpdate> 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);

View File

@ -34,8 +34,8 @@ class Timeline {
final Room room;
List<Event> events = [];
final onUpdateCallback onUpdate;
final onInsertCallback onInsert;
final onTimelineUpdateCallback onUpdate;
final onTimelineInsertCallback onInsert;
StreamSubscription<EventUpdate> 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);