createWarningBox method

Widget createWarningBox({
  1. String? message,
  2. String? link,
  3. EdgeInsets? margin,
})

Implementation

Widget createWarningBox({String? message, String? link, EdgeInsets? margin}) {
  _onAuthError();
  return Center(
    child: Container(
      margin: margin ?? EdgeInsets.only(left: 16, right: 16, top: 20),
      child: Visibility(
        visible: _warningBoxVisibility.value,
        child: StatusBox(
          () => setVisibilityWarning(false),
          child: RichText(
            text: TextSpan(children: [
              TextSpan(
                text: message ??
                    "Incorrect login details. Please be aware that multiple failed login attempts may cause for your account to be locked out. If you are having troubles with your login details please visit your servicers website to reset your password. ",
                style: TextStyle(color: Color(0xff721D24)),
              ),
              TextSpan(
                  text: "${link ?? servicer.forgotPasswordUrl}.",
                  recognizer: new TapGestureRecognizer()
                    ..onTap = () async => await launchURL(link ?? servicer.forgotPasswordUrl),
                  style: TextStyle(color: colorScheme.primary))
            ]),
          ),
          closeButtonColor: Colors.yellow,
          borderColor: Colors.yellow,
          boxColor: Colors.yellow[100],
          width: double.infinity,
        ),
      ),
    ),
  );
}