Skip to content

Commit

Permalink
feat(linux): platform app bar proepr height
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Nov 11, 2022
1 parent 448ecf7 commit c834d14
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/src/platform_app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class PlatformAppBar extends StatelessWidget
if (platform == TargetPlatform.windows) {
preferredSize = const Size.fromHeight(40);
}
if (platform == TargetPlatform.linux) {
preferredSize = const Size.fromHeight(kToolbarHeight - 5);
}
}

@override
Expand Down Expand Up @@ -128,7 +131,7 @@ class PlatformAppBar extends StatelessWidget

@override
Widget linux(BuildContext context) {
return AdwHeaderBar(
final adwHeaderBar = AdwHeaderBar(
actions: AdwActions(),
title: title != null && titleTextStyle != null
? DefaultTextStyle(
Expand All @@ -148,9 +151,19 @@ class PlatformAppBar extends StatelessWidget
style: HeaderBarStyle(
textStyle: toolbarTextStyle,
titlebarSpace: titleSpacing ?? 6,
isTransparent: backgroundColor == Colors.transparent,
isTransparent: backgroundColor != null,
),
);
if (backgroundColor != null) {
return DecoratedBox(
decoration: BoxDecoration(
color: backgroundColor,
border: Border(bottom: BorderSide(color: context.borderColor)),
),
child: adwHeaderBar,
);
}
return adwHeaderBar;
}

@override
Expand Down

0 comments on commit c834d14

Please sign in to comment.