getAll method Null safety

Future<PaggedResponseMessage<PlanModel>> getAll(
  1. {String customApiToken = '',
  2. String filter = "?limit=1000"}
)

Implementation

Future<PaggedResponseMessage<PlanModel>> getAll({
  String customApiToken = '',
  String filter = "?limit=1000",
}) async {
  //  var queryStringFilter = filter?.ToQueryStringUrl();
  var retorno = await apiResource.getById(partOfUrl: filter, apiUserToken: customApiToken);

  return PaggedResponseMessage<PlanModel>(
    totalItems: retorno["totalItems"],
    items: (retorno["items"] as List).map((e) => PlanModel.fromMap(e)).toList(),
  );
}