Firstly, this, though similiar in Question, is not what I need as the Answer does not help me in my case.
I have my AppConfig decide the fontsize, based on device, so that very big devices, such as Tablets, get bigger Texts (by a bit). My config gets called before any Views, so I have no BuildContext while this is running. So how can I do this?
class AppConfig {
static AppConfig _instance;
static AppConfig instance() {
if (_instance == null) {
_instance = AppConfig();
}
return _instance;
}
// config stuff for colours and themes
double width = MediaQuery.of(context).size.width;
if (width > 500) { //arbitrary number I haven't decided yet
initWithBigFonts();
} else {
initWithSmallFonts();
}
WidgetsBinding.instance.window
?