Skip to content
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

What to do when using Named Routes? #19

Closed
hardiklakhalani opened this issue Apr 14, 2021 · 1 comment
Closed

What to do when using Named Routes? #19

hardiklakhalani opened this issue Apr 14, 2021 · 1 comment

Comments

@hardiklakhalani
Copy link

main.dart
initialRoute: '/', routes: { '/': (context) => InputPage(), '/results': (context) => ResultPage(), }

input_page.dart
BottomButton( buttonTitle: 'CALCULATE', onTap: () { CalculatorBrain calc = CalculatorBrain(height: height, weight: weight); Navigator.pushNamed(context, '/results'); }, ),

How do we pass properties to ResultPage() ?

@sanchitpasricha
Copy link

After '/results' comma and add lines below
arguments: Results_page(
bmiResult: calc.calculateBMI(),
result: calc.getResult(),
suggestion: calc.getSuggestion(),
),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants