From 1d154e6dfec7dbcdf61defba374ba77a7e08a50f Mon Sep 17 00:00:00 2001 From: jld3103 Date: Mon, 10 Apr 2023 15:31:58 +0200 Subject: [PATCH] neon: Fix browser not opening on login page --- packages/neon/lib/src/pages/login.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/neon/lib/src/pages/login.dart b/packages/neon/lib/src/pages/login.dart index 0f31a741..52a30441 100644 --- a/packages/neon/lib/src/pages/login.dart +++ b/packages/neon/lib/src/pages/login.dart @@ -32,15 +32,15 @@ class _LoginPageState extends State { _loginBloc.setServerURL(widget.serverURL); } - _loginBloc.loginFlowInit.listen((final init) { - if (init != null && !Provider.of(context, listen: false).canUseWebView) { - WidgetsBinding.instance.addPostFrameCallback((final _) async { + WidgetsBinding.instance.addPostFrameCallback((final _) { + _loginBloc.loginFlowInit.listen((final init) async { + if (init != null && !Provider.of(context, listen: false).canUseWebView) { await launchUrlString( init.login, mode: LaunchMode.externalApplication, ); - }); - } + } + }); }); _loginBloc.loginFlowResult.listen((final result) async {