Skip to content

Commit

Permalink
Close tab on tertiaryTapUp (bdlukaa#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
WinXaito committed Dec 24, 2021
1 parent f40d2ce commit 827ab11
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions lib/src/controls/navigation/tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,21 +152,24 @@ class TabView extends StatelessWidget {
double preferredTabWidth,
) {
final Tab tab = tabs[index];
final Widget child = Row(mainAxisSize: MainAxisSize.min, children: [
Flexible(
fit: FlexFit.loose,
child: _Tab(
tab,
key: ValueKey<int>(index),
reorderIndex: isReorderEnabled ? index : null,
selected: index == currentIndex,
onPressed: onChanged == null ? null : () => onChanged!(index),
animationDuration: FluentTheme.of(context).fastAnimationDuration,
animationCurve: FluentTheme.of(context).animationCurve,
final Widget child = GestureDetector(
onTertiaryTapUp: (_) => tabs[index].onClosed?.call(),
child: Row(mainAxisSize: MainAxisSize.min, children: [
Flexible(
fit: FlexFit.loose,
child: _Tab(
tab,
key: ValueKey<int>(index),
reorderIndex: isReorderEnabled ? index : null,
selected: index == currentIndex,
onPressed: onChanged == null ? null : () => onChanged!(index),
animationDuration: FluentTheme.of(context).fastAnimationDuration,
animationCurve: FluentTheme.of(context).animationCurve,
),
),
),
if (![currentIndex - 1, currentIndex].contains(index)) divider,
]);
if (![currentIndex - 1, currentIndex].contains(index)) divider,
]),
);
return AnimatedContainer(
key: ValueKey<Tab>(tab),
width: preferredTabWidth,
Expand Down

0 comments on commit 827ab11

Please # to comment.