with3<TItem extends AFID> static method

TItem with3<TItem extends AFID>({
  1. required AFLibraryID? library,
  2. required String codeId,
  3. required TItem creator(
    1. String,
    2. AFLibraryID,
    3. List<Object>
    ),
  4. required Object? first,
  5. Object? second,
  6. Object? third,
})

Implementation

static TItem with3<TItem extends AFID>({
  required AFLibraryID? library,
  required String codeId,
  required TItem Function(String, AFLibraryID, List<Object>) creator,
  required Object? first,
  Object? second,
  Object? third,
}) {
  final key = StringBuffer(codeId);
  final items = <Object>[];
  if(first != null) {
    key.write("_$first");
    items.add(first);
  }

  if(second != null) {
    key.write("_$second");
    items.add(second);
  }
  if(third != null) {
    key.write("_$third");
    items.add(third);
  }
  final lib = library;
  if(lib == null) throwLibNotNull();
  return creator(key.toString(), lib, items);
}