61 lines
1.6 KiB
Dart
61 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
|
|
|
import '../theme/yanting_text.dart';
|
|
import '../theme/yanting_tokens.dart';
|
|
|
|
class PageHeader extends StatelessWidget {
|
|
const PageHeader({required this.title, this.subtitle, super.key});
|
|
|
|
final String title;
|
|
final String? subtitle;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colors = ShadTheme.of(context).colorScheme;
|
|
return Padding(
|
|
padding: const EdgeInsets.only(top: 4, bottom: 18),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text(title, style: YantingText.appTitle),
|
|
if (subtitle != null && subtitle!.isNotEmpty) ...[
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
subtitle!,
|
|
style: YantingText.sub.copyWith(color: colors.mutedForeground),
|
|
),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
class SectionTitle extends StatelessWidget {
|
|
const SectionTitle({required this.title, this.icon, super.key});
|
|
|
|
final String title;
|
|
final IconData? icon;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final colors = ShadTheme.of(context).colorScheme;
|
|
return Padding(
|
|
padding: const EdgeInsets.only(
|
|
top: YantingSpacing.sectionGap,
|
|
bottom: 16,
|
|
),
|
|
child: Row(
|
|
children: [
|
|
Text(title, style: YantingText.sectionTitle),
|
|
if (icon != null) ...[
|
|
const SizedBox(width: 6),
|
|
Icon(icon, size: 18, color: colors.mutedForeground),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|