import 'package:flutter/material.dart'; import 'package:pweb/generated/i18n/app_localizations.dart'; class RolesHeader extends StatelessWidget { final String title; final String subtitle; final VoidCallback? onBack; const RolesHeader({ super.key, required this.title, required this.subtitle, this.onBack, }); @override Widget build(BuildContext context) { final theme = Theme.of(context); final loc = AppLocalizations.of(context)!; return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (onBack != null) ...[ IconButton( icon: const Icon(Icons.arrow_back), onPressed: onBack, tooltip: loc.back, color: theme.colorScheme.primary, ), const SizedBox(width: 8), ], Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: theme.textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.w600), ), const SizedBox(height: 6), Text( subtitle, style: theme.textTheme.bodyMedium?.copyWith( color: theme.colorScheme.onSurfaceVariant, ), ), ], ), ), ], ); } }