getOne method

Future<T?> getOne({
  1. Dio? dioTestClient,
  2. bool? online,
})

Implementation

Future<T?> getOne({Dio? dioTestClient, bool? online}) async {
  if (online == true) {
    return (await this.fetchOnline(dioTestClient: dioTestClient))[0];
  }

  List<T> results = await this.get();

  return results.length > 0 ? results[0] : null;
}