mobile_skt/lib/screens/login/login.controller.dart

22 lines
587 B
Dart
Raw Normal View History

import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import '../../store/auth.store.dart';
2024-03-28 15:13:27 +08:00
// import 'package:sentry/sentry.dart';
class LoginController extends GetxController {
final isAgreeTerm = RxBool(false);
2024-03-18 15:54:06 +08:00
final formKey = GlobalKey<FormState>();
final passwordFocusNode = FocusNode();
2024-03-19 08:59:08 +08:00
String username = '';
String password = '';
2024-03-18 15:54:06 +08:00
bool loading = false;
Future<void> doLogin() async {
if (!formKey.currentState!.validate()) {
return;
}
2024-03-28 15:13:27 +08:00
2024-03-19 08:59:08 +08:00
// 拿出form中的数据
AuthStore.to.login(username: username, password: password);
}
}