Daniel-Ioannou / flutter_country_picker

A flutter package to select a country from a list of countries.
https://pub.dev/packages/country_picker
MIT License
120 stars 166 forks source link

How to force language ? #130

Closed stuartrapop closed 10 months ago

stuartrapop commented 10 months ago

I am able to see that the context has the appropriate language before calling the showCountryPicker function,

but within the CountryListView widget, I am no longer able to access the context.

I saw this by printing ${CountryLocalizations.of(context)?.countryName(countryCode: 'GB') before the call and receiving the correct value.

when I try printing this same value within the CountryListView widget , it prints a null value.

What am I doing wrong or is there an error ?

Thanks,

stuartrapop commented 10 months ago

I am having a strange issue which does not seem to be directly related to this package. I have nested MaterialApp widgets. The context within the CountyListView widget seems to be getting it's context from the top level MaterialApp widget and not the closer one. I will close this issue for now.