Maybe awaiting before writing again could solve the problem, also changing the mode to append so it continues writing at the end of the file
await f.writeAsString(drinkCsv);
await f.writeAsString(alcoholCsv, mode: FileMode.append);
the best solution I can come up is combining the 2 lists before doing the convert (I haven't used that ListToCsvConverter().convert() so I'm not sure how does the string result looks like)
String fileCsv = const ListToCsvConverter().convert([...rows, ...alcoholRows]);
await f.writeAsString(fileCsv);
That way maybe the converter do the correct append between the rows when converting to string
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…