already_have_an_account_check.dart 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_auth/models/config.dart';
  3. /// Description: 账户是否已注册,注册了显示登录
  4. /// Time : 08/24/2023 Thursday
  5. /// Author : liuyuqi.gov@msn.cn
  6. class AlreadyHaveAnAccountCheck extends StatelessWidget {
  7. /// 账户是否已登录
  8. final bool login;
  9. /// 跳转
  10. final Function? press;
  11. const AlreadyHaveAnAccountCheck({
  12. Key? key,
  13. this.login = true,
  14. required this.press,
  15. }) : super(key: key);
  16. @override
  17. Widget build(BuildContext context) {
  18. return Row(
  19. mainAxisAlignment: MainAxisAlignment.center,
  20. children: <Widget>[
  21. Text(
  22. login ? "还没账户 ? " : "已有账户 ? ",
  23. style: const TextStyle(color: kPrimaryColor),
  24. ),
  25. GestureDetector(
  26. onTap: press as void Function()?,
  27. child: Text(
  28. login ? "注册" : "登录",
  29. style: const TextStyle(
  30. color: kPrimaryColor,
  31. fontWeight: FontWeight.bold,
  32. ),
  33. ),
  34. )
  35. ],
  36. );
  37. }
  38. }