Preheat oven to 375 degrees F. Use the convection setting if available. Spray 2 quart casserole with cooking spray.
Cook on the stovetop on medium-low until they get soft about 20 minutes. (you can skip this step if you like the onions more firm.) Layer the onions in the bottom of the casserole. Sprinkle with 3 tablespoons of flour, salt, and pepper.
Pour heavy cream over the onions in the dish.
Combine crushed crackers and butter and toss to coat. Sprinkle evenly over the onions.