custom style for tooltips

This commit is contained in:
Henry Hiles 2026-07-21 18:25:38 -04:00
commit a8285548e8
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -1,22 +1,33 @@
import "package:flutter/material.dart";
extension SchemeToTheme on ColorScheme {
ThemeData get theme => .from(colorScheme: this).copyWith(
cardTheme: .new(color: primaryContainer),
popupMenuTheme: .new(
shape: RoundedRectangleBorder(borderRadius: .circular(16)),
color: surfaceContainerHigh,
),
appBarTheme: AppBarTheme(
titleSpacing: 0,
backgroundColor: surfaceContainerLow,
),
textTheme: ThemeData(
ThemeData get theme {
final textTheme = ThemeData(
fontFamilyFallback: ["sans", "emoji", "fallback-sans", "fallback-emoji"],
brightness: brightness,
).textTheme,
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
),
);
).textTheme;
return .from(colorScheme: this).copyWith(
cardTheme: .new(color: primaryContainer),
popupMenuTheme: .new(
shape: RoundedRectangleBorder(borderRadius: .circular(16)),
color: surfaceContainerHigh,
),
appBarTheme: AppBarTheme(
titleSpacing: 0,
backgroundColor: surfaceContainerLow,
),
tooltipTheme: .new(
textStyle: textTheme.labelLarge?.copyWith(fontSize: 16),
padding: .all(8),
decoration: BoxDecoration(
color: surfaceContainerHighest,
borderRadius: .circular(8),
),
),
textTheme: textTheme,
inputDecorationTheme: const InputDecorationTheme(
border: OutlineInputBorder(),
),
);
}
}