Skip to content

Passing arguments to pages #371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JCKodel opened this issue Apr 23, 2025 · 0 comments
Open

Passing arguments to pages #371

JCKodel opened this issue Apr 23, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@JCKodel
Copy link

JCKodel commented Apr 23, 2025

What feature would you like to see?

I'm implementing a two-page OTP e-mail sign in, where the first page has a text input for the e-mail and the second a text input for the code received.

My back-end requires me to send the e-mail address along with the code for validation, but I could not figure out how to send the e-mail from the first step to the second (I end up using a ValueNotifier<String> and sending it to the constructor of the second page, so it could read the actual value, set by the first page).

It would be nice if we could set variables to the current WoltModalSheet, using one (or both) of these options:

void _goToNextPage() {
  WoltModelSheet.of(context).showNext(_email);

  // or

  final wms = WoltModalSheet.of(context);

  wms.bucket["email"] = _email;
  wms.showNext();
}

In the second page, we could get the parameters:

final email = WoltModelSheet.of(context).parameter as String; // for the first case

// or

final email = WoltModelSheet.of(context).bucket["email"] as String; // for the second case
@JCKodel JCKodel added the enhancement New feature or request label Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant