[Lists] Fix callback names
This commit is contained in:
parent
58a911fac3
commit
e6dd0739d0
|
@ -196,10 +196,9 @@ class Client {
|
||||||
{bool onlyLeft = false,
|
{bool onlyLeft = false,
|
||||||
bool onlyDirect = false,
|
bool onlyDirect = false,
|
||||||
bool onlyGroups = false,
|
bool onlyGroups = false,
|
||||||
onUpdateCallback onUpdate,
|
onRoomListUpdateCallback onUpdate,
|
||||||
onInsertCallback,
|
onRoomListInsertCallback onInsert,
|
||||||
onInsert,
|
onRoomListRemoveCallback onRemove}) async {
|
||||||
onRemoveCallback onRemove}) async {
|
|
||||||
List<Room> rooms = await store.getRoomList(
|
List<Room> rooms = await store.getRoomList(
|
||||||
onlyLeft: onlyLeft, onlyGroups: onlyGroups, onlyDirect: onlyDirect);
|
onlyLeft: onlyLeft, onlyGroups: onlyGroups, onlyDirect: onlyDirect);
|
||||||
return RoomList(
|
return RoomList(
|
||||||
|
|
|
@ -399,7 +399,9 @@ class Room {
|
||||||
return room;
|
return room;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<Timeline> getTimeline({onUpdate, onInsert}) async {
|
Future<Timeline> getTimeline(
|
||||||
|
{onTimelineUpdateCallback onUpdate,
|
||||||
|
onTimelineInsertCallback onInsert}) async {
|
||||||
List<Event> events = await loadEvents();
|
List<Event> events = await loadEvents();
|
||||||
return Timeline(
|
return Timeline(
|
||||||
room: this,
|
room: this,
|
||||||
|
|
|
@ -46,13 +46,13 @@ class RoomList {
|
||||||
|
|
||||||
/// Will be called, when the room list has changed. Can be used e.g. to update
|
/// Will be called, when the room list has changed. Can be used e.g. to update
|
||||||
/// the state of a StatefulWidget.
|
/// the state of a StatefulWidget.
|
||||||
final onUpdateCallback onUpdate;
|
final onRoomListUpdateCallback onUpdate;
|
||||||
|
|
||||||
/// Will be called, when a new room is added to the list.
|
/// 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.
|
/// Will be called, when a room has been removed from the list.
|
||||||
final onRemoveCallback onRemove;
|
final onRoomListRemoveCallback onRemove;
|
||||||
|
|
||||||
StreamSubscription<EventUpdate> eventSub;
|
StreamSubscription<EventUpdate> eventSub;
|
||||||
StreamSubscription<RoomUpdate> roomSub;
|
StreamSubscription<RoomUpdate> roomSub;
|
||||||
|
@ -160,6 +160,6 @@ class RoomList {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef onUpdateCallback = void Function();
|
typedef onRoomListUpdateCallback = void Function();
|
||||||
typedef onInsertCallback = void Function(int insertID);
|
typedef onRoomListInsertCallback = void Function(int insertID);
|
||||||
typedef onRemoveCallback = void Function(int insertID);
|
typedef onRoomListRemoveCallback = void Function(int insertID);
|
||||||
|
|
|
@ -34,8 +34,8 @@ class Timeline {
|
||||||
final Room room;
|
final Room room;
|
||||||
List<Event> events = [];
|
List<Event> events = [];
|
||||||
|
|
||||||
final onUpdateCallback onUpdate;
|
final onTimelineUpdateCallback onUpdate;
|
||||||
final onInsertCallback onInsert;
|
final onTimelineInsertCallback onInsert;
|
||||||
|
|
||||||
StreamSubscription<EventUpdate> sub;
|
StreamSubscription<EventUpdate> sub;
|
||||||
|
|
||||||
|
@ -76,5 +76,5 @@ class Timeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef onUpdateCallback = void Function();
|
typedef onTimelineUpdateCallback = void Function();
|
||||||
typedef onInsertCallback = void Function(int insertID);
|
typedef onTimelineInsertCallback = void Function(int insertID);
|
||||||
|
|
Loading…
Reference in a new issue