editEvent method
Future<void> editEvent ({required String eventId, required Map<String, dynamic> variables})
<p>This function is used to edit an event.</p> <p><strong>params</strong>:</p> <ul> <li><code>eventId</code>: id of an event</li> <li><code>variables</code>: this will be <code>map</code> type and contain all the event details need to be update.</li> </ul> <p><strong>returns</strong>:</p> <ul> <li><code>Future<void></code>: void return</li> </ul>
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),
);
\}
\}