custom style for tooltips
This commit is contained in:
parent
cdad9b760e
commit
a8285548e8
1 changed files with 27 additions and 16 deletions
|
|
@ -1,7 +1,12 @@
|
||||||
import "package:flutter/material.dart";
|
import "package:flutter/material.dart";
|
||||||
|
|
||||||
extension SchemeToTheme on ColorScheme {
|
extension SchemeToTheme on ColorScheme {
|
||||||
ThemeData get theme => .from(colorScheme: this).copyWith(
|
ThemeData get theme {
|
||||||
|
final textTheme = ThemeData(
|
||||||
|
fontFamilyFallback: ["sans", "emoji", "fallback-sans", "fallback-emoji"],
|
||||||
|
brightness: brightness,
|
||||||
|
).textTheme;
|
||||||
|
return .from(colorScheme: this).copyWith(
|
||||||
cardTheme: .new(color: primaryContainer),
|
cardTheme: .new(color: primaryContainer),
|
||||||
popupMenuTheme: .new(
|
popupMenuTheme: .new(
|
||||||
shape: RoundedRectangleBorder(borderRadius: .circular(16)),
|
shape: RoundedRectangleBorder(borderRadius: .circular(16)),
|
||||||
|
|
@ -11,12 +16,18 @@ extension SchemeToTheme on ColorScheme {
|
||||||
titleSpacing: 0,
|
titleSpacing: 0,
|
||||||
backgroundColor: surfaceContainerLow,
|
backgroundColor: surfaceContainerLow,
|
||||||
),
|
),
|
||||||
textTheme: ThemeData(
|
tooltipTheme: .new(
|
||||||
fontFamilyFallback: ["sans", "emoji", "fallback-sans", "fallback-emoji"],
|
textStyle: textTheme.labelLarge?.copyWith(fontSize: 16),
|
||||||
brightness: brightness,
|
padding: .all(8),
|
||||||
).textTheme,
|
decoration: BoxDecoration(
|
||||||
|
color: surfaceContainerHighest,
|
||||||
|
borderRadius: .circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
textTheme: textTheme,
|
||||||
inputDecorationTheme: const InputDecorationTheme(
|
inputDecorationTheme: const InputDecorationTheme(
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue