blackmenthor / flutter_localization_sample

0 stars 4 forks source link

The instance member 'context' can't be accessed in an initializer. Try replacing the reference to the instance member with a different expression #2

Open do4Mother opened 4 years ago

do4Mother commented 4 years ago

hi mas angga, i have a problem to define text localization in my projects. i want to define Strings.of(context) inside List at initialization. for example

List<Widget> listOfText = [
Text(Strings.of(context))
]

and i see error The instance member 'context' can't be accessed in an initializer. Try replacing the reference to the instance member with a different expression in my project. how to solve it ?

thank you