1
0
mirror of https://github.com/h7x4/Jisho-Study-Tool.git synced 2024-12-21 13:37:29 +01:00

fix backbutton

This commit is contained in:
Oystein Kristoffer Tveit 2020-07-14 14:44:06 +02:00
parent bd87af4a38
commit c1a494fd9a

View File

@ -15,8 +15,12 @@ class KanjiView extends StatelessWidget {
else if (state is KanjiSearchLoading)
return LoadingScreen();
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';
},
);