Completion constructor

Completion({
  1. required List<String> values,
  2. int? total,
  3. bool? hasMore,
  4. Meta? meta,
})

Implementation

factory Completion({
  required List<String> values,
  int? total,
  bool? hasMore,
  Meta? meta,
}) {
  assert(
    values.length <= 100,
    'no more than 100 completion values should be given',
  );
  return Completion.fromMap({
    'values': values,
    if (total != null) 'total': total,
    if (hasMore != null) 'hasMore': hasMore,
  });
}