diff --git a/lib/features/extensions/extension_driver_recovery_banner.dart b/lib/features/extensions/extension_driver_recovery_banner.dart index ace33501..140c0ad5 100644 --- a/lib/features/extensions/extension_driver_recovery_banner.dart +++ b/lib/features/extensions/extension_driver_recovery_banner.dart @@ -20,13 +20,14 @@ class ExtensionDriverRecoveryBanner extends material.StatelessWidget { @override material.Widget build(material.BuildContext context) { final theme = Theme.of(context); + final colors = context.colors; final isDark = theme.brightness == material.Brightness.dark; final bgColor = isDark - ? theme.colorScheme.destructive.withValues(alpha: 0.12) - : theme.colorScheme.destructive.withValues(alpha: 0.08); + ? colors.destructive.withValues(alpha: 0.12) + : colors.destructive.withValues(alpha: 0.08); - final borderColor = theme.colorScheme.destructive.withValues(alpha: 0.35); + final borderColor = colors.destructive.withValues(alpha: 0.35); return material.Container( margin: const material.EdgeInsets.fromLTRB(12, 8, 12, 8), @@ -41,7 +42,7 @@ class ExtensionDriverRecoveryBanner extends material.StatelessWidget { material.Icon( material.Icons.power_off_rounded, size: 20, - color: theme.colorScheme.destructive, + color: colors.destructive, ), const Gap(12), material.Expanded( diff --git a/lib/features/extensions/extension_stats_view.dart b/lib/features/extensions/extension_stats_view.dart index dd9052e6..409619e8 100644 --- a/lib/features/extensions/extension_stats_view.dart +++ b/lib/features/extensions/extension_stats_view.dart @@ -6,9 +6,8 @@ import 'package:querya_desktop/core/extensions/models/extension_server_stats.dar import 'package:querya_desktop/core/motion/polling_controller.dart'; import 'package:querya_desktop/core/storage/local_db.dart'; import 'package:querya_desktop/core/util/deep_collection_equals.dart'; +import 'package:querya_desktop/core/theme/querya_ui_colors.dart'; import 'package:querya_desktop/shared/widgets/widgets.dart'; -import 'package:shadcn_flutter/shadcn_flutter.dart' as shadcn - hide TextExtension; import 'package:querya_desktop/core/ui/querya_control_tokens.dart'; const _pollInterval = Duration(seconds: 5); @@ -113,7 +112,7 @@ class _ExtensionStatsViewState extends material.State @override material.Widget build(material.BuildContext context) { - final cs = Theme.of(context).colorScheme; + final cs = context.colors; if (_loading) { return const material.Center( @@ -195,7 +194,7 @@ class _ExtensionStatsViewState extends material.State } material.Widget _header(material.BuildContext context) { - final cs = shadcn.Theme.of(context).colorScheme; + final cs = context.colors; return material.LayoutBuilder( builder: (context, constraints) { return material.SingleChildScrollView( @@ -251,7 +250,7 @@ class _ExtensionStatsViewState extends material.State material.Widget _summaryChips( material.BuildContext context, ExtensionServerStats stats) { - final cs = shadcn.Theme.of(context).colorScheme; + final cs = context.colors; final versionFull = stats.serverVersion ?? '—'; final uptimeSec = stats.uptimeSeconds; final uptimeStr = uptimeSec == null @@ -314,7 +313,7 @@ class _ExtensionStatsViewState extends material.State } material.Widget _buildChip( - shadcn.ColorScheme cs, ({String label, String value, material.IconData icon}) chip) { + QueryaUiColors cs, ({String label, String value, material.IconData icon}) chip) { return Card( padding: const material.EdgeInsets.symmetric(horizontal: 16, vertical: 12), child: material.Row( @@ -356,7 +355,7 @@ class _ExtensionStatsViewState extends material.State material.Widget _databasesCard( material.BuildContext context, ExtensionServerStats stats) { - final cs = shadcn.Theme.of(context).colorScheme; + final cs = context.colors; final sizes = stats.databaseSizes; final totalBytes = sizes.values.fold(0, (a, b) => a + b); final sorted = sizes.entries.toList() @@ -457,7 +456,7 @@ class _ExtensionStatsViewState extends material.State material.Widget _extraMetricsCard( material.BuildContext context, ExtensionServerStats stats) { - final cs = shadcn.Theme.of(context).colorScheme; + final cs = context.colors; final extra = stats.extraMetrics.entries.toList(); return Card( diff --git a/lib/features/extensions/extension_table_toolbar.dart b/lib/features/extensions/extension_table_toolbar.dart index 2636f663..11ef28ba 100644 --- a/lib/features/extensions/extension_table_toolbar.dart +++ b/lib/features/extensions/extension_table_toolbar.dart @@ -54,7 +54,7 @@ class ExtensionTableToolbar extends material.StatelessWidget { @override material.Widget build(material.BuildContext context) { - final cs = Theme.of(context).colorScheme; + final cs = context.colors; final isFiltered = filterActive || filterText.trim().isNotEmpty; return material.Container( diff --git a/lib/features/extensions/extension_table_view.dart b/lib/features/extensions/extension_table_view.dart index 91125a24..c9ee04d4 100644 --- a/lib/features/extensions/extension_table_view.dart +++ b/lib/features/extensions/extension_table_view.dart @@ -484,13 +484,10 @@ class _ExtensionTableViewState extends material.State { horizontal: 16, vertical: 8), decoration: material.BoxDecoration( color: - Theme.of(context).colorScheme.muted.withValues(alpha: 0.3), + context.colors.muted.withValues(alpha: 0.3), border: material.Border( bottom: material.BorderSide( - color: Theme.of(context) - .colorScheme - .border - .withValues(alpha: 0.3), + color: context.colors.border.withValues(alpha: 0.3), ), ), ), diff --git a/lib/features/extensions/extension_workspace_home.dart b/lib/features/extensions/extension_workspace_home.dart index 142334a7..6a9b5cec 100644 --- a/lib/features/extensions/extension_workspace_home.dart +++ b/lib/features/extensions/extension_workspace_home.dart @@ -81,7 +81,7 @@ class _ExtensionWorkspaceHomeState @override material.Widget build(material.BuildContext context) { - final theme = Theme.of(context); + final colors = context.colors; return Column( crossAxisAlignment: material.CrossAxisAlignment.stretch, children: [ @@ -89,7 +89,7 @@ class _ExtensionWorkspaceHomeState constraints: const material.BoxConstraints(minHeight: 44), padding: const material.EdgeInsets.symmetric(horizontal: 12), decoration: material.BoxDecoration( - color: theme.colorScheme.muted.withValues(alpha: 0.6), + color: colors.muted.withValues(alpha: 0.6), ), child: material.Row( children: [ @@ -104,7 +104,7 @@ class _ExtensionWorkspaceHomeState material.Icon( material.Icons.lock_outline_rounded, size: 14, - color: theme.colorScheme.mutedForeground, + color: colors.mutedForeground, ), ], if (widget.lastSelectedExtensionObject != null && diff --git a/lib/features/extensions/presentation/pages/extension_manager_dialog.dart b/lib/features/extensions/presentation/pages/extension_manager_dialog.dart index 6488407d..376638bd 100644 --- a/lib/features/extensions/presentation/pages/extension_manager_dialog.dart +++ b/lib/features/extensions/presentation/pages/extension_manager_dialog.dart @@ -211,7 +211,7 @@ class _ExtensionManagerContentState @override material.Widget build(material.BuildContext context) { - final theme = Theme.of(context).colorScheme; + final theme = context.colors; final onPopover = theme.popoverForeground; return material.DefaultTextStyle( @@ -364,7 +364,7 @@ class _ExtensionManagerContentState child: QueryaSpinner(size: QueryaSpinnerSize.lg), ); } - final theme = Theme.of(context).colorScheme; + final theme = context.colors; return material.Column( children: [ material.Padding( @@ -499,7 +499,7 @@ class _ExtensionManagerContentState child: QueryaSpinner(size: QueryaSpinnerSize.lg), ); } - final theme = Theme.of(context).colorScheme; + final theme = context.colors; return material.Center( child: material.Padding( padding: const material.EdgeInsets.all(32.0), diff --git a/lib/features/extensions/presentation/widgets/extension_card.dart b/lib/features/extensions/presentation/widgets/extension_card.dart index 5c508119..b1626a7b 100644 --- a/lib/features/extensions/presentation/widgets/extension_card.dart +++ b/lib/features/extensions/presentation/widgets/extension_card.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart' as material; import 'package:querya_desktop/core/extensions/extension_support.dart'; import 'package:querya_desktop/core/extensions/models/extension_manifest.dart'; import 'package:querya_desktop/core/extensions/models/extension_type.dart'; +import 'package:querya_desktop/core/theme/querya_ui_colors.dart'; import 'package:querya_desktop/shared/widgets/widgets.dart'; import 'package:querya_desktop/core/ui/querya_control_tokens.dart'; @@ -29,7 +30,7 @@ class ExtensionCard extends material.StatelessWidget { @override material.Widget build(material.BuildContext context) { - final theme = Theme.of(context).colorScheme; + final theme = context.colors; final radius = Theme.of(context).radiusMd; final isPreview = ExtensionSupport.isPreviewOnlyManifest(manifest); @@ -161,7 +162,7 @@ class ExtensionCard extends material.StatelessWidget { ); } - material.Widget _buildIcon(ColorScheme theme, double radius) { + material.Widget _buildIcon(QueryaUiColors theme, double radius) { return material.Container( width: 48, height: 48, @@ -179,7 +180,7 @@ class ExtensionCard extends material.StatelessWidget { ); } - material.Widget _buildPreviewBadge(ColorScheme theme) { + material.Widget _buildPreviewBadge(QueryaUiColors theme) { return material.Container( padding: const material.EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: material.BoxDecoration( @@ -198,7 +199,7 @@ class ExtensionCard extends material.StatelessWidget { ); } - material.Widget _buildTagBadge(ColorScheme theme, String tag) { + material.Widget _buildTagBadge(QueryaUiColors theme, String tag) { return material.Container( padding: const material.EdgeInsets.symmetric(horizontal: 6, vertical: 2), decoration: material.BoxDecoration( diff --git a/lib/features/extensions/presentation/widgets/extension_sideload_dialog.dart b/lib/features/extensions/presentation/widgets/extension_sideload_dialog.dart index ce8d2552..e2b30b7d 100644 --- a/lib/features/extensions/presentation/widgets/extension_sideload_dialog.dart +++ b/lib/features/extensions/presentation/widgets/extension_sideload_dialog.dart @@ -58,7 +58,7 @@ class _ExtensionSideloadDialogState @override material.Widget build(material.BuildContext context) { - final cs = Theme.of(context).colorScheme; + final cs = context.colors; final fileName = p.basename(widget.archivePath); return QueryaModalDialog( diff --git a/lib/features/extensions/presentation/widgets/unsandboxed_driver_consent_dialog.dart b/lib/features/extensions/presentation/widgets/unsandboxed_driver_consent_dialog.dart index 44811a35..43a31364 100644 --- a/lib/features/extensions/presentation/widgets/unsandboxed_driver_consent_dialog.dart +++ b/lib/features/extensions/presentation/widgets/unsandboxed_driver_consent_dialog.dart @@ -24,7 +24,7 @@ Future showUnsandboxedDriverConsentDialog( details.installHint!, style: material.TextStyle( fontSize: 13, - color: Theme.of(dialogContext).colorScheme.mutedForeground, + color: dialogContext.colors.mutedForeground, ), ), ], diff --git a/test/guards/colors_through_context_test.dart b/test/guards/colors_through_context_test.dart index 43f24175..d7e933ba 100644 --- a/test/guards/colors_through_context_test.dart +++ b/test/guards/colors_through_context_test.dart @@ -9,6 +9,7 @@ import 'package:flutter_test/flutter_test.dart'; void main() { const migrated = [ 'lib/features/connections', + 'lib/features/extensions', 'lib/features/mongodb', 'lib/features/mysql', 'lib/features/postgresql', diff --git a/test/guards/shadcn_imports_ratchet_test.dart b/test/guards/shadcn_imports_ratchet_test.dart index 59c2677f..0349ccd1 100644 --- a/test/guards/shadcn_imports_ratchet_test.dart +++ b/test/guards/shadcn_imports_ratchet_test.dart @@ -30,7 +30,6 @@ void main() { 'lib/features/erd/widgets/erd_group_menu.dart', 'lib/features/erd/widgets/erd_note_card.dart', 'lib/features/erd/widgets/erd_table_menu.dart', - 'lib/features/extensions/extension_stats_view.dart', 'lib/features/main_screen/querya_window_title_bar.dart', 'lib/features/mongodb/mongo_document_tree_view.dart', 'lib/features/mongodb/mongo_documents_json_view.dart',