Skip to content

Commit

Permalink
Add conditional spacing to header
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeDoctorDE committed Aug 8, 2024
1 parent c453ae4 commit a3af605
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/material_leap/lib/src/widgets/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ class Header extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
child: Row(children: [
if (leading != null)
if (leading != null) ...[
IconTheme(
data: Theme.of(context).appBarTheme.iconTheme ??
Theme.of(context).iconTheme,
child: leading!),
const SizedBox(width: 16),
const SizedBox(width: 16),
],
Expanded(
child: DefaultTextStyle(
style: Theme.of(context).textTheme.headlineSmall ??
const TextStyle(fontSize: 20),
child: title),
),
...actions,
if (actions.isNotEmpty) ...[
const SizedBox(width: 16),
...actions,
],
]),
);
}
Expand Down

0 comments on commit a3af605

Please sign in to comment.