Skip to content

Commit

Permalink
fix(YaruTabBar): make TabController nullable, add onTap
Browse files Browse the repository at this point in the history
"If [TabController] is not provided, then the value of [DefaultTabController.of] will be used."
  • Loading branch information
Feichtmeier committed Sep 23, 2023
1 parent d7f62e9 commit e87d5cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/src/widgets/yaru_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import 'package:yaru_widgets/yaru_widgets.dart';
class YaruTabBar extends StatelessWidget {
const YaruTabBar({
super.key,
required this.tabController,
this.tabController,
this.onTap,
required this.tabs,
this.height,
});

final TabController tabController;
final TabController? tabController;
final void Function(int)? onTap;
final List<Widget> tabs;
final double? height;

Expand All @@ -23,6 +25,7 @@ class YaruTabBar extends StatelessWidget {
borderRadius: BorderRadius.circular(kYaruContainerRadius),
),
child: TabBar(
onTap: onTap,
dividerColor: Colors.transparent,
controller: tabController,
labelColor: Theme.of(context).colorScheme.onSurface,
Expand Down

0 comments on commit e87d5cb

Please sign in to comment.