Skip to content

Commit

Permalink
TF-1857 Display calendar event icon in item list email
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Jul 20, 2023
1 parent 8912a81 commit dd91c05
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 0 deletions.
5 changes: 5 additions & 0 deletions assets/images/ic_calendar_event.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions core/lib/presentation/extensions/color_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ extension AppColor on Color {
static const colorBackgroundDeliveringState = Color(0xFFF2F3F5);
static const colorNetworkConnectionBannerBackground = Color(0x99EBEDF0);
static const colorNetworkConnectionLabel = Color(0xFF818C99);
static const colorCalendarEventRead = Color(0xFF818C99);
static const colorCalendarEventUnread = Color(0xFF1C1B1F);

static const mapGradientColor = [
[Color(0xFF21D4FD), Color(0xFFB721FF)],
Expand Down
1 change: 1 addition & 0 deletions core/lib/presentation/resources/image_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class ImagePaths {
String get icArrowLeft => _getImagePath('ic_arrow_left.svg');
String get icArrowRight => _getImagePath('ic_arrow_right.svg');
String get icAddPicture => _getImagePath('ic_add_picture.svg');
String get icCalendarEvent => _getImagePath('ic_calendar_event.svg');

String _getImagePath(String imageName) {
return AssetsPaths.images + imageName;
Expand Down
12 changes: 12 additions & 0 deletions lib/features/thread/presentation/mixin/base_email_item_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,16 @@ mixin BaseEmailItemTile {
return null;
}
}

Widget buildCalendarEventIcon({required PresentationEmail presentationEmail}) {
return SvgPicture.asset(
imagePaths.icCalendarEvent,
width: 20,
height: 20,
fit: BoxFit.fill,
colorFilter: presentationEmail.hasRead
? AppColor.colorCalendarEventRead.asFilter()
: AppColor.colorCalendarEventUnread.asFilter(),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ class EmailTileBuilder with BaseEmailItemTile {
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (_presentationEmail.hasCalendarEvent)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: buildCalendarEventIcon(presentationEmail: _presentationEmail),
),
Expanded(child: buildEmailTitle(
_context,
_presentationEmail,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ class EmailTileBuilder with BaseEmailItemTile {
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (_presentationEmail.hasCalendarEvent)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: buildCalendarEventIcon(presentationEmail: _presentationEmail),
),
Expanded(child: buildEmailTitle(
_context,
_presentationEmail,
Expand Down Expand Up @@ -255,6 +260,11 @@ class EmailTileBuilder with BaseEmailItemTile {
Row(
mainAxisSize: MainAxisSize.min,
children: [
if (_presentationEmail.hasCalendarEvent)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: buildCalendarEventIcon(presentationEmail: _presentationEmail),
),
Expanded(child: buildEmailTitle(
_context,
_presentationEmail,
Expand Down Expand Up @@ -509,6 +519,11 @@ class EmailTileBuilder with BaseEmailItemTile {
Widget _buildSubjectAndContent() {
return LayoutBuilder(builder: (context, constraints) {
return Row(children: [
if (_presentationEmail.hasCalendarEvent)
Padding(
padding: const EdgeInsetsDirectional.only(end: 8),
child: buildCalendarEventIcon(presentationEmail: _presentationEmail),
),
if (_presentationEmail.getEmailTitle().isNotEmpty)
Container(
constraints: BoxConstraints(maxWidth: constraints.maxWidth / 2),
Expand Down

0 comments on commit dd91c05

Please sign in to comment.