How can i change Pageview's pages directly from Sidebar Menu according to each Button. Below the screenshot of the web application.
Asked
Active
Viewed 316 times
0
-
Please provide enough code so others can better understand or reproduce the problem. – Community Apr 22 '22 at 12:16
1 Answers
1
Instead of using PageView you can use this approach;
//class variable
final _screens = [
const Page1(),
const Page2(),
const Page3(),
];
_currentIndex = 0;
//your start page
return Scaffold(
body: Stack(
children: [
_screens[_currentIndex],
//some code
],
),
);
And you can change _currentIndex my tapping your left side buttons. (with setState() method)

aedemirsen
- 92
- 1
- 10
-
1Thanks for the answer, using this method it will be possible to change the side pages without hidden sidebar menu, i wrapped these widgets in Row Widget. – Henriques Arrone Apr 21 '22 at 16:39
-
-
-
@HenriquesArrone I had never thought about it, that's a nice approach. – Dani3le_ Apr 22 '22 at 12:18