getLayout method

  1. @override
Widget getLayout(
  1. bool isInSignIn,
  2. BuildContext context
)
override

Implementation

@override
Widget getLayout(bool isInSignIn, BuildContext context) {
  if (isInSignIn) {
    return Builder(builder: (context) {
      return Column(
        children: [
          Formok(
            themeColor,
            fields: config.signInFields,
            onSuccess: () async {
              await startSigning(context);
            },
            onPressed: () {
              isFirstTimeSubmittedSignIn = true;
            },
          ),
          Padding(
            padding: const EdgeInsets.only(top: 14.0),
            child: GestureDetector(
                onTap: () {
                  Navigator.of(context).push(MaterialPageRoute(
                      builder: (context) =>
                          ForgotPasswordScreen(themeColor)));
                },
                child: Text('Forgot password?', style: smalltextStyle)),
          ),
        ],
      );
    });
  } else {
    return Builder(builder: (context) {
      return Column(
        children: [
          Formok(
            themeColor,
            onPressed: () {
              isFirstTimeSubmittedSignUp = true;
            },
            fields: config.signUpFields,
            onSuccess: () async {
              await startSigning(context);
            },
          ),
        ],
      );
    });
  }
}