How to create "Dynamic Collections"

I need to create "Dynamic Collections" in Firebase but I haven't been able to do it, can you give me any tips on what is right for me or if it is a Fluterflow restriction?

I am creating an action with the following code:

// DO NOT REMOVE OR MODIFY THE CODE ABOVE!

Future crearNuevaColeccion(String nombreArchivo) async { FirebaseFirestore firestore = FirebaseFirestore.instance;

DocumentReference documentReference = await firestore.collection(nombreArchivo).add({
'Valor': 'ejemplo',
'Fecha': DateTime.now(),
'Tipo': 1,
'Seleccionado': false,
});

print('Nuevo documento creado con ID: ${documentReference.id}');
}

void main() async { String nombreArchivo = "test1"; await crearNuevaColeccion(nombreArchivo);
}

I have no syntax errors, no missing libraries but the new file is not created.

Thanks for your help and your time.