Lesson SDK Manager
init
Please refer to #set-up-lessonsdkmanager
isConnected
This isConnected property is a stream to let you know whether the gofa_lessons can establish a connection with our Firebase project successfully.
The initial value of this property is "null". And it will return boolean when we have decided the connection works or not.
StreamBuilder(
stream: GetIt.I<LessonSdkManager>().isConnected,
builder: (context, snapshot) {
if (snapshot.hasData) {
log.d('isConnected snapshot.data: ${snapshot.data}');
if (snapshot.data as bool) {
return const Text('Connected to GOFA Firebase');
} else {
return const Text(
'Cannot be connected to GOFA Firebase');
}
}
return const Text('Still connecting to GOFA Firebase');
},
);