TF-2182 Enable hyperlink for event description
(cherry picked from commit 5b44a0060b7f7509d940e8a4fb4e1c66f365a8ea)
This commit is contained in:
+5
-1
@@ -54,7 +54,11 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
||||
if (calendarEvent.description?.isNotEmpty == true)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: CalendarEventDetailWidgetStyles.fieldTopPadding),
|
||||
child: EventDescriptionDetailWidget(description: calendarEvent.description!)
|
||||
child: EventDescriptionDetailWidget(
|
||||
description: calendarEvent.description!,
|
||||
onOpenComposerAction: onOpenComposerAction,
|
||||
onOpenNewTabAction: onOpenNewTabAction,
|
||||
)
|
||||
),
|
||||
if (calendarEvent.dateTimeEventAsString.isNotEmpty)
|
||||
Padding(
|
||||
|
||||
+28
-4
@@ -1,18 +1,25 @@
|
||||
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/resources/image_paths.dart';
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_linkify/flutter_linkify.dart';
|
||||
import 'package:flutter_svg/flutter_svg.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/event_description_detail_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/event_location_detail_widget.dart';
|
||||
|
||||
class EventDescriptionDetailWidget extends StatelessWidget {
|
||||
|
||||
final String description;
|
||||
final OnOpenNewTabAction? onOpenNewTabAction;
|
||||
final OnOpenComposerAction? onOpenComposerAction;
|
||||
|
||||
const EventDescriptionDetailWidget({
|
||||
super.key,
|
||||
required this.description
|
||||
required this.description,
|
||||
this.onOpenNewTabAction,
|
||||
this.onOpenComposerAction,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -28,13 +35,30 @@ class EventDescriptionDetailWidget extends StatelessWidget {
|
||||
padding: const EdgeInsetsDirectional.all(EventDescriptionDetailWidgetStyles.contentPadding),
|
||||
child: Stack(
|
||||
children: [
|
||||
Text(
|
||||
description,
|
||||
Linkify(
|
||||
onOpen: (element) {
|
||||
log('EventDescriptionDetailWidget::build:element: $element');
|
||||
if (element is UrlElement) {
|
||||
onOpenNewTabAction?.call(element.url);
|
||||
} else if (element is EmailElement) {
|
||||
onOpenComposerAction?.call(element.emailAddress);
|
||||
}
|
||||
},
|
||||
text: description,
|
||||
linkifiers: const [
|
||||
EmailLinkifier(),
|
||||
UrlLinkifier()
|
||||
],
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: EventDescriptionDetailWidgetStyles.textSize,
|
||||
color: EventDescriptionDetailWidgetStyles.valueColor
|
||||
)
|
||||
),
|
||||
options: const LinkifyOptions(
|
||||
removeWww: true,
|
||||
looseUrl: true,
|
||||
defaultToHttps: true
|
||||
),
|
||||
),
|
||||
PositionedDirectional(
|
||||
top: 0,
|
||||
|
||||
Reference in New Issue
Block a user