From f210aab4b39c3c78371f45e90489f24f0fb6a9be Mon Sep 17 00:00:00 2001 From: Pranshu Date: Thu, 10 Oct 2024 23:54:43 +0530 Subject: [PATCH] formatting --- lib/services/database_mutation_functions.dart | 6 +++--- lib/services/event_service.dart | 6 +++--- lib/utils/time_conversion.dart | 2 +- .../event_view_models/create_event_view_model.dart | 5 ++--- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lib/services/database_mutation_functions.dart b/lib/services/database_mutation_functions.dart index 0941ea4ca..725fda91c 100644 --- a/lib/services/database_mutation_functions.dart +++ b/lib/services/database_mutation_functions.dart @@ -121,9 +121,9 @@ class DataBaseMutationFunctions { String mutation, { Map? variables, }) async { - if (variables != null) { - traverseAndConvertDates(variables, convertLocalToUTC, splitDateTimeUTC); - } + if (variables != null) { + traverseAndConvertDates(variables, convertLocalToUTC, splitDateTimeUTC); + } final MutationOptions options = MutationOptions( document: gql(mutation), variables: variables ?? {}, diff --git a/lib/services/event_service.dart b/lib/services/event_service.dart index bd571cf20..6eb6e87d8 100644 --- a/lib/services/event_service.dart +++ b/lib/services/event_service.dart @@ -66,10 +66,10 @@ class EventService extends BaseFeedManager { } print(result.data!["eventsByOrganizationConnection"]); - final eventsJson = result - .data!["eventsByOrganizationConnection"] as List; + final eventsJson = + result.data!["eventsByOrganizationConnection"] as List; eventsJson.forEach((eventJsonData) { - final Event event = Event.fromJson(eventJsonData as Map); + final Event event = Event.fromJson(eventJsonData as Map); event.isRegistered = event.attendees?.any( (attendee) => attendee.id == _userConfig.currentUser.id, ) ?? diff --git a/lib/utils/time_conversion.dart b/lib/utils/time_conversion.dart index c48e5afcd..01c1e9f8e 100644 --- a/lib/utils/time_conversion.dart +++ b/lib/utils/time_conversion.dart @@ -11,6 +11,7 @@ Map splitDateTimeUTC(String dateTimeStr) { 'time': DateFormat('HH:mm:ss.SSS\'Z\'').format(dateTime), }; } + Map splitDateTimeLocal(String dateTimeStr) { final DateTime dateTime = DateTime.parse(dateTimeStr); return { @@ -35,7 +36,6 @@ void traverseAndConvertDates( Map Function(String) splitFn, ) { obj.forEach((key, value) { - final pairedFields = dateTimeFields['pairedFields']?.cast>(); if (pairedFields != null) { diff --git a/lib/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart b/lib/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart index 66b694339..6ab5c673d 100644 --- a/lib/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart +++ b/lib/view_model/after_auth_view_models/event_view_models/create_event_view_model.dart @@ -228,9 +228,8 @@ class CreateEventViewModel extends BaseModel { 'startTime': isAllDay ? null : '${DateFormat('HH:mm:ss').format(startTime)}', - 'endTime': isAllDay - ? null - : '${DateFormat('HH:mm:ss').format(endTime)}', + 'endTime': + isAllDay ? null : '${DateFormat('HH:mm:ss').format(endTime)}', }, if (isRecurring) 'recurrenceRuleData': {