遵循辉煌的Firebase Flutter教程,我正在尝试将Google登录纳入我的应用程序.
流:如果没有登录,用户始终在登录页面(在通过检查到达MaterialApp的onGenerateRoute),然后,用户按下登录按钮,并重定向到谷歌登录流程.但是,如果用户中途取消流量,我想返回登录页面,强制她再次按下按钮.
由于某种原因,我无法捕获PlatformException(您可以在调试器中看到它,并且应用程序挂在模拟器中):

我正在使用的代码:
Future<bool> logIn() async {
print('Login::logIn()');
bool loggedIn = await logInSilently();
print('Login::logIn() - silent login returned $loggedIn');
if (loggedIn == false) {
try {
await googleSignIn.signIn();
} catch (e) {
print('Login::logIn() - interactive login failed: $e');
return false;
}
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
printcatch块中的语句永远不会打印,应用程序挂起.在发布问题之前,我已经升级了扑动并重新测试 - 问题仍然存在.
(澄清一下:"快乐路径" - 即用户成功通过Google登录流程 - 有效.)
我正在尝试创建一个只包含标题行的新CSV对象,但在调用之前不会设置标题read():
[32] pry(main)> c = CSV.new("Keyword,Index,Page,Index in Page,Type,Title,URL", :headers => :first_row, :write_headers => true, :return_headers => true)
=> <#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:"," row_sep:"\n" quote_char:"\"" headers:true>
[33] pry(main)> c.headers
=> true
[34] pry(main)> c.read
=> #<CSV::Table mode:col_or_row row_count:1>
[35] pry(main)> c.headers
=> ["Keyword", "Index", "Page", "Index in Page", "Type", "Title", "URL"]
Run Code Online (Sandbox Code Playgroud)
这是为什么?为什么我的单行无法获得正常工作的CSV对象CSV.new?