Step 1 – Preheat oven to 220C. Place spinach in a bowl, pour over boiling water and stand for 1 minute or until spinach has wilted. Drain, then refresh under cold water. Squeeze dry and chop finely.
Step 2 – Place chicken in a large bowl and season with salt and pepper. Add garlic, rosemary and 2 tablespoons oil, and combine.
Step 3 – Heat a 26cm ovenproof or regular frying pan over high heat. Cook chicken, in 2 batches, for 1 minute each side or until browned. Transfer to a bowl and reserve pan if using an ovenproof one.
Step 4 – Brush reserved pan or a 26cm springform cake pan with 1 tablespoon oil. Working quickly, fold 6 sheets of filo pastry in half, then arrange in the pan so they overlap, covering the base and extending 2cm beyond the rim. Drizzle with the remaining 1 tablespoon oil. Cut the remaining sheet of filo pastry into shreds and scatter over the base (this helps to keep the base dry). Add the chicken, reserving juices in the bowl.
Step 5 – Add lemon zest to chicken juices, then add eggs and flour. Whisk to combine. Pour over chicken. Scatter with spinach and ricotta. Scrunch overhanging pastry to form a rim.
Step 6 – If using an ovenproof pan, place over medium heat and cook for 3 minutes, then transfer to oven and bake on the lowest shelf for 20 minutes or until pastry is golden and the filling has set. If using a cake pan, bake for 20 minutes on a heavy-based oven tray. Serve straight from the pan.