frosty/lib/widgets/section_header.dart
Tommy Chow 5be231da73 fix landscape safe area padding across settings and list screens
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:04:00 -07:00

49 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:frosty/utils/context_extensions.dart';
class SectionHeader extends StatelessWidget {
final String text;
final EdgeInsets? padding;
final double? fontSize;
final bool isFirst;
final double? topPadding;
const SectionHeader(
this.text, {
super.key,
this.padding,
this.fontSize,
this.isFirst = false,
this.topPadding,
});
@override
Widget build(BuildContext context) {
return Padding(
padding:
padding ??
EdgeInsets.fromLTRB(
16 + MediaQuery.of(context).padding.left,
0,
16 + MediaQuery.of(context).padding.right,
8,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
if (!isFirst) ...[SizedBox(height: topPadding ?? 32)],
Text(
text.toUpperCase(),
style: TextStyle(
fontSize: fontSize ?? 13,
fontWeight: FontWeight.w600,
letterSpacing: 0.5,
color: context.colorScheme.onSurfaceVariant,
),
),
],
),
);
}
}