addStudent method

Future<int> addStudent(
  1. DateTime date,
  2. String gender,
  3. int session
)

Implementation

Future<int> addStudent(
  DateTime date,
  String gender,
  int session,
) async {
  final Either<String, Map<String, dynamic>> res = await mappingPostRequest(
    "/students",
    <String, dynamic>{
      "date": date.toIso8601String(),
      "gender": gender,
      "session": session,
    },
  ).run();

  return res.getOrElse((String l) => <String, dynamic>{})["id"];
}