Skip to content

Commit

Permalink
Revert disabling tab indicator when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
julien4215 committed Jan 10, 2025
1 parent af206d1 commit 21f0699
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
40 changes: 15 additions & 25 deletions lib/src/view/analysis/analysis_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,7 @@ enum AnalysisTab {

/// Indicator for the analysis tab, typically shown in the app bar.
class AppBarAnalysisTabIndicator extends StatefulWidget {
const AppBarAnalysisTabIndicator({
required this.tabs,
required this.controller,
this.enable = true,
super.key,
});
const AppBarAnalysisTabIndicator({required this.tabs, required this.controller, super.key});

final TabController controller;

Expand All @@ -54,8 +49,6 @@ class AppBarAnalysisTabIndicator extends StatefulWidget {
/// and the length of the [AnalysisLayout.children] list.
final List<AnalysisTab> tabs;

final bool enable;

@override
State<AppBarAnalysisTabIndicator> createState() => _AppBarAnalysisTabIndicatorState();
}
Expand Down Expand Up @@ -94,24 +87,21 @@ class _AppBarAnalysisTabIndicatorState extends State<AppBarAnalysisTabIndicator>
return AppBarIconButton(
icon: Icon(widget.tabs[widget.controller.index].icon),
semanticsLabel: widget.tabs[widget.controller.index].l10n(context.l10n),
onPressed:
(widget.enable)
? () {
showAdaptiveActionSheet<void>(
context: context,
actions:
widget.tabs.map((tab) {
return BottomSheetAction(
leading: Icon(tab.icon),
makeLabel: (context) => Text(tab.l10n(context.l10n)),
onPressed: (_) {
widget.controller.animateTo(widget.tabs.indexOf(tab));
},
);
}).toList(),
onPressed: () {
showAdaptiveActionSheet<void>(
context: context,
actions:
widget.tabs.map((tab) {
return BottomSheetAction(
leading: Icon(tab.icon),
makeLabel: (context) => Text(tab.l10n(context.l10n)),
onPressed: (_) {
widget.controller.animateTo(widget.tabs.indexOf(tab));
},
);
}
: null,
}).toList(),
);
},
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/src/view/broadcast/broadcast_game_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _BroadcastGameScreenState extends ConsumerState<BroadcastGameScreen>
appBar: PlatformAppBar(
title: title,
actions: [
AppBarAnalysisTabIndicator(tabs: tabs, controller: _tabController, enable: hasValue),
AppBarAnalysisTabIndicator(tabs: tabs, controller: _tabController),
AppBarIconButton(
onPressed:
hasValue
Expand Down

0 comments on commit 21f0699

Please sign in to comment.