You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a PlatformNavBar that when I swipe back (back button) to the previous view, in the bottom bar the tab's icon is colored on the right tab, but the tab's label is wrong. This happens only on iOS and not on Android, so this make me think it could be a bug.
So, for instance, I have a situation where I have the Tab 1 icon colored but the label disabled and the Tab 3 icon disabled but the label colored.
And this is how I build the PlatformNavBar object inside a StatefulWidget:
@override
Widget build(BuildContext context) {
assignIndex(context);
final platformNavBar = getPlatformNavBar(context, widget._myService.bottomBarSelectedIndex, (index) {
setState(() {
assignIndex(context);
});
});
return PlatformScaffold(
bottomNavBar: platformNavBar,
backgroundColor: Colors.white,
body: _ScaffoldBody(
baseScaffoldService: widget._myService,
childBuilder: widget.childBuilder,
),
);
}
void assignIndex(BuildContext context) {
final int currentIndex = NavUtils.getCurrentMenuIndex(context); //a method that get the name of the route from ModalRoute and map it to an index
if(currentIndex > -1) {
widget._myService.bottomBarSelectedIndex = currentIndex;
}
}
When it comes to bottom tabs it is best to use PlatformTabScaffold. Can you use that to see if you still have the issue. If so can you produce a complete example instead of snippets. Thanks
I will try with PlatformTabScaffold, in the meantime I leave here a complete example that shows this issue with PlatformScaffold
Here's a screenshot where you can see that the app is showing the Second Tab and in the bottom bar the icon is correctly colored, but the label is wrong
I have a
PlatformNavBar
that when I swipe back (back button) to the previous view, in the bottom bar the tab's icon is colored on the right tab, but the tab's label is wrong. This happens only on iOS and not on Android, so this make me think it could be a bug.So, for instance, I have a situation where I have the Tab 1 icon colored but the label disabled and the Tab 3 icon disabled but the label colored.
This is how I create the
PlatformNavBar
object:And this is how I build the
PlatformNavBar
object inside a StatefulWidget:Flutter
version:Flutter Platform Widget
version: ^2.0.0Do you have any clue about this? Am I doing something wrong or is it a bug?
The text was updated successfully, but these errors were encountered: