Skip to content

Commit

Permalink
feat(platform_tab_view): lower default tab height
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 3, 2022
1 parent 2fdbfae commit 2f855fb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/platform_tab_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ class PlatformTab {
Theme.of(context).colorScheme.primary
: color ?? Theme.of(context).tabBarTheme.unselectedLabelColor;

final tabTheme = TabBarTheme.of(context);

return Tab(
height: 45,
icon: IconTheme(
data: IconThemeData(color: theColor),
child: icon,
),
child: Text(
label,
style: (labelStyle ??
Theme.of(context).textTheme.labelMedium ??
(active
? tabTheme.labelStyle
: tabTheme.unselectedLabelStyle) ??
const TextStyle())
.copyWith(color: theColor),
),
Expand Down Expand Up @@ -190,10 +195,12 @@ class PlatformTabView extends StatefulWidget {
final Map<PlatformTab, Widget> body;
final PlatformProperty<PlatformTabbarPlacement>? placement;
final bool isNavigational;
final bool androidIsScrollable;

const PlatformTabView({
required this.body,
this.controller,
this.androidIsScrollable = false,
this.placement = const PlatformProperty(
android: PlatformTabbarPlacement.bottom,
ios: PlatformTabbarPlacement.bottom,
Expand Down Expand Up @@ -248,6 +255,7 @@ class _PlatformTabViewState extends State<PlatformTabView>
Widget android(BuildContext context) {
final tabbar = TabBar(
controller: controller.android,
isScrollable: widget.androidIsScrollable,
tabs: widget.body.keys
.mapIndexed((i, e) => e.android(context, currentIndex == i))
.toList(),
Expand Down

0 comments on commit 2f855fb

Please sign in to comment.