Commit e71567f8 authored by Wilko Manger's avatar Wilko Manger

Add ability to reject an invite

parent de99c76a
......@@ -50,7 +50,7 @@ class InviteInputBloc extends Bloc<InviteInputEvent, InviteInputState> {
if (event is RejectInvite) {
yield Rejecting();
/*_room.leave();*/
await _room.leave();
yield Rejected();
}
}
......
......@@ -46,11 +46,18 @@ class InviteInput extends StatelessWidget {
context.bloc<InviteInputBloc>().add(RejectInvite());
}
void _onStateChange(BuildContext context, InviteInputState state) {
if (state is Rejected) {
Navigator.pop(context);
}
}
static const _linearProgressIndicatorHeight = 6.0;
@override
Widget build(BuildContext context) {
return BlocBuilder<InviteInputBloc, InviteInputState>(
return BlocConsumer<InviteInputBloc, InviteInputState>(
listener: _onStateChange,
builder: (context, state) {
// TODO: Use Material outside of widget when Input doesn't need specific
// changes to it anymore
......
......@@ -323,8 +323,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "41d2b6fe414c105db27be2dc67798ca17121eb9a"
resolved-ref: "41d2b6fe414c105db27be2dc67798ca17121eb9a"
ref: "74970f44935aab824d5c984a753ae57e07894db3"
resolved-ref: "74970f44935aab824d5c984a753ae57e07894db3"
url: "https://git.pattle.im/pattle/library/matrix-dart-sdk.git"
source: git
version: "0.0.0"
......
......@@ -13,7 +13,7 @@ dependencies:
matrix_sdk:
git:
url: https://git.pattle.im/pattle/library/matrix-dart-sdk.git
ref: 41d2b6fe414c105db27be2dc67798ca17121eb9a
ref: 74970f44935aab824d5c984a753ae57e07894db3
async: ^2.3.0
......
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