Initial commit

This commit is contained in:
admin1
2026-07-14 11:11:36 +08:00
commit 656499cf94
604 changed files with 119518 additions and 0 deletions
+78
View File
@@ -0,0 +1,78 @@
import 'package:flutter/material.dart';
import '../theme/app_theme.dart';
class SectionHeader extends StatelessWidget {
final String label;
final int? count;
final bool collapsible;
final bool collapsed;
final VoidCallback? onToggle;
final Widget? trailing;
final Color? labelColor;
const SectionHeader({
super.key,
required this.label,
this.count,
this.collapsible = false,
this.collapsed = false,
this.onToggle,
this.trailing,
this.labelColor,
});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final tokens = context.appTokens;
final mutedColor = labelColor != null
? labelColor!.withValues(alpha: 0.55)
: tokens.mutedForeground;
final row = Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Row(
children: [
Text(
label,
style: theme.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w700,
color: labelColor,
),
),
if (count != null) ...[
const SizedBox(width: 8),
Text(
'$count',
style: theme.textTheme.bodySmall?.copyWith(color: mutedColor),
),
],
const Spacer(),
if (trailing != null) trailing!,
if (collapsible)
AnimatedRotation(
turns: collapsed ? -0.25 : 0,
duration: const Duration(milliseconds: 180),
child: Icon(
Icons.keyboard_arrow_down_rounded,
size: 20,
color: mutedColor,
),
),
],
),
);
if (!collapsible) return row;
return InkWell(
onTap: onToggle,
borderRadius: BorderRadius.circular(6),
child: row,
);
}
}