getById method

Future<T> getById(
  1. num id
)

Retrieves an entity by its ID.

Parameters:

  • id: The ID of the entity to retrieve.

Returns:

  • A Future that resolves to the entity of type T.

Implementation

Future<T> getById(num id) async {
  return dio.post(
    "/get",
    data: {
      "id": id,
    },
  ).then(
    (response) => response.body<T>(),
  );
}