I am using this package plugin flutter_locales for app localization. So check the current language code by using this is the code.
LocaleNotifier.of(context)!.locale!.languageCode; Now problem is if i use this code inside in simple class which gives an error on "context".
class Service { var lang = LocaleNotifier.of(context)!.locale!.languageCode; // getting error on "context" } So how prevent this "context" error without BuildContext in Service class?