当我从 Flutter 移动设备转移到 Web 设备时,我注意到控制台上打印的日志没有帮助,因为它们不针对我的 IDE (Android Studio) 中的代码 在移动设备上:
======= Exception caught by widgets library =======================================================
The following message was thrown building PhoneSignUpPage(state: _PhoneSignUpPageState#b52e9):
some error
The relevant error-causing widget was:
PhoneSignUpPage file:///Users/me/AndroidStudioProjects/myproject/lib/services/routing_service.dart:30:14
When the exception was thrown, this was the stack:
#0 PhonePageViewState.initState (package:my_app/common/phone/phone_page_view.dart:63:5) // this was clickable
#1 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4711:57)
#2 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4548:5)
#3 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3611:14)
#4 Element.updateChild (package:flutter/src/widgets/framework.dart:3360:20)
...
Run Code Online (Sandbox Code Playgroud)
在网络上:
======== Exception caught by widgets library =======================================================
The following message was thrown building PhoneSignUpPage(state: _PhoneSignUpPageState#fb057):
some …
Run Code Online (Sandbox Code Playgroud) 在使用错误的电子邮件或密码登录时,我希望获得我输入的小吃栏,但我的控制台中出现错误。
错误 -
操作 RecaptchaAction(action=signInWithPassword) 的初始任务失败,但出现异常 - 发生内部错误。[ 无效的登录凭证]。
验证服务代码 -
Future<UserCredential> signInUser(String email, String password) async {
UserCredential userCredential = await _auth.signInWithEmailAndPassword(
email: email,
password: password,
);
return userCredential;
}
Run Code Online (Sandbox Code Playgroud)
登录代码 -
Future<void> signIn() async {
try {
if (emailController.text.trim().isEmpty) {
return showWarningSnackBar(context, 'Empty Email');
}
if (passwordController.text.trim().isEmpty) {
return showWarningSnackBar(context, 'Empty Password');
}
await AuthService().signInUser(
emailController.text.trim(),
passwordController.text.trim(),
);
if (!context.mounted) return;
showSnackBar(context, 'Successfully logged in');
} on FirebaseAuthException catch (e) {
if (e.code == 'user-not-found') {
showErrorSnackBar(context, 'No …
Run Code Online (Sandbox Code Playgroud) 如何在没有 AppBar 的情况下更改状态栏颜色?
我的代码片段:
@override
Widget build(BuildContext context) {
return Scaffold(
body: AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
child: BodyWidget(),
),//
);
}
Run Code Online (Sandbox Code Playgroud)