bharat_erp/lib/shared/widgets/page_header.dart
SurendarSuri30 8f852ac4f6 Initial commit: Bharat ERP Flutter application.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 15:04:06 +05:30

66 lines
2.1 KiB
Dart

import 'package:flutter/material.dart';
import '../../core/utils/responsive_utils.dart';
class PageHeader extends StatelessWidget {
const PageHeader({
super.key,
required this.title,
this.subtitle,
this.actions,
});
final String title;
final String? subtitle;
final List<Widget>? actions;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(bottom: 24),
child: context.isMobile
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: Theme.of(context).textTheme.headlineSmall),
if (subtitle != null) ...[
const SizedBox(height: 4),
Text(
subtitle!,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
if (actions != null && actions!.isNotEmpty) ...[
const SizedBox(height: 16),
Wrap(spacing: 8, runSpacing: 8, children: actions!),
],
],
)
: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(title, style: Theme.of(context).textTheme.headlineSmall),
if (subtitle != null) ...[
const SizedBox(height: 4),
Text(
subtitle!,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
],
),
),
if (actions != null) ...actions!,
],
),
);
}
}