Home > database >  Plus sign removed from string passed as a parameter to a stateful widget
Plus sign removed from string passed as a parameter to a stateful widget

Time:08-30

I'm passing an email with " " in it using this

 static String getVerify(String email) => "$verify?email=$email";
  GetPage(
    name: verify,
    page: () {
      final String email = Get.parameters['email']!;
      return VerifyPage(email: email);
    },
    transition: Transition.fadeIn),

but on the verify page that plus is gone

You can see that the email is being passed correctly to the route but on the verify page the plus sign is missing and I get a space

You can see that the email is being passed correctly to the route but on the verify page the plus sign is missing and I get a space verify page

CodePudding user response:

I don't see much code about how you throwing your data to another screen and can't give you a proper answer.

BUT I see that you are using

Get.parameters

and maybe it can be a problem. Maybe some in-built regex are cutting your email string.

Also, have you tried with a string " " or other special signs?

CodePudding user response:

I fixed it by replacing the plus sign with this email.replaceAll(' ', '+') before passing to the new page

  • Related