import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; import '../../store/auth.store.dart'; class LoginController extends GetxController { final isAgreeTerm = RxBool(false); final formKey = GlobalKey(); final passwordFocusNode = FocusNode(); String username = ''; String password = ''; bool loading = false; Future doLogin() async { if (!formKey.currentState!.validate()) { return; } // 拿出form中的数据 AuthStore.to.login(username: username, password: password); } }