Preheat oven to 350°F (175°C).
In a bowl, combine flour, melted butter, and pecans. Press into a baking dish.
Bake for 15 minutes, then let cool completely.
In a mixing bowl, beat cream cheese and powdered sugar until smooth. Fold in half of the whipped topping. Spread over the cooled crust.
Prepare both pudding mixes with cold milk according to package instructions. Spread over the cream cheese layer.
Top with remaining whipped topping and sprinkle with chocolate shavings if desired.
Chill for at least 2 hours before serving.