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

23 lines
658 B
Dart
Raw Normal View History

import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/config.dart';
import '../../constants/enum.dart';
import '../../store/auth.store.dart';
import '../../util/util.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-19 08:59:08 +08:00
// 拿出form中的数据
AuthStore.to.login(username: username, password: password);
}
}