From 3cdad0a88e72f2c700614f2b5ecf1ed95fed92bd Mon Sep 17 00:00:00 2001 From: Anitta Babu <99161914+anitta-keyvalue@users.noreply.github.com> Date: Wed, 15 May 2024 11:10:25 +0530 Subject: [PATCH 1/3] fix: Fix for style and theme issues --- lib/src/theme/app_colors.dart | 4 +++- lib/src/theme/dark_colors.dart | 3 ++- lib/src/theme/light_colors.dart | 3 ++- lib/src/widgets/app_bar.dart | 6 +++++- lib/src/widgets/card.dart | 32 ++++++++++++++++++++++++++----- lib/src/widgets/empty_widget.dart | 2 +- 6 files changed, 40 insertions(+), 10 deletions(-) diff --git a/lib/src/theme/app_colors.dart b/lib/src/theme/app_colors.dart index 5254423..78730ac 100644 --- a/lib/src/theme/app_colors.dart +++ b/lib/src/theme/app_colors.dart @@ -27,6 +27,7 @@ class AppColors { required this.emptyWidgetBorderColor, required this.emptyWidgetIconColor, required this.emptyWidgetNotificationColor, + required this.emptyWidgetNotificationIconColor, required this.errorWidgetIconColor, required this.errorWidgetIconContainer, required this.errorWidgetText1, @@ -63,12 +64,13 @@ class AppColors { Color clearAllIcon; Color dateColor; Color deleteIcon; - Color emptyScreenTitle; Color emptyScreenDescription; + Color emptyScreenTitle; Color emptyWidgetBackground; Color emptyWidgetBorderColor; Color emptyWidgetIconColor; Color emptyWidgetNotificationColor; + Color emptyWidgetNotificationIconColor; Color errorWidgetIconColor; Color errorWidgetIconContainer; Color errorWidgetText1; diff --git a/lib/src/theme/dark_colors.dart b/lib/src/theme/dark_colors.dart index 06a5fd2..8ac18fa 100644 --- a/lib/src/theme/dark_colors.dart +++ b/lib/src/theme/dark_colors.dart @@ -26,6 +26,7 @@ final darkColors = AppColors( emptyWidgetBorderColor: SirenAppColors.emptyWidgetBgDarkTheme, emptyWidgetIconColor: SirenAppColors.emptyWidgetBadgeDark, emptyWidgetNotificationColor: SirenAppColors.emptyWidgetBadgeDark, + emptyWidgetNotificationIconColor: SirenAppColors.emptyWidgetBadgeDark, errorWidgetIconColor: SirenAppColors.emptyWidgetBellDark, errorWidgetIconContainer: SirenAppColors.emptyWidgetBgDarkTheme, errorWidgetText1: SirenAppColors.grey700Complementary, @@ -34,7 +35,7 @@ final darkColors = AppColors( loaderColor: SirenAppColors.primary200Complementary, loadingIndicator: SirenAppColors.primary200Complementary, loadingIndicatorBackground: SirenAppColors.emptyWidgetBgDarkTheme, - notificationIconColor: SirenAppColors.emptyWidgetBadgeDark, + notificationIconColor: Colors.white, primary: SirenAppColors.primary200Complementary, scaffoldBackgroundColor: SirenAppColors.black100, skeletonLoaderColor: SirenAppColors.avatarPlaceholderBgDark, diff --git a/lib/src/theme/light_colors.dart b/lib/src/theme/light_colors.dart index 2c8ad28..9c9e622 100644 --- a/lib/src/theme/light_colors.dart +++ b/lib/src/theme/light_colors.dart @@ -26,6 +26,7 @@ final lightColors = AppColors( emptyWidgetBorderColor: SirenAppColors.emptyWidgetBgLightTheme, emptyWidgetIconColor: SirenAppColors.emptyWidgetBellLight, emptyWidgetNotificationColor: SirenAppColors.emptyWidgetBadgeLight, + emptyWidgetNotificationIconColor: SirenAppColors.emptyWidgetBadgeLight, errorWidgetIconColor: SirenAppColors.emptyWidgetBellLight, errorWidgetIconContainer: SirenAppColors.emptyWidgetBgLightTheme, errorWidgetText1: SirenAppColors.grey700, @@ -34,7 +35,7 @@ final lightColors = AppColors( loaderColor: SirenAppColors.primary200, loadingIndicator: SirenAppColors.primary200, loadingIndicatorBackground: SirenAppColors.emptyWidgetBgLightTheme, - notificationIconColor: SirenAppColors.emptyWidgetBadgeLight, + notificationIconColor: SirenAppColors.black100, primary: SirenAppColors.primary200, scaffoldBackgroundColor: Colors.white, skeletonLoaderColor: SirenAppColors.avatarPlaceholderBgLight, diff --git a/lib/src/widgets/app_bar.dart b/lib/src/widgets/app_bar.dart index 272fa0b..c8709eb 100644 --- a/lib/src/widgets/app_bar.dart +++ b/lib/src/widgets/app_bar.dart @@ -75,7 +75,11 @@ class SirenAppBar extends StatelessWidget implements PreferredSizeWidget { styles?.appBarStyle?.titlePadding ?? EdgeInsets.zero, child: Text( headerParams?.title ?? Strings.notifications, - style: styles?.appBarStyle?.headerTextStyle ?? + style: styles?.appBarStyle?.headerTextStyle?.copyWith( + color: colors?.inboxHeaderColors?.titleColor ?? + colors?.textColor ?? + defaultColors.appBarTextColor, + ) ?? TextStyle( fontSize: 18, fontWeight: FontWeight.w600, diff --git a/lib/src/widgets/card.dart b/lib/src/widgets/card.dart index 804fb15..7f3f5e0 100644 --- a/lib/src/widgets/card.dart +++ b/lib/src/widgets/card.dart @@ -63,7 +63,13 @@ class _CardWidgetState extends State { widget.onTap(widget.notification); }, child: Container( - decoration: widget.styles?.cardStyle?.cardContainer?.decoration ?? + decoration: widget.styles?.cardStyle?.cardContainer?.decoration + ?.copyWith( + color: widget.notification.isRead + ? widget.colors?.cardColors?.background ?? Colors.transparent + : widget.colors?.highlightedCardColor ?? + defaultColors.cardBackgroundUnread, + ) ?? _getDefaultContainerDecoration(widget.colors, defaultColors), padding: widget.styles?.cardStyle?.cardContainer?.padding ?? const EdgeInsets.symmetric(vertical: 12, horizontal: 12), @@ -181,7 +187,11 @@ class _CardWidgetState extends State { widget.notification.message.header ?? '', maxLines: 2, overflow: TextOverflow.ellipsis, - style: widget.styles?.cardStyle?.cardTitle ?? + style: widget.styles?.cardStyle?.cardTitle?.copyWith( + color: colors?.cardColors?.titleColor ?? + colors?.textColor ?? + defaultColors.textColor, + ) ?? TextStyle( fontSize: 14, fontWeight: FontWeight.w600, @@ -218,7 +228,11 @@ class _CardWidgetState extends State { padding: const EdgeInsets.symmetric(vertical: 6), child: NullableText( text: widget.notification.message.subHeader, - style: widget.styles?.cardStyle?.cardSubtitle ?? + style: widget.styles?.cardStyle?.cardSubtitle?.copyWith( + color: colors?.cardColors?.subtitleColor ?? + colors?.textColor ?? + defaultColors.textColor, + ) ?? TextStyle( fontSize: 14, fontWeight: FontWeight.w500, @@ -233,7 +247,11 @@ class _CardWidgetState extends State { Widget _buildBodyText(CustomThemeColors? colors, AppColors defaultColors) { return Text( widget.notification.message.body ?? '', - style: widget.styles?.cardStyle?.cardDescription ?? + style: widget.styles?.cardStyle?.cardDescription?.copyWith( + color: colors?.cardColors?.descriptionColor ?? + colors?.textColor ?? + defaultColors.textColor, + ) ?? TextStyle( fontSize: 14, fontWeight: FontWeight.w400, @@ -325,7 +343,11 @@ class _CardWidgetState extends State { generateElapsedTimeText( DateTime.parse(widget.notification.createdAt), ), - style: widget.styles?.cardStyle?.dateStyle ?? + style: widget.styles?.cardStyle?.dateStyle?.copyWith( + color: colors?.dateColor ?? + colors?.textColor ?? + defaultColors.dateColor, + ) ?? TextStyle( fontSize: 12, fontWeight: FontWeight.w400, diff --git a/lib/src/widgets/empty_widget.dart b/lib/src/widgets/empty_widget.dart index e321af8..4c3d836 100644 --- a/lib/src/widgets/empty_widget.dart +++ b/lib/src/widgets/empty_widget.dart @@ -77,7 +77,7 @@ Widget _buildCircle(AppColors colors) { child: Container( padding: const EdgeInsets.all(8), decoration: BoxDecoration( - color: colors.notificationIconColor, + color: colors.emptyWidgetNotificationIconColor, shape: BoxShape.circle, border: Border.all( color: colors.emptyWidgetBorderColor, From 8a49b6a7e76b03f9714ee296bc0a51dc649c3bca Mon Sep 17 00:00:00 2001 From: Anitta Babu <99161914+anitta-keyvalue@users.noreply.github.com> Date: Wed, 15 May 2024 14:08:32 +0530 Subject: [PATCH 2/3] docs: Add changelog for v1.1.0 --- CHANGELOG.md | 11 +++++++++++ pubspec.yaml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b1e7a..2dbd6ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,4 +8,15 @@ This is the first public release of the package. ### Added - Flutter UI kit for displaying and managing in-app notifications. +## 1.1.0 +This is an update to the package. + +### Added +- Added support for custom delete icon and a flag to toggle the visibility of the delete icon. +- Added functionality to display thumbnail URL previews for media content. +- Exposed avatar click property. +- Implemented specific error code mapping. +- Enhanced style and theme customizations. + + diff --git a/pubspec.yaml b/pubspec.yaml index 045c036..82252c8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sirenapp_flutter_inbox description: "Flutter SDK tailored for creating and managing in-app notification inboxes." -version: 1.0.0 +version: 1.1.0 homepage: 'https://github.com/KeyValueSoftwareSystems/siren-flutter-inbox#readme' repository: 'https://github.com/KeyValueSoftwareSystems/siren-flutter-inbox' license: MIT From 1efa93d79c063daac3371a415cdeec81cd1d99a2 Mon Sep 17 00:00:00 2001 From: Anitta Babu <99161914+anitta-keyvalue@users.noreply.github.com> Date: Wed, 15 May 2024 14:25:37 +0530 Subject: [PATCH 3/3] format: Format changelog --- CHANGELOG.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dbd6ca..ba12a49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,6 @@ All notable changes to this project will be documented in this file. -## 1.0.0 -This is the first public release of the package. - -### Added -- Flutter UI kit for displaying and managing in-app notifications. - ## 1.1.0 This is an update to the package. @@ -18,5 +12,11 @@ This is an update to the package. - Implemented specific error code mapping. - Enhanced style and theme customizations. +## 1.0.0 +This is the first public release of the package. + +### Added +- Flutter UI kit for displaying and managing in-app notifications. +