From 15be037b70c78edc34d44830cd6998ed6cacc216 Mon Sep 17 00:00:00 2001 From: Shubham Jitiya Date: Mon, 30 Dec 2024 11:30:17 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20Fixes=20issue=20#432:=20=F0=9F=90=9B=20F?= =?UTF-8?q?ixes=20right=20icon=20always=20shows=20default=20icon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../headers/calendar_page_header.dart | 29 ++++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40e28339..de5b4bdf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Adds `showWeekends` flag in month view to hide & show weekends view. Default is `showWeekends = true` shows all weekdays. [#385](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/385) - Events are now hidden for days not in the current month when hideDaysNotInMonth = true +- Fixes right icon always shows default icon in `CalendarPageHeader` when providing custom icon. [#432](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/issues/432) # [1.3.0 - 12 Nov 2024](https://github.com/SimformSolutionsPvtLtd/flutter_calendar_view/tree/1.3.0) diff --git a/lib/src/components/headers/calendar_page_header.dart b/lib/src/components/headers/calendar_page_header.dart index 21086ea8..c29c93b3 100644 --- a/lib/src/components/headers/calendar_page_header.dart +++ b/lib/src/components/headers/calendar_page_header.dart @@ -143,20 +143,21 @@ class CalendarPageHeader extends StatelessWidget { ), if (headerStyle.rightIconVisible && headerStyle.rightIconConfig != null) - IconButton( - onPressed: onNextDay, - splashColor: Colors.transparent, - focusColor: Colors.transparent, - hoverColor: Colors.transparent, - highlightColor: Colors.transparent, - padding: headerStyle.rightIconPadding, - icon: headerStyle.rightIcon ?? - Icon( - Icons.chevron_right, - size: headerStyle.rightIconConfig?.size, - color: iconColor ?? headerStyle.rightIconConfig?.color, - ), - ), + headerStyle.rightIconConfig!.icon?.call(context) ?? + IconButton( + onPressed: onNextDay, + splashColor: Colors.transparent, + focusColor: Colors.transparent, + hoverColor: Colors.transparent, + highlightColor: Colors.transparent, + padding: headerStyle.rightIconPadding, + icon: headerStyle.rightIcon ?? + Icon( + Icons.chevron_right, + size: headerStyle.rightIconConfig?.size, + color: iconColor ?? headerStyle.rightIconConfig?.color, + ), + ), ], ), );