Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@

All notable changes to this project will be documented in this file.

## 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.

## 1.0.0
This is the first public release of the package.

### Added
- Flutter UI kit for displaying and managing in-app notifications.



4 changes: 3 additions & 1 deletion lib/src/theme/app_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion lib/src/theme/dark_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion lib/src/theme/light_colors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion lib/src/widgets/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
32 changes: 27 additions & 5 deletions lib/src/widgets/card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ class _CardWidgetState extends State<CardWidget> {
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),
Expand Down Expand Up @@ -181,7 +187,11 @@ class _CardWidgetState extends State<CardWidget> {
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,
Expand Down Expand Up @@ -218,7 +228,11 @@ class _CardWidgetState extends State<CardWidget> {
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,
Expand All @@ -233,7 +247,11 @@ class _CardWidgetState extends State<CardWidget> {
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,
Expand Down Expand Up @@ -325,7 +343,11 @@ class _CardWidgetState extends State<CardWidget> {
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,
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/empty_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down