import 'package:flutter/material.dart'; import '../../core/theme/design_tokens.dart'; import 'page_header.dart' as widgets; class BackTitlePageHeader extends StatelessWidget { const BackTitlePageHeader({ super.key, required this.title, this.onBack, this.showBackButton = true, this.trailing, this.height = 64, }); final String title; final VoidCallback? onBack; final bool showBackButton; final Widget? trailing; final double height; @override Widget build(BuildContext context) { return SizedBox( height: height, child: Stack( alignment: Alignment.center, children: [ widgets.PageHeader( leading: showBackButton ? widgets.BackButton(onPressed: onBack) : const SizedBox( width: AppSpacing.xl * 2, height: AppSpacing.xl * 2, ), trailing: trailing ?? const SizedBox( width: AppSpacing.xl * 2, height: AppSpacing.xl * 2, ), height: height, ), IgnorePointer( child: Padding( padding: const EdgeInsets.symmetric( horizontal: AppSpacing.xxl * 2, ), child: Text( title, maxLines: 1, overflow: TextOverflow.ellipsis, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.w700, color: AppColors.slate900, ), ), ), ), ], ), ); } }