import 'package:flutter/material.dart';

class SignUpVerifyState {
  final TextEditingController controller;
  final FocusNode focusNode;

  // 获取验证码的倒计时
  bool isCounting;
  int countdownTime;

  SignUpVerifyState({
    this.isCounting = false,
    this.countdownTime = 0,
    TextEditingController? controller,
    FocusNode? focusNode,
  })  : controller = controller ?? TextEditingController(),
        focusNode = focusNode ?? FocusNode();

  SignUpVerifyState copyWith({
    bool? isCounting,
    int? countdownTime,
  }) {
    return SignUpVerifyState(
      isCounting: isCounting ?? this.isCounting,
      countdownTime: countdownTime ?? this.countdownTime,
      controller: this.controller,
      focusNode: this.focusNode,
    );
  }
}
