TF-2802 Add calendar event accept interactor to single email controller
This commit is contained in:
+4
-5
@@ -8,12 +8,10 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
|
||||
final List<EventAction> eventActions;
|
||||
final EdgeInsetsGeometry? margin;
|
||||
|
||||
const CalendarEventActionButtonWidget({
|
||||
super.key,
|
||||
required this.eventActions,
|
||||
this.margin,
|
||||
});
|
||||
|
||||
@@ -29,9 +27,9 @@ class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
child: Wrap(
|
||||
spacing: CalendarEventActionButtonWidgetStyles.space,
|
||||
runSpacing: CalendarEventActionButtonWidgetStyles.space,
|
||||
children: eventActions
|
||||
children: EventActionType.values
|
||||
.map((action) => TMailButtonWidget(
|
||||
text: action.actionType.getLabelButton(context),
|
||||
text: action.getLabelButton(context),
|
||||
backgroundColor: CalendarEventActionButtonWidgetStyles.backgroundColor,
|
||||
borderRadius: CalendarEventActionButtonWidgetStyles.borderRadius,
|
||||
padding: CalendarEventActionButtonWidgetStyles.buttonPadding,
|
||||
@@ -47,7 +45,8 @@ class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
width: CalendarEventActionButtonWidgetStyles.borderWidth,
|
||||
color: CalendarEventActionButtonWidgetStyles.textColor
|
||||
),
|
||||
onTapActionCallback: () => AppUtils.launchLink(action.link),
|
||||
// TODO: Handle in part 4
|
||||
onTapActionCallback: () => AppUtils.launchLink(''),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
||||
+1
-5
@@ -2,7 +2,6 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_detail_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/calendar_event_action_button_widget.dart';
|
||||
@@ -17,7 +16,6 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
class CalendarEventDetailWidget extends StatelessWidget {
|
||||
|
||||
final CalendarEvent calendarEvent;
|
||||
final List<EventAction> eventActions;
|
||||
final String emailContent;
|
||||
final OnOpenNewTabAction? onOpenNewTabAction;
|
||||
final OnOpenComposerAction? onOpenComposerAction;
|
||||
@@ -27,7 +25,6 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
||||
const CalendarEventDetailWidget({
|
||||
super.key,
|
||||
required this.calendarEvent,
|
||||
required this.eventActions,
|
||||
required this.emailContent,
|
||||
this.isDraggableAppActive,
|
||||
this.onOpenNewTabAction,
|
||||
@@ -92,8 +89,7 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
if (eventActions.isNotEmpty)
|
||||
CalendarEventActionButtonWidget(eventActions: eventActions),
|
||||
const CalendarEventActionButtonWidget(),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
+6
-13
@@ -4,7 +4,6 @@ import 'package:core/presentation/utils/responsive_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:jmap_dart_client/jmap/mail/calendar/calendar_event.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_event_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_information_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/widgets/calendar_event/calendar_date_icon_widget.dart';
|
||||
@@ -20,14 +19,12 @@ import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
class CalendarEventInformationWidget extends StatelessWidget {
|
||||
|
||||
final CalendarEvent calendarEvent;
|
||||
final List<EventAction> eventActions;
|
||||
final OnOpenNewTabAction? onOpenNewTabAction;
|
||||
final OnOpenComposerAction? onOpenComposerAction;
|
||||
|
||||
const CalendarEventInformationWidget({
|
||||
super.key,
|
||||
required this.calendarEvent,
|
||||
required this.eventActions,
|
||||
this.onOpenNewTabAction,
|
||||
this.onOpenComposerAction,
|
||||
});
|
||||
@@ -113,11 +110,9 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
if (eventActions.isNotEmpty)
|
||||
CalendarEventActionButtonWidget(
|
||||
eventActions: eventActions,
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
),
|
||||
const CalendarEventActionButtonWidget(
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
@@ -183,11 +178,9 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
if (eventActions.isNotEmpty)
|
||||
CalendarEventActionButtonWidget(
|
||||
eventActions: eventActions,
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
),
|
||||
const CalendarEventActionButtonWidget(
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
),
|
||||
],
|
||||
),
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user