Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions lib/shared/widgets/querya_empty_state.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart' as material;
import 'package:shadcn_flutter/shadcn_flutter.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/core/ui/querya_control_tokens.dart';
import 'package:querya_desktop/shared/widgets/querya_button.dart';

/// Standard empty state placeholder for lists, search results, tabs, and query outputs.
class QueryaEmptyState extends material.StatelessWidget {
Expand Down Expand Up @@ -38,7 +39,7 @@ class QueryaEmptyState extends material.StatelessWidget {

@override
material.Widget build(material.BuildContext context) {
final cs = Theme.of(context).colorScheme;
final cs = context.colors;
final workbench = QueryaThemeScope.maybeOf(context)?.workbench;

final iconColor = (workbench?.mutedForeground ?? cs.mutedForeground).withValues(alpha: 0.6);
Expand Down Expand Up @@ -70,10 +71,10 @@ class QueryaEmptyState extends material.StatelessWidget {

material.Widget? actionWidget = action;
if (actionWidget == null && actionLabel != null && onAction != null) {
actionWidget = OutlineButton(
size: compact ? ButtonSize.small : ButtonSize.normal,
actionWidget = QueryaButton.secondary(
label: actionLabel!,
size: compact ? QueryaControlSize.sm : QueryaControlSize.lg,
onPressed: onAction,
child: Text(actionLabel!),
);
}

Expand All @@ -86,7 +87,7 @@ class QueryaEmptyState extends material.StatelessWidget {
children: [
if (iconWidget != null) ...[
iconWidget,
Gap(compact ? 10 : 16),
material.SizedBox(height: compact ? 10 : 16),
],
material.Text(
title,
Expand All @@ -98,7 +99,7 @@ class QueryaEmptyState extends material.StatelessWidget {
),
),
if (description != null && description!.isNotEmpty) ...[
Gap(compact ? 4 : 6),
material.SizedBox(height: compact ? 4 : 6),
material.ConstrainedBox(
constraints: const material.BoxConstraints(maxWidth: 360),
child: material.Text(
Expand All @@ -113,7 +114,7 @@ class QueryaEmptyState extends material.StatelessWidget {
),
],
if (actionWidget != null) ...[
Gap(compact ? 12 : 20),
material.SizedBox(height: compact ? 12 : 20),
actionWidget,
],
],
Expand Down
1 change: 0 additions & 1 deletion test/guards/shared_does_not_import_shadcn_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ void main() {
'lib/shared/widgets/export_menu_button.dart',
'lib/shared/widgets/querya_action_button.dart',
'lib/shared/widgets/querya_action_menu.dart',
'lib/shared/widgets/querya_empty_state.dart',
'lib/shared/widgets/querya_modal_dialog.dart',
'lib/shared/widgets/widgets.dart',
};
Expand Down
Loading