Spoiler
But its an artificial flower. Her sudden flip is an unjustified action done solely to further plot. It isn't a consequence of her story, of her choices but a decision of the writers to shock the audience. These seeds might have been there, but barely, Dany is flawed, she has made mistakes, she has been ruthless, but she is a leader and leaders have to be ruthless at times to maintain their control. She executed her enemies, but the majority of these executions were retaliatory. For six seasons she was built to be a champion of the people, the breaker of chains. The potential to have her slowly fall from grace gradually, perhaps beginning with the death of Barristan Selmy, Jorah's betrayal, the masters reneging on Tyrion's deal, the loss of the Dornish, the Ironborn and the Tyrells. After her attack on the Lannister Army, she could have simply burned all of the survivors alive, without offering them the option to bend the knee. This would be the first real indication of her descent, that for the first time she doesn't offer mercy because her enemies don't offer any to her.
But Dany is still mostly intact, she meets Jon, and eventually agrees to help him fight the Night King. She loses Viserion beyond the wall, her child, and another support breaks in her mind, but she strives on because its the right thing to do, and now she has a reason to want to kill the night king.
At the battle of Winterfell, her growing madness could be reflected as she becomes reckless in her pursuit of the Night King for revenge, she acts irresponsibly and perhaps loses another dragon, or contributes to the death of Jorah, after which she blames herself. If you couple this with the devestation to her troops during the battle, and the cost of victory, she continues to steadily decline. After the battle, she begins to feel more and more isolated, the praise going to Jon Snow and Arya for the death of the Night King, whilst her circle has grown smaller. She slowly begins to withdraw. But Jon assures her that once they have rested, they will march on King's Landing and remove Cersei. Dany grows more impatient, and if they have to go the silly may of Euron nuking Rhaegal, and the murder of Missandei, this only adds to her madness. She wants to attack immediately, and becomes more and more frustrated. Varys is aware of this, especially ever since Winterfell, he talks to Tyrion about her murder of captured Lannister soldiers, her recklessness at Winterfell which led to Jorah's death, her wish to quickly go after Cersei which cost Rhaegal and Missandei their lives. Varys is concerned because he cares about Dany, he believed in her at one point, but he has served enough rulers to know when they are beginning to become corrupted. Tyrion has concern, but he still believes in her. Varys doesn't try to poison her, he tries to reason with her, but she doesn't want to hear it. Varys then tells her that he can no longer be a part of her quest, and where Missandei once said Dany would give her a boat and wish her good luck if she asked to leave, Varys is taken and thrown into a cell.
This whole time, Jon has kept the knowledge of his true parentage to himself, but he has become more distant with Dany, refusing intimacy, and this plays into her paranoia. She feels rejected, the man she loves is pushing her away and it only gets worse. As the armies march on Kings Landing, Dany doesn't want to wait, and attacks, destroying the fleet, and then the scorpions on the walls. She then heads for the Red Keep, destroying it completely, but unbeknownst to her, Wildfire has been placed all over the city by Qyburn at Cersei's request. She destroys the Red Keep but inadvertantly sets off the wildfire, and the results are devestating, destroying most of the city, especially where most of the civilians are hiding behind the walls of the Red Keep. By the time Jon and the others arrive, they see nothing but devestation. Realising what she has done, Dany breaks completely
This should have been done over three full seasons, Dany's descent and the corruption of her spirit could have paralleled the redemption of Jamie