Fix token login popup show

This commit is contained in:
Yegor Vialov
2020-05-03 15:26:44 +00:00
parent 8aa0e03187
commit cc60dc2b21
5 changed files with 18 additions and 45 deletions

View File

@ -186,6 +186,9 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
_showPopupSubscription = eventBus.on<ShowPopupEvent>().listen((event){
if (!_popupShown) {
_popupShown = true;
if (event.goBackFirst) {
Navigator.of(context).pop();
}
event.popup.show(context).then((_){
_popupShown = false;
});
@ -539,7 +542,9 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
FlatButton(
child: Text("Login with long-lived token", style: Theme.of(context).textTheme.button),
color: Theme.of(context).primaryColor,
onPressed: () => eventBus.fire(ShowTokenLoginPopupEvent(goBackFirst: false))
onPressed: () => eventBus.fire(ShowPopupEvent(
popup: TokenLoginPopup()
))
),
Container(height: 20,),
FlatButton(