If the Flat File composer receives an empty class, it produces an empty line. You should prevent creating empty classes by using the exists() Operation.
So, for flat file composing you need to check if the flat file record contains data when building the flat file structure, e.g. by using the exists() Operation.