Flutter how to add the gradient color on appBar


Flutter : How to add the gradient color on appBar?


Basically for appBar we are use the Scaffold widget then use the appApp and under it for the change the appBar color has only backgroundColor option but for adding the gradient color using the flexibleSpace and then use the Container widget and add the gradient color. As follow in Picture

            How to add the gradient color on appBar?


In this picture, I'm separate the gradient color with name gradientColor1 and gradientColor2 on another AppConstant class.
You just use the Color(0xFF5048A0) like that instead of  Color(AppConstant.gradientColor1).



Thank you for reading.




Comments

Post a Comment