From 56d4d104fd925e539c2cb5ab5934a66cbf46f7cd Mon Sep 17 00:00:00 2001 From: Abhishek Date: Fri, 20 Feb 2026 14:20:10 +0530 Subject: [PATCH] git commit -m "fix: consolidate duplicate EmptyCard and InitialCard widgets - Removed InitialCard widget (duplicate of EmptyCard) - Updated widgets barrel export to remove InitialCard - Updated home.dart to use EmptyCard for both loading and empty states - Updated tests to reflect consolidated widget usage Fixes #37" --- lib/ui/pages/home.dart | 2 +- lib/ui/widgets/initial_card.dart | 17 ----------------- lib/ui/widgets/widgets.dart | 1 - test/pages/home_test.dart | 6 +++--- 4 files changed, 4 insertions(+), 22 deletions(-) delete mode 100644 lib/ui/widgets/initial_card.dart diff --git a/lib/ui/pages/home.dart b/lib/ui/pages/home.dart index 71e08b5..d51c99b 100644 --- a/lib/ui/pages/home.dart +++ b/lib/ui/pages/home.dart @@ -72,7 +72,7 @@ class HomePageState extends ConsumerState { ), Flexible( child: queryResultState.when( - loading: () => const InitialCard(), + loading: () => const EmptyCard(), data: (state) => state.issues.isEmpty ? const EmptyCard() : IssueListDataView( diff --git a/lib/ui/widgets/initial_card.dart b/lib/ui/widgets/initial_card.dart deleted file mode 100644 index cb41af3..0000000 --- a/lib/ui/widgets/initial_card.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:flutter/material.dart'; - -class InitialCard extends StatelessWidget { - const InitialCard({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: const [], - ), - ); - } -} diff --git a/lib/ui/widgets/widgets.dart b/lib/ui/widgets/widgets.dart index 63602fd..f9c39d4 100644 --- a/lib/ui/widgets/widgets.dart +++ b/lib/ui/widgets/widgets.dart @@ -1,4 +1,3 @@ export 'empty_card.dart'; -export 'initial_card.dart'; export 'issue_list.dart'; export 'search_panel.dart'; diff --git a/test/pages/home_test.dart b/test/pages/home_test.dart index 6d5a0a0..f3d11a1 100644 --- a/test/pages/home_test.dart +++ b/test/pages/home_test.dart @@ -47,7 +47,7 @@ void main() { ); // Verify that loading displays. - expect(find.byType(InitialCard), findsOneWidget); + expect(find.byType(EmptyCard), findsOneWidget); await tester.pump(); @@ -76,7 +76,7 @@ void main() { ); // Verify that loading displays. - expect(find.byType(InitialCard), findsOneWidget); + expect(find.byType(EmptyCard), findsOneWidget); await tester.tap(find.byIcon(Icons.more_vert)); @@ -115,7 +115,7 @@ void main() { ); // Verify that loading displays. - expect(find.byType(InitialCard), findsOneWidget); + expect(find.byType(EmptyCard), findsOneWidget); await tester.pump();