Given how many people are using it as an argument, Law was not weaker than Doflamingo. Law was significantly nerfed against Doflamingo. He fought Doflamingo twice. The first time, he was doubled teamed by Doflamingo and Fujitora, an Admiral, which many of believe is equal to a Yonko, who crushed him into the ground. Law spent the whole fight trying to get Ceasar, his win condition, out of there, and used a lot of stamina to do so.
The second time, not long after the first, he had to fight Doflamingo and Trebol at the same time, and still left the fight fully conscious and left Doflamingo’s organs resting at the bottom of his chest cavity, which should have been his win if not for the “Stitch my organs back together” trick Doflamingo pulled.
Law fought against terrible odds and still left Doflamingo in terrible shape, the terrible shape you can’t tell me didn’t affect his performance against Luffy right afterwards. This was around two months before the raid, after which we don’t know what Law was doing to prepare for his fight against Kaido but it sure as hell wasn’t sitting with his thumb up with ass. This whole argument that “Law lost to a Tobi Roppo level opponent badly to fighting a Yonko” is built on bad information and is ignoring that fights in One Piece aren’t power level contests. Outside factors matter, stop ignoring them.
Law’s fighting style is not the same as Luffy. He likely has weaker physical and Armament Haki power than Luffy. His techniques are just better equipped to hurt tough characters that Luffy can’t with brunt force due to his overpowered devil fruit so all Law needed to do was work on his devil fruit and stamina and he’d already have massive gains. He doesn’t need a Katakuri level fight or something like that. He had a month to train up his devil fruit and stamina, you know how much it took Luffy to come up with Gear 2? At the longest half a day (you can argue he made Gear 3 after Aokiji but CP9 heavily helped create Gear 2). Devil Fruit abilities aren’t something that takes a long time to learn once you’ve had it for a long time. Like you being good at a fighting game getting beat and then going to the lab and learning new combos. All Law did was get creative with the month he had.
So yeah Law is now stronger than Doflamingo even without Awakening but that is due to having a superior arsenal and more stamina to use it. Like imagine if Law could spam his devil fruit in Dressrosa like he does in Wano? Imagine he could use more than Gamma Knife to pierce Doflamingo? See the difference?