From 8c6ae9f9f9ea7d1db610f3dbe52df1ac1972bf3b Mon Sep 17 00:00:00 2001
From: devendra <devendra@devendras-MacBook-Pro.local>
Date: Thu, 8 Dec 2022 20:11:26 +0530
Subject: [PATCH] Fix: Upcoming Application details are not shown to the
 assessr

---
 lib/pages/home_page.dart          |  4 ++-
 lib/widgets/application_card.dart | 41 +++++++++++++++++--------------
 2 files changed, 26 insertions(+), 19 deletions(-)

diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart
index f7b19c6..b6baa46 100644
--- a/lib/pages/home_page.dart
+++ b/lib/pages/home_page.dart
@@ -326,7 +326,9 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
                             itemCount: _upcomingApplications.length,
                             itemBuilder: (context, i) {
                               return ApplicationCard(
-                                  application: _upcomingApplications[i]);
+                                application: _upcomingApplications[i],
+                                isUpcomingApplication: true,
+                              );
                             },
                           ),
                           Container(
diff --git a/lib/widgets/application_card.dart b/lib/widgets/application_card.dart
index 739c38c..05f4070 100644
--- a/lib/widgets/application_card.dart
+++ b/lib/widgets/application_card.dart
@@ -11,8 +11,10 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
 class ApplicationCard extends StatefulWidget {
   static const route = AppUrl.homePage;
   final Application application;
+  final bool isUpcomingApplication;
 
-  const ApplicationCard({Key? key, required this.application})
+  const ApplicationCard(
+      {Key? key, required this.application, this.isUpcomingApplication = false})
       : super(key: key);
   @override
   _ApplicationCardState createState() => _ApplicationCardState();
@@ -41,13 +43,14 @@ class _ApplicationCardState extends State<ApplicationCard> {
   Widget build(BuildContext context) {
     return InkWell(
         onTap: () {
-          // print(widget.application.inspectionStatus);
-          Navigator.push(
-              context,
-              MaterialPageRoute(
-                  builder: (context) => ApplicationDetailsPage(
-                        application: widget.application,
-                      )));
+          if (!widget.isUpcomingApplication) {
+            Navigator.push(
+                context,
+                MaterialPageRoute(
+                    builder: (context) => ApplicationDetailsPage(
+                          application: widget.application,
+                        )));
+          }
         },
         child: Container(
           width: double.infinity,
@@ -74,16 +77,18 @@ class _ApplicationCardState extends State<ApplicationCard> {
                       fontWeight: FontWeight.w600,
                     )),
               ),
-              Padding(
-                padding: const EdgeInsets.only(bottom: 10),
-                child: Text(widget.application.createdBy,
-                    style: GoogleFonts.lato(
-                      color: AppColors.black60,
-                      fontSize: 14.0,
-                      letterSpacing: 0.12,
-                      fontWeight: FontWeight.w700,
-                    )),
-              ),
+              widget.isUpcomingApplication
+                  ? const SizedBox()
+                  : Padding(
+                      padding: const EdgeInsets.only(bottom: 10),
+                      child: Text(widget.application.createdBy,
+                          style: GoogleFonts.lato(
+                            color: AppColors.black60,
+                            fontSize: 14.0,
+                            letterSpacing: 0.12,
+                            fontWeight: FontWeight.w700,
+                          )),
+                    ),
               Padding(
                 padding: const EdgeInsets.only(bottom: 10),
                 child: Text(
-- 
GitLab