Preheat the oven to 350°F (175°C) and prepare a 9x13 inch baking pan by greasing it with butter and dusting it with flour.
In a medium bowl, whisk together the all-purpose flour, baking powder, and salt until evenly blended. Set aside.
In a larger mixing bowl, combine the granulated sugar and eggs. Beat with an electric mixer on medium speed for about 5-7 minutes until thick, pale, and fluffy.
Add the whole milk and vanilla extract to the egg mixture, mixing gently on low speed. Gradually fold in the dry ingredients until just incorporated.
Pour the batter into the prepared baking pan and spread it out. Bake for 25-30 minutes, or until a toothpick inserted comes out clean. Allow to cool in the pan for 15 minutes, then turn out onto a wire rack to cool completely.
While the cake is cooling, combine the sweetened condensed milk, evaporated milk, and coconut milk in a mixing bowl. Whisk until blended.
Once the cake has cooled, poke holes all over the surface with a fork or toothpick. Slowly pour the milk mixture over the cake, ensuring it seeps into the holes.
In a clean mixing bowl, whip the heavy cream with the powdered sugar using an electric mixer on high speed until stiff peaks form.
Spread the whipped cream over the top of the cake. Garnish with drained crushed pineapple and sprinkle with toasted coconut flakes.
Cover the cake with plastic wrap and refrigerate for at least 2 hours, or overnight for best flavor.
Notes
For best flavor, refrigerate overnight before serving.
Keyword cake, coconut, dessert, pineapple, tres leches