When I am using Text widget, there are two ways from which I can change style of widget
- Passing
TextStyleto style permeter. - Passing
Theme.of(context).textTheme.titleLargeto style permeter.
when using first method I can use const keyword in front of Text widget and in second cannot. does using first method give me performance boost ?
I know using second method my code will be more organised. Which method should I use ?
Text("Select a City",style: Theme.of(context).textTheme.titleLarge,),
const Text("Select a City",style: TextStyle(fontSize: 22, color:Colors.grey)),
Thanks