TF-2812 Calendar event accept integrate UI
This commit is contained in:
+12
-4
@@ -4,14 +4,19 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:tmail_ui_user/features/email/domain/model/event_action.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/styles/calendar_event_action_button_widget_styles.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_utils.dart';
|
||||
|
||||
typedef OnCalendarEventReplyActionClick = void Function(EventActionType eventActionType);
|
||||
|
||||
class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
|
||||
final EdgeInsetsGeometry? margin;
|
||||
final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick;
|
||||
final bool calendarEventReplying;
|
||||
|
||||
const CalendarEventActionButtonWidget({
|
||||
super.key,
|
||||
required this.onCalendarEventReplyActionClick,
|
||||
required this.calendarEventReplying,
|
||||
this.margin,
|
||||
});
|
||||
|
||||
@@ -30,7 +35,9 @@ class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
children: EventActionType.values
|
||||
.map((action) => TMailButtonWidget(
|
||||
text: action.getLabelButton(context),
|
||||
backgroundColor: CalendarEventActionButtonWidgetStyles.backgroundColor,
|
||||
backgroundColor: calendarEventReplying
|
||||
? CalendarEventActionButtonWidgetStyles.loadingBackgroundColor
|
||||
: CalendarEventActionButtonWidgetStyles.backgroundColor,
|
||||
borderRadius: CalendarEventActionButtonWidgetStyles.borderRadius,
|
||||
padding: CalendarEventActionButtonWidgetStyles.buttonPadding,
|
||||
textStyle: const TextStyle(
|
||||
@@ -45,8 +52,9 @@ class CalendarEventActionButtonWidget extends StatelessWidget {
|
||||
width: CalendarEventActionButtonWidgetStyles.borderWidth,
|
||||
color: CalendarEventActionButtonWidgetStyles.textColor
|
||||
),
|
||||
// TODO: Handle in part 4
|
||||
onTapActionCallback: () => AppUtils.launchLink(''),
|
||||
onTapActionCallback: calendarEventReplying
|
||||
? null
|
||||
: () => onCalendarEventReplyActionClick(action),
|
||||
))
|
||||
.toList(),
|
||||
),
|
||||
|
||||
+7
-1
@@ -21,11 +21,15 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
||||
final OnOpenComposerAction? onOpenComposerAction;
|
||||
final bool? isDraggableAppActive;
|
||||
final OnMailtoDelegateAction? onMailtoDelegateAction;
|
||||
final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick;
|
||||
final bool calendarEventReplying;
|
||||
|
||||
const CalendarEventDetailWidget({
|
||||
super.key,
|
||||
required this.calendarEvent,
|
||||
required this.emailContent,
|
||||
required this.onCalendarEventReplyActionClick,
|
||||
required this.calendarEventReplying,
|
||||
this.isDraggableAppActive,
|
||||
this.onOpenNewTabAction,
|
||||
this.onOpenComposerAction,
|
||||
@@ -89,7 +93,9 @@ class CalendarEventDetailWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
const CalendarEventActionButtonWidget(),
|
||||
CalendarEventActionButtonWidget(
|
||||
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
|
||||
calendarEventReplying: calendarEventReplying),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
+10
-2
@@ -21,10 +21,14 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
final CalendarEvent calendarEvent;
|
||||
final OnOpenNewTabAction? onOpenNewTabAction;
|
||||
final OnOpenComposerAction? onOpenComposerAction;
|
||||
final OnCalendarEventReplyActionClick onCalendarEventReplyActionClick;
|
||||
final bool calendarEventReplying;
|
||||
|
||||
const CalendarEventInformationWidget({
|
||||
super.key,
|
||||
required this.calendarEvent,
|
||||
required this.onCalendarEventReplyActionClick,
|
||||
required this.calendarEventReplying,
|
||||
this.onOpenNewTabAction,
|
||||
this.onOpenComposerAction,
|
||||
});
|
||||
@@ -110,8 +114,10 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
const CalendarEventActionButtonWidget(
|
||||
CalendarEventActionButtonWidget(
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
|
||||
calendarEventReplying: calendarEventReplying,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -178,8 +184,10 @@ class CalendarEventInformationWidget extends StatelessWidget {
|
||||
organizer: calendarEvent.organizer!,
|
||||
),
|
||||
),
|
||||
const CalendarEventActionButtonWidget(
|
||||
CalendarEventActionButtonWidget(
|
||||
margin: EdgeInsetsDirectional.zero,
|
||||
onCalendarEventReplyActionClick: onCalendarEventReplyActionClick,
|
||||
calendarEventReplying: calendarEventReplying,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user