From a8285548e8108a2d99be4fe39613b14924e89dcd Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Tue, 21 Jul 2026 18:25:38 -0400 Subject: [PATCH] custom style for tooltips --- lib/helpers/extensions/scheme_to_theme.dart | 43 +++++++++++++-------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/lib/helpers/extensions/scheme_to_theme.dart b/lib/helpers/extensions/scheme_to_theme.dart index fdda5d8..92253de 100644 --- a/lib/helpers/extensions/scheme_to_theme.dart +++ b/lib/helpers/extensions/scheme_to_theme.dart @@ -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(), + ), + ); + } }