watch static method
- BuildContext context
A wrapper around context.watch, it should be used instead of it.
Performs a context.watch<ApiBase>() to get ApiBase from the context,
set the current context of the ApiBase to context then return the ApiBase
Implementation
static ApiBase watch(BuildContext context) {
final ApiBase apiBase = context.watch<ApiBase>();
apiBase._currentBuildContext = context;
apiBase._defaultHeaders ??= {};
apiBase._defaultHeaders!["Accept-Language"] =
context.read<LanguageProvider>().locale?.languageCode ?? "fr";
return apiBase;
}