mobile: keep the callout dark in dark mode

The inverse surface is a flat light gray in dark mode, which washed the
first-agent card out. In dark mode the callout now uses the raised dark
surface and regular text color, as toasts do. Light mode keeps the
inverse colors.

Co-authored-by: Carl <c217fe6b9d958f41c3a5e030dccc7f626775a923089cb6491305eade75ea1f1b@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
This commit is contained in:
morgmart
2026-11-04 11:42:37 -08:00
parent c6596a344f
commit f16600ea10

View File

@@ -84,8 +84,7 @@ class BuzzCallout extends HookWidget {
top: padding.top + Grid.xs,
),
fullWidth: onTap != null,
// Inverse colors set the callout apart from menus and the page.
color: context.colors.inverseSurface,
color: _calloutColors(context).$1,
shadowColor: appPopoverShadowColor(context),
child: onTap == null
? _Tip(message: message, onDismiss: onDismiss)
@@ -102,6 +101,16 @@ class BuzzCallout extends HookWidget {
}
}
/// The callout's background and foreground. Inverse colors set it apart from
/// menus and the page; in dark mode, whose inverse is a flat light gray, it
/// uses the raised dark surface instead, as toasts do.
(Color, Color) _calloutColors(BuildContext context) {
final colors = context.colors;
return Theme.of(context).brightness == Brightness.dark
? (colors.surfaceContainer, colors.onSurface)
: (colors.inverseSurface, colors.onInverseSurface);
}
class _Tip extends StatelessWidget {
const _Tip({required this.message, required this.onDismiss});
@@ -127,7 +136,7 @@ class _Tip extends StatelessWidget {
message,
textAlign: TextAlign.center,
style: context.textTheme.bodyMedium?.copyWith(
color: context.colors.onInverseSurface,
color: _calloutColors(context).$2,
),
),
),
@@ -204,7 +213,7 @@ class _Card extends StatelessWidget {
message,
textAlign: TextAlign.center,
style: context.textTheme.titleLarge?.copyWith(
color: context.colors.onInverseSurface,
color: _calloutColors(context).$2,
),
),
),
@@ -215,7 +224,7 @@ class _Card extends StatelessWidget {
child: IconButton(
tooltip: 'Dismiss',
onPressed: onDismiss,
color: context.colors.onInverseSurface,
color: _calloutColors(context).$2,
icon: const Icon(BuzzIcons.x),
),
),