Commit c2f5286a authored by Wilko Manger's avatar Wilko Manger

Let ChatBloc extend Bloc

parent d7547e73
......@@ -21,13 +21,14 @@ import 'dart:io';
import 'package:image/image.dart';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:mime/mime.dart';
import 'package:pattle/src/ui/bloc.dart';
import 'package:pattle/src/ui/main/models/chat_item.dart';
import 'package:pattle/src/ui/main/sync_bloc.dart';
import 'package:pattle/src/ui/util/room.dart';
import 'package:rxdart/rxdart.dart';
import 'package:pattle/src/di.dart' as di;
class ChatBloc {
class ChatBloc extends Bloc {
final Room room;
StreamSubscription syncSub;
......@@ -228,7 +229,8 @@ class ChatBloc {
}
}
void cleanUp() {
@override
void dispose() {
syncSub.cancel();
}
}
......@@ -63,8 +63,8 @@ class ChatPageState extends State<ChatPage> {
@override
void dispose() {
super.dispose();
bloc.dispose();
readTimer.cancel();
bloc.cleanUp();
textController.dispose();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment