File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
4646
4747 final String _key = '${UniqueKey ()}' ;
4848
49- late final BaseAPI ? _api;
49+ late final BaseAPI _api;
5050
5151 /// Enables debug mode.
5252 ///
@@ -86,7 +86,8 @@ class ConnectionCubit extends Cubit<ConnectionState> {
8686 /// Stream subscription for connectivity.
8787 StreamSubscription <ConnectivityResult >? connectivitySubscription;
8888
89- BaseAPI get api => _api as BinaryAPI ;
89+ /// Getter for [BaseAPI] implementation class.
90+ BaseAPI get api => _api;
9091
9192 /// Reconnect to Websocket.
9293 Future <void > reconnect ({
@@ -111,7 +112,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
111112 emit (const ConnectionConnectingState ());
112113
113114 try {
114- await _api! .disconnect ().timeout (_pingTimeout);
115+ await _api.disconnect ().timeout (_pingTimeout);
115116 } on Exception catch (e) {
116117 dev.log ('$runtimeType disconnect exception: $e ' , error: e);
117118
@@ -120,7 +121,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
120121 return ;
121122 }
122123
123- await _api! .connect (
124+ await _api.connect (
124125 _connectionInformation,
125126 printResponse: enableDebug && printResponse,
126127 onOpen: (String key) {
You can’t perform that action at this time.
0 commit comments