loginTypeButton method

Widget loginTypeButton({
  1. required void onPressed()?,
  2. required dynamic selectedLoginType,
  3. required dynamic buttonType,
})

customized Login button with default options

Implementation

Widget loginTypeButton({
  required void Function()? onPressed,
  required var selectedLoginType,
  required var buttonType,
}) {
  return Expanded(
    child: Widgets().textButton(
      onPressed: onPressed,
      text: buttonType == LoginType.email ? "Email" : "Phone",
      child: Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Icon(
            buttonType == LoginType.email ? Icons.email : Icons.phone,
            color:
                selectedLoginType == buttonType ? primaryColor : themeColor,
          ),
          const SizedBox(
            width: 10,
          ),
          Text(
            buttonType == LoginType.email ? "Email" : "Phone",
            style: TextStyle(
              color:
                  selectedLoginType == buttonType ? primaryColor : themeColor,
              fontSize: 18,
              fontWeight: FontWeight.bold,
            ),
          ),
        ],
      ),
      backgroundColor:
          selectedLoginType == buttonType ? themeColor : primaryColor,
      padding: const EdgeInsets.symmetric(
          horizontal: 20, vertical: kIsWeb ? 15 : 10),
    ),
  );
}