dont jump scroll position in quick tab switcher
This commit is contained in:
-13
@@ -424,7 +424,6 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final disableAnimations = MediaQuery.disableAnimationsOf(context);
|
|
||||||
final showIsolatedTabUi = ref.watch(
|
final showIsolatedTabUi = ref.watch(
|
||||||
generalSettingsWithDefaultsProvider.select((s) => s.showIsolatedTabUi),
|
generalSettingsWithDefaultsProvider.select((s) => s.showIsolatedTabUi),
|
||||||
);
|
);
|
||||||
@@ -498,17 +497,6 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
|||||||
if (!item.isHistory && item.isActive) {
|
if (!item.isHistory && item.isActive) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void>? animation;
|
|
||||||
if (disableAnimations) {
|
|
||||||
chipScrollController.jumpTo(0);
|
|
||||||
} else {
|
|
||||||
animation = chipScrollController.animateTo(
|
|
||||||
0,
|
|
||||||
duration: const Duration(milliseconds: 200),
|
|
||||||
curve: Curves.easeOutBack,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (item.isHistory) {
|
if (item.isHistory) {
|
||||||
await ref
|
await ref
|
||||||
.read(tabRepositoryProvider.notifier)
|
.read(tabRepositoryProvider.notifier)
|
||||||
@@ -516,7 +504,6 @@ class QuickTabSwitcher extends HookConsumerWidget {
|
|||||||
} else {
|
} else {
|
||||||
await ref.read(tabRepositoryProvider.notifier).selectTab(item.id);
|
await ref.read(tabRepositoryProvider.notifier).selectTab(item.id);
|
||||||
}
|
}
|
||||||
await animation;
|
|
||||||
},
|
},
|
||||||
itemWrapBuilder: (child, item) {
|
itemWrapBuilder: (child, item) {
|
||||||
if (item.isHistory) {
|
if (item.isHistory) {
|
||||||
|
|||||||
Reference in New Issue
Block a user