Swipe through list items in detail of each item - Flutter - flutter

I have rendered a list of items on a page. I can tap the item to view its detail, How do I swipe left and right in the list item detail to go to the next item detail. Attaching images for more explanation.
This is the main list
This is item detail on tap of list item
What I want is to go to the next item in the list by swiping through the list detail.

Jon Mountjoy is right, just use PageView in detail page, page view items is your list items, when you click the item in the list view, pass index and in next detail page view page, jump to that index item or assign the initial index of controller to that selected index.

Related

How can click list view Navigate detail when I click the button in PageView?

1-There is a list view builder with title and image.
2-There is a pageview.
3-There are button previous and next.
I want to create a list view builder that has 10 items when I click item1 navigate to page view it shows item1 on page view and when I click button next it shows item2 order list view builder.
Thanks for your help.
This my code:
I have been able to get the functionality your app needs using available data (animal data) . The data is a list of 10 animals, each having a name and an image.
Here is a gif to demonstrate
ScreenA has a list of items. ScreenB has the same list of items but as pages (i.e. PageView widget)
When one of the items from the list on ScreenA is tapped, the user navigates to ScreenB which is a horizontal PageView.
The catch => ScreenB needs to know which list item was tapped so it can show data starting at the tapped list item
I used BlocProvider to pass myBloc from ScreenA to ScreenB. The index of the tapped list item also needs to be communicated to ScreenB and that is passed via MaterialPageRoute as arguments
The code is posted to Github (here)

how to Navigate to a particular bottom navigation item in a new page onpress of a button in the previous page in Flutter

I have many pages with the same bottom navigation bar title in my flutter app. For example, let's say I have two pages: A and B and page A doesn't have bottom navigation but page B has one with tree items. So I want to navigate from A to B but directly to the second or third item's index in bottom navigation items list.

Android list view with header

I noticed that when adding a header view to a list view ,index for items start with 1,but if the list view doesn't have a header then index for items starts with 0.What is the design principle for this?

Swiping Navigation

I have a list view of all my Facebook friend lists. I want clicking on an item from the list view to display a detailed view of the friend. Now I want to slide this detail view of the items to show the detail view of next item in the list. Similarly previous item for left to right.
I have tried using information from this question, but I want to use view pager and page adapter.
you should look at the sample that comes with the sdk which uses a pager adapter and a dummy fragment for data...

UINavigationController going directly to 'next' controller?

I have a UINavigationController with 3 levels of hierarchy: Menu->Submenu->Details. Menu and Submenu are UITableViews whereas Details is some custom view controller.
I want to add 'previous' and 'next' buttons in the Details view that will allow me to directly go to the previous and next items from the current Submenu.
For example let's say I have:
|Menu |M1 Submenu |SM2 Details
--------------------------------
M1 -> |SM1 |D1
M2 |SM2 -> |D2
M3 |SM3 |D3 // Let's say we are here now
|D4
// ... etc ...
// The arrows represent items the user selected
So let's say the app is currently showing the D3 Details view controller. This means that we are currently in M1->SM2->D3. Now in D3 if the user presses a 'next' button it should show D4. Similarly if s/he presses the 'previous' button it should show D2.
So the 'next' and 'previous' buttons essentially do the same thing as pressing the navigation controller back button and then selecting the next item in the list.
What would be the best way to implement this? Do I have to pop back up to the submenu and then push another Details controller? Do I call the submenu controller directly from the details view controller (if so how)?
Thanks.
There's really no need to call the parent controller. Here's what you can do:
Assuming you keep an array of "detail" items in Submenu Controller, instead of initializing the detail controller with the selected item, initialize it with the array and the selected index.
Then, when the prev/next buttons are pressed, change the selected index and update the view accordingly.