refactor: Remove types for timeline callbacks

These types weren't that helpful anyway and their names were not compatible
with the new linter rule of Flutter 2.2.
This commit is contained in:
Christian Pauly 2021-06-01 12:57:52 +02:00
parent 73db010db4
commit ab0ff46900
2 changed files with 3 additions and 7 deletions

View File

@ -1115,8 +1115,7 @@ class Room {
/// Creates a timeline from the store. Returns a [Timeline] object.
Future<Timeline> getTimeline(
{onTimelineUpdateCallback onUpdate,
onTimelineInsertCallback onInsert}) async {
{void Function() onUpdate, void Function(int insertID) onInsert}) async {
await postLoad();
var events;
if (client.database != null) {

View File

@ -24,9 +24,6 @@ import 'room.dart';
import 'utils/event_update.dart';
import 'utils/room_update.dart';
typedef onTimelineUpdateCallback = void Function();
typedef onTimelineInsertCallback = void Function(int insertID);
/// Represents the timeline of a room. The callback [onUpdate] will be triggered
/// automatically. The initial
/// event list will be retreived when created by the `room.getTimeline()` method.
@ -37,8 +34,8 @@ class Timeline {
/// Map of event ID to map of type to set of aggregated events
final Map<String, Map<String, Set<Event>>> aggregatedEvents = {};
final onTimelineUpdateCallback onUpdate;
final onTimelineInsertCallback onInsert;
final void Function() onUpdate;
final void Function(int insertID) onInsert;
StreamSubscription<EventUpdate> sub;
StreamSubscription<RoomUpdate> roomSub;