onReady method
override
Called 1 frame after onInit(). It is the perfect place to enter navigation events, like snackbar, dialogs, or a new route, or async request.
Implementation
@override
void onReady() async {
try {
if (_auth.status.value.isSuccess) {
await _useChatDirectLink();
} else if (_auth.status.value.isEmpty) {
await _register();
if (_auth.status.value.isSuccess) {
await _useChatDirectLink();
}
}
SchedulerBinding.instance.addPostFrameCallback((_) => _ready.finish());
} catch (e) {
_ready.throwable = e;
_ready.finish(status: const SpanStatus.internalError());
rethrow;
}
super.onReady();
}