fix backbutton

This commit is contained in:
Oystein Kristoffer Tveit 2020-07-14 14:44:06 +02:00
parent bd87af4a38
commit c1a494fd9a
1 changed files with 6 additions and 2 deletions

View File

@ -15,8 +15,12 @@ class KanjiView extends StatelessWidget {
else if (state is KanjiSearchLoading) else if (state is KanjiSearchLoading)
return LoadingScreen(); return LoadingScreen();
else if (state is KanjiSearchFinished) else if (state is KanjiSearchFinished)
return KanjiResultCard(state.kanji); return WillPopScope(
child: KanjiResultCard(state.kanji),
onWillPop: () async {
BlocProvider.of<KanjiBloc>(context).add(ReturnToInitialState());
return false;
});
throw 'No such event found'; throw 'No such event found';
}, },
); );