From f23b055993049c07e04e1ec1fedf27aaba981a1c Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 22 Apr 2024 22:16:16 +0300 Subject: [PATCH] BirthdayCalendar logic to show phone icon only if phone number exists for user --- lib/page/birthday/birthday.dart | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/page/birthday/birthday.dart b/lib/page/birthday/birthday.dart index 8c9a51d2..683625d4 100644 --- a/lib/page/birthday/birthday.dart +++ b/lib/page/birthday/birthday.dart @@ -47,11 +47,13 @@ class BirthdayWidget extends StatelessWidget { Provider.of(context, listen: false).updateNotificationStatusForBirthday(); }), ), - new IconButton( - icon: Icon(Icons.call, color: Provider.of(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)), - onPressed: () { - Provider.of(context, listen: false).handleCallButtonPressed(birthdayOfPerson.phoneNumber); - }), + if (birthdayOfPerson.phoneNumber.isNotEmpty) ...[ + new IconButton( + icon: Icon(Icons.call, color: Provider.of(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)), + onPressed: () { + Provider.of(context, listen: false).handleCallButtonPressed(birthdayOfPerson.phoneNumber); + }) + ], new IconButton( icon: Icon(Icons.clear, color: Provider.of(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)), onPressed: onDeletePressedCallback),