Cut the boneless chicken thighs into bite-sized pieces and season with salt and pepper. Slice the white and pale part of the leeks and run them under water to remove grit. Dry and set aside.
Heat a large pan with 1 tablespoon of olive oil and cook the chicken sprinkled with chopped rosemary for about 7-10 minutes over medium heat, remove to a plate until later.
To the same pan add the sliced leeks and cook them over low heat for 5 minutes, then add the minced garlic and cook for 30 seconds longer. Bring the chicken back to the pan and stir with the leeks, then sprinkle the flour all over and stir to combine.
Deglaze the pan with the white wine while scraping down the bottom of the pan and allow the wine to reduce, which will take no longer than a minute, then add in the chicken stock, bring the mixture to a simmer and simmer over low heat for 20 minutes. Taste and add salt if needed. Take off the heat and cool until room temperature. Then mix in the creme fraiche.
Preheat the oven to 200C/400F.
Tip the chicken and leek filling into a rectangular 9x13 inch oven proof dish. If you are not using a pre-rolled puff pastry, roll it out on a flour dusted surface to fit the shape of the pie dish you are using.
Brush the top of all four sides of the dish with a beaten egg and lay the puff pastry sheet directly on top. Either tuck the edges of the pastry in or press against the brushed with egg casserole dish sides.
Finally, brush the top of the puff pastry with the beaten egg and cut slits in.
If you have any leftover pastry, you can cut decorative leaves out of the pastry scraps and place on top of the pie, then brush them with the egg wash again.
Bake for 40-45 minutes or until puffed up and golden. Let it sit for 20 minutes before serving.