Skip to content

Commit

Permalink
BirthdayCalendar logic to show phone icon only if phone number exists…
Browse files Browse the repository at this point in the history
… for user
  • Loading branch information
TomerPacific committed Apr 22, 2024
1 parent 625f5c3 commit f23b055
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/page/birthday/birthday.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ class BirthdayWidget extends StatelessWidget {
Provider.of<BirthdayManager>(context, listen: false).updateNotificationStatusForBirthday();
}),
),
new IconButton(
icon: Icon(Icons.call, color: Provider.of<BirthdayManager>(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)),
onPressed: () {
Provider.of<BirthdayManager>(context, listen: false).handleCallButtonPressed(birthdayOfPerson.phoneNumber);
}),
if (birthdayOfPerson.phoneNumber.isNotEmpty) ...[
new IconButton(
icon: Icon(Icons.call, color: Provider.of<BirthdayManager>(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)),
onPressed: () {
Provider.of<BirthdayManager>(context, listen: false).handleCallButtonPressed(birthdayOfPerson.phoneNumber);
})
],
new IconButton(
icon: Icon(Icons.clear, color: Provider.of<BirthdayManager>(context, listen: false).getColorBasedOnPosition(indexOfBirthday, ElementType.icon)),
onPressed: onDeletePressedCallback),
Expand Down

0 comments on commit f23b055

Please sign in to comment.