Introduce FrostyColors ThemeExtension with 7 semantic color fields (highlightedMessage, emoteOnly, followersOnly, slowMode, subOnly, uniqueMode, overlayOnSurface) and brightness-aware light/dark variants. Replace hardcoded colors across 15 files: - Links use colorScheme.primary instead of Colors.blue - Mentions use colorScheme.error instead of Colors.red - First-time chatters share highlightedMessage (Twitch purple) - Chat mode indicators use frostyColors fields - Overlay text uses frostyColors.overlayOnSurface Remove Provider<FrostyThemes> pattern from main.dart, channel.dart, video_overlay.dart, and frosty_photo_view_dialog.dart. Replace manual onSurface.withValues(alpha: 0.6) with M3's built-in onSurfaceVariant for secondary text in section headers, chat modes, alerts, loading indicators, and input hints. Fix double-muted onSurfaceVariant.withValues(alpha: 0.6) in navigation icons and notification dismiss button. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.3 KiB
Dart
51 lines
1.3 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) {
|
|
final isLandscape = context.isLandscape;
|
|
|
|
return Padding(
|
|
padding:
|
|
padding ??
|
|
EdgeInsets.fromLTRB(
|
|
isLandscape ? MediaQuery.of(context).padding.left : 16,
|
|
0,
|
|
isLandscape ? MediaQuery.of(context).padding.right : 16,
|
|
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,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|