Every time this class is instantiated, I wish a call to be made to firebase and the _datapoint given the retrieved value. Otherwise, I have to assign the datapoint in each function in the class (see functionOneExample), and that's just prone to errors. Note: I cannot use initstate as this function is not a widget (I do not need or want a build method). If I could, I would call _getThis in the initstate. Thanks for your help!!
class AsyncInitExample {
AsyncInitExample(this.enterThis);
String enterThis;
String _datapoint;
_getThis() async {
var firebaseRetrieved = await //Firebase get this;
this._datapoint = firebaseRetrieved;
}
Future<dynamic> functionOneExample {
this._datapoint ?? await _getThis();
}
// etc. etc. etc.
}