Commit ecbbb3c 1 parent f2ff311 commit ecbbb3c Copy full SHA for ecbbb3c
File tree 1 file changed +5
-4
lines changed
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> {
46
46
47
47
final String _key = '${UniqueKey ()}' ;
48
48
49
- late final BaseAPI ? _api;
49
+ late final BaseAPI _api;
50
50
51
51
/// Enables debug mode.
52
52
///
@@ -86,7 +86,8 @@ class ConnectionCubit extends Cubit<ConnectionState> {
86
86
/// Stream subscription for connectivity.
87
87
StreamSubscription <ConnectivityResult >? connectivitySubscription;
88
88
89
- BaseAPI get api => _api as BinaryAPI ;
89
+ /// Getter for [BaseAPI] implementation class.
90
+ BaseAPI get api => _api;
90
91
91
92
/// Reconnect to Websocket.
92
93
Future <void > reconnect ({
@@ -111,7 +112,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
111
112
emit (const ConnectionConnectingState ());
112
113
113
114
try {
114
- await _api! .disconnect ().timeout (_pingTimeout);
115
+ await _api.disconnect ().timeout (_pingTimeout);
115
116
} on Exception catch (e) {
116
117
dev.log ('$runtimeType disconnect exception: $e ' , error: e);
117
118
@@ -120,7 +121,7 @@ class ConnectionCubit extends Cubit<ConnectionState> {
120
121
return ;
121
122
}
122
123
123
- await _api! .connect (
124
+ await _api.connect (
124
125
_connectionInformation,
125
126
printResponse: enableDebug && printResponse,
126
127
onOpen: (String key) {
You can’t perform that action at this time.
0 commit comments