0

I 've a search form with multiple fields and it's result (a json from an http call) should be listed in a ListView. Which is the correct pattern in Flutter to show that results? Update the state of the ListView (making it visible) and hide the search form? Or wait for the results in the search form page (search_page.dart) and then send those results to other page (results_page.dart) where the ListView will show it? Thanks!

1 Answer 1

1

You can use the Navigator class to navigate to a new widget:

onPressed: () {
  Navigator.push(
    context,
    new MaterialPageRoute(builder: (context) => new SecondScreen()),
  );
}

You can pass arguments into the constructor there. There's a little more info about this here:

https://flutter.io/cookbook/navigation/navigation-basics/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.