Future<void> ensureWrite(String content) async { if (!await exists()) { await create(recursive: true); } await writeAsString(content); }