I want to use three functions at the same time asynchronously. I'm not sure that this is how I want it.
The only purpose of using inputPaymentData is that I want to use three different functions simultaneously, so I can get the result as fast as I can. I thought it would take more time if I don't use async and just use it synchronously way. Also, do I need to use await? I don't think I need to wait to get any data. Thanks.
void inputPaymentData(
{required String user,
required bool type,
required String merchantUid,
required String lessonUid,
required num amount,
required bool agree,
required String lesson,
required bool lessonCard,
required String? review,
required String coach}) async {
inputRecordData(
user: user,
type: type,
merchantUid: merchantUid,
lessonUid: lessonUid,
amount: amount);
inputReservationData(
user: user,
agree: agree,
lesson: lesson,
lessonCard: lessonCard,
review: review,
coach: coach);
increaseLessonNum(user);
}
void inputRecordData(
{required String user,
required bool type,
required String merchantUid,
required String lessonUid,
required num amount}) =>
paymentUseCase.inputRecordData(
user: user,
type: type,
merchantUid: merchantUid,
lessonUid: lessonUid,
amount: amount);
void inputReservationData(
{required String user,
required bool agree,
required String lesson,
required bool lessonCard,
required String? review,
required String coach}) =>
paymentUseCase.inputReservationData(
user: user,
agree: agree,
lesson: lesson,
lessonCard: lessonCard,
review: review,
coach: coach);
void increaseLessonNum(String user) =>
paymentUseCase.increaseLessonNum(user);