I would like to change application language every time that someone decide to change application language without restarting app. Everything is working using BLoC.
The problem I have I don't really understand one thing. If I pass to MaterialApp
property title
TodosLocalizations.of(context).translate("appTitle")
it throws an error:
The method 'translate' was called on null.
Receiver: null
Tried calling: translate("appTitle")
But when I comment this line and pass the same thing to onGenerateTitle
property using context
everything is working without problem.
Can someone answer me why this happening or I might don't understand how to use this property (title) in this case.