Commit c57dbab6 by tanghuan

Merge branch 'feature-2604-tips' into feature-2604

2 parents 2b2f2ec4 e049c7b5
......@@ -152,7 +152,7 @@ class LoginMainCubit extends Cubit<LoginMainState> {
debugPrint('身份令牌 (identityToken): ${credential.identityToken}');
if (credential.userIdentifier == null) {
Fluttertoast.showToast(msg: '授权失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '授权失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -162,11 +162,11 @@ class LoginMainCubit extends Cubit<LoginMainState> {
var resultData = await _userAuthRepository.appleLogin(
credential.userIdentifier!, credential.authorizationCode, credential.identityToken!) as Map<String, dynamic>?;
if (resultData == null) {
Fluttertoast.showToast(msg: '登录请求处理失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求处理失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
if (resultData['code'] != 0) {
Fluttertoast.showToast(msg: resultData['error'], backgroundColor: Colors.red);
Fluttertoast.showToast(msg: resultData['error'], gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -195,7 +195,7 @@ class LoginMainCubit extends Cubit<LoginMainState> {
);
if (!authResult) {
Fluttertoast.showToast(msg: '微信授权处理失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '微信授权处理失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -216,7 +216,7 @@ class LoginMainCubit extends Cubit<LoginMainState> {
);
if (!authResult) {
Fluttertoast.showToast(msg: '微信授权处理失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '微信授权处理失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -243,13 +243,13 @@ class LoginMainCubit extends Cubit<LoginMainState> {
// 请求接口异常
if (resultData == null) {
Fluttertoast.showToast(msg: '登录请求处理失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求处理失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
// 状态码错误
if (resultData['resultCode'] != '001') {
Fluttertoast.showToast(msg: '登录请求状态失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求状态失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......
......@@ -91,7 +91,7 @@ class LoginPhoneCubit extends Cubit<LoginPhoneState> {
// 验证手机号码
String phone = _phoneController.text;
if (!RegExp(r'^1[3-9][0-9]{9}$').hasMatch(phone)) {
Fluttertoast.showToast(msg: '请输入正确的手机号码', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '请输入正确的手机号码', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -99,7 +99,7 @@ class LoginPhoneCubit extends Cubit<LoginPhoneState> {
// 发送验证码
var result = await _phoneAuthRepository.verifyCode(phone, 0);
if (result['code'] != 0) {
Fluttertoast.showToast(msg: result['error'], backgroundColor: Colors.red);
Fluttertoast.showToast(msg: result['error'], gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -115,12 +115,12 @@ class LoginPhoneCubit extends Cubit<LoginPhoneState> {
String verifyCode = _codeController.text;
if (!RegExp(r'^1[3-9][0-9]{9}$').hasMatch(phone)) {
Fluttertoast.showToast(msg: '请输入正确的手机号码', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '请输入正确的手机号码', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
if (!RegExp(r'^\d{4}$').hasMatch(verifyCode)) {
Fluttertoast.showToast(msg: '请输入正确的验证码', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '请输入正确的验证码', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -131,11 +131,11 @@ class LoginPhoneCubit extends Cubit<LoginPhoneState> {
var resultData = await _phoneAuthRepository.login(phone, verifyCode);
if (resultData == null) {
Fluttertoast.showToast(msg: '登录请求失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
if (resultData['code'] != 0) {
Fluttertoast.showToast(msg: resultData['error'], backgroundColor: Colors.red);
Fluttertoast.showToast(msg: resultData['error'], gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......
......@@ -62,13 +62,13 @@ class LoginQrCubit extends Cubit<LoginQrState> {
var resultData = await _wechatAuthRepository.getTicket() as Map<String, dynamic>?;
// 请求接口异常
if (resultData == null) {
Fluttertoast.showToast(msg: '生成二维码失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '生成二维码失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
// 状态码错误
if (resultData['resultCode'] != '001') {
Fluttertoast.showToast(msg: '生成二维码状态错误', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '生成二维码状态错误', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......@@ -89,7 +89,7 @@ class LoginQrCubit extends Cubit<LoginQrState> {
);
if (!authResult) {
Fluttertoast.showToast(msg: '请求微信失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '请求微信失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
}
......@@ -139,13 +139,13 @@ class LoginQrCubit extends Cubit<LoginQrState> {
// 请求接口异常
if (resultData == null) {
Fluttertoast.showToast(msg: '登录请求处理失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求处理失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
// 状态码错误
if (resultData['resultCode'] != '001') {
Fluttertoast.showToast(msg: '登录请求状态失败', backgroundColor: Colors.red);
Fluttertoast.showToast(msg: '登录请求状态失败', gravity: ToastGravity.TOP, backgroundColor: Colors.red);
return;
}
......
......@@ -264,7 +264,7 @@ class AccountPage extends StatelessWidget {
msg: '已申请注销,等待流程处理',
backgroundColor: Colors.green,
toastLength: Toast.LENGTH_LONG,
gravity: ToastGravity.BOTTOM,
gravity: ToastGravity.TOP,
);
accountCubit.unbind();
},
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!