修复作业停止之后的bug 和远程遥控模式 默认前视角
This commit is contained in:
@@ -96,20 +96,21 @@ class _LoginPageState extends State<LoginPage> {
|
||||
width: double.infinity,
|
||||
child: BlocBuilder<LoginCubit, LoginState>(
|
||||
builder: (context, state) {
|
||||
bool isLoading = state is LoginLoading; // 假设你有 Loading 状态
|
||||
// 关键:判断是否正在 Loading
|
||||
bool isLoading = state is LoginLoading;
|
||||
|
||||
return CCPrimaryButton(
|
||||
onPressed: () {
|
||||
if (!_isAgreed) {
|
||||
// 如果没有勾选协议,弹出提示
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('请先阅读并同意用户协议')));
|
||||
return;
|
||||
}
|
||||
if (state is! LoginLoading) {
|
||||
_handleLogin();
|
||||
}
|
||||
},
|
||||
text: state is LoginLoading ? '登录中...' : '登 录',
|
||||
// 核心修复:正在加载时 → onPressed 为 null,按钮禁用
|
||||
onPressed: isLoading
|
||||
? null
|
||||
: () {
|
||||
if (!_isAgreed) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('请先阅读并同意用户协议')));
|
||||
return;
|
||||
}
|
||||
_handleLogin();
|
||||
},
|
||||
text: isLoading ? '登录中...' : '登 录',
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user