showAccountVerification static method

Future<void> showAccountVerification({
  1. required BuildContext context,
})

Implementation

static Future<void> showAccountVerification(
    {required BuildContext context}) async {
  await showDialog(
    barrierDismissible: false,
    context: context,
    builder: (BuildContext context) => Dialog(
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.all(Radius.circular(20.0))),
      child: Container(
        decoration: BoxDecoration(
            color: Theme.of(context).brightness == Brightness.dark
                ? Theme.of(context).primaryColorDark
                : Theme.of(context).backgroundColor,
            borderRadius: BorderRadius.all(Radius.circular(20.0))),
        height: Screen.heightOf(65, context),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Padding(
              padding: EdgeInsets.only(top: Screen.heightOf(7, context)),
              child: Icon(
                FontAwesomeIcons.envelopeOpenText,
                color: Colors.purple,
                size: 80,
              ),
            ),
            SizedBox(
              height: Screen.heightOf(3, context),
            ),
            Text(
              'Account Verification',
              style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: Screen.heightOf(3, context),
                  color: Theme.of(context).primaryColorDark),
              textAlign: TextAlign.center,
            ),
            SizedBox(
              height: Screen.heightOf(3, context),
            ),
            Container(
              padding: EdgeInsets.symmetric(horizontal: 20),
              child: Text(
                'Please click the verification link in your Welcome email, then press OK to continue',
                style: TextStyle(
                    color: Theme.of(context).textTheme.caption?.color),
                textAlign: TextAlign.center,
              ),
            ),
            SizedBox(
              height: Screen.heightOf(5, context),
            ),
            Button(
              text: 'OK',
              onPressed: () async {
                var authService = locator<AuthService>();
                var accountVerified = await authService.isAccountVerified();

                if (accountVerified) {
                  Navigator.pop(context);
                }
              },
              minWidth: Screen.widthOf(25, context),
              color: Theme.of(context).primaryColor,
            ),
            SizedBox(
              height: Screen.heightOf(3, context),
            ),
            MojoTextButton(
              text: 'RESEND WELCOME EMAIL',
              onPressed: (context) async {
                var authService = locator<AuthService>();
                await authService.sendWelcomeEmail();
              },
              textColor: Theme.of(context).primaryColor,
            ),
          ],
        ),
      ),
    ),
  );
}