Skip to main content

editEvent method

Future<void> editEvent ({required String eventId, required Map<String, dynamic> variables})

This function is used to edit an event.

params:

  • eventId: id of an event
  • variables: this will be map type and contain all the event details need to be update.

returns:

  • Future<void>: void return

Implementation

Future<void> editEvent({
required String eventId,
required Map<String, dynamic> variables,
}) async {
navigationService.pushDialog(
const CustomProgressDialog(
key: Key('EditEventProgress'),
),
);
final tokenResult = await _dbFunctions
.refreshAccessToken(userConfig.currentUser.refreshToken!);
debugPrint(tokenResult.toString());
final result = await _dbFunctions.gqlAuthMutation(
EventQueries().updateEvent(eventId: eventId),
variables: variables,
);
navigationService.pop();
if (result != null) {
navigationService.removeAllAndPush(
Routes.exploreEventsScreen,
Routes.mainScreen,
arguments: MainScreenArgs(mainScreenIndex: 0, fromSignUp: false),
);
}
}