getFields method

List<SupasetFilterEntity> getFields(
  1. BuildContext context,
  2. List<SupasetFilterEntity> originalFields,
  3. List<SupabaseActionFieldEntity> newFields,
  4. int loop,
)

Implementation

List<SupasetFilterEntity> getFields(
  BuildContext context,
  List<SupasetFilterEntity> originalFields,
  List<SupabaseActionFieldEntity> newFields,
  int loop,
) {
  return originalFields.map((e) {
    final index = newFields.indexWhere((element) => element.id == e.id);
    if (index == -1) return e;
    return e.copyWith(
      value: newFields[index].value.get(
            context: context,
            loop: loop,
          ),
    );
  }).toList();
}