mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
improve tab bar
This commit is contained in:
@@ -369,10 +369,14 @@ class _FilledTabBarState extends State<FilledTabBar> {
|
||||
final double tabWidth = tabRight - tabLeft;
|
||||
final double tabCenter = tabLeft + tabWidth / 2;
|
||||
final double tabBarWidth = tabBarBox.size.width;
|
||||
final double scrollOffset = tabCenter - tabBarWidth / 2;
|
||||
double scrollOffset = tabCenter - tabBarWidth / 2;
|
||||
if (scrollOffset == scrollController.offset) {
|
||||
return;
|
||||
}
|
||||
scrollOffset = scrollOffset.clamp(
|
||||
0.0,
|
||||
scrollController.position.maxScrollExtent,
|
||||
);
|
||||
scrollController.animateTo(
|
||||
scrollOffset,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
|
Reference in New Issue
Block a user