Fix emote menu header not updating properly (#238)

Fix emote menu header not updating when changing pages
This commit is contained in:
Tommy Chow 2023-01-29 01:04:18 -05:00 • committed by GitHub
parent 27ddb9c951
commit d583bad004
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -40,15 +40,11 @@ class _FrostyPageViewState extends State<FrostyPageView> {
height: 40,
child: Button(
padding: const EdgeInsets.symmetric(horizontal: 10.0, vertical: 5.0),
onPressed: () {
setState(() => currentIndex = index);
_pageContoller.animateToPage(
index,
duration: const Duration(milliseconds: 200),
curve: Curves.easeOut,
);
},
onPressed: () => _pageContoller.animateToPage(
index,
duration: const Duration(milliseconds: 200),
curve: Curves.easeOut,
),
color: index == currentIndex ? Theme.of(context).colorScheme.secondary : Colors.grey,
child: Text(
section,
@ -62,6 +58,7 @@ class _FrostyPageViewState extends State<FrostyPageView> {
),
Expanded(
child: PageView.builder(
onPageChanged: (index) => setState(() => currentIndex = index),
controller: _pageContoller,
itemBuilder: (context, index) => widget.children[index],
itemCount: widget.children.length,