diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart index f7b19c6f19d5e116427216280837a04e1f535a3a..b6baa46ffdd3a09d171f94c29a56af3b539d4670 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 739c38c6010a615399ce7c09958c6110c749482d..05f40707357f4e65bd930aee8e983c9144e78845 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(