showPrimaryButton method

Widget showPrimaryButton()

Displays the primary button for generating OTP.

Implementation

Widget showPrimaryButton() {
  return Padding(
      padding: const EdgeInsets.fromLTRB(30.0, 45.0, 30.0, 10.0),
      child: SizedBox(
        height: 40.0,
        child: MaterialButton(
          elevation: 5.0,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(30.0)),
          color: Colors.teal,
          child: const Text('GENERATE OTP',
              style: TextStyle(fontSize: 17.0, color: Colors.white)),
          onPressed: () {
            debugPrint(_mobileNumberController.text);
            bool isValidateNO = validateMobileNumber(_mobileNumberController);
            if (isValidateNO) {
              // _users.phoneNumber = _mobileNumberController.value.text;

              widget.otpCallback!(_mobileNumberController.text);

              // Navigator.of(context).pushNamed('/userName');
            } else {
              showSnackbar("Enter valid mobile number!");
            }
          },
        ),
      ));
}