refactor: Use Provider

This commit is contained in:
Christian Pauly 2021-01-15 19:59:30 +01:00
commit cd0b0bbdfe
2 changed files with 10 additions and 37 deletions

View file

@ -300,16 +300,11 @@ class _ChatListState extends State<ChatList> {
ConnectionStatusHeader(),
Expanded(
child: StreamBuilder(
stream:
Matrix.of(context).client.onSync.stream.where(
(s) =>
s.hasRoomUpdate ||
s.accountData
.where((a) =>
a.type ==
MatrixState.userStatusesType)
.isNotEmpty,
),
stream: Matrix.of(context)
.client
.onSync
.stream
.where((s) => s.hasRoomUpdate),
builder: (context, snapshot) {
return FutureBuilder<void>(
future: waitForFirstSync(context),