create method

Future<T> create(
  1. T entity
)

Creates a new entity.

Parameters:

  • entity: The entity to create.

Returns:

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

Implementation

Future<T> create(T entity) async {
  return dio
      .post(
        "/create",
        data: entity.toJSON(),
      )
      .then(
        (response) => response.body<T>(),
      );
}