File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class Position {
4747 course: (json['course' ] as num ? )? .toDouble () ?? 0.0 ,
4848 address: json['address' ] as String ? ,
4949 accuracy: (json['accuracy' ] as num ? )? .toDouble (),
50- batteryLevel: json['attributes' ]? ['batteryLevel' ] as int ? ,
50+ batteryLevel: ( json['attributes' ]? ['batteryLevel' ] as num ? ) ? . toInt () ,
5151 attributes: json['attributes' ] as Map <String , dynamic >? ,
5252 );
5353 }
Original file line number Diff line number Diff line change @@ -26,11 +26,13 @@ class SocketService {
2626 Future <bool > connect () async {
2727 if (_disposed || kIsWeb) return false ;
2828
29- final base = traccarBaseUrl;
30- if (base .isEmpty) return false ;
31-
32- final wsScheme = base .startsWith ('https' ) ? 'wss' : 'ws' ;
33- final wsUrl = '${base .replaceFirst (RegExp ('^https?' ), wsScheme )}/api/socket' ;
29+ var wsUrl = String .fromEnvironment ('WEBSOCKET_URL' );
30+ if (wsUrl.isEmpty) {
31+ final base = traccarBaseUrl;
32+ if (base .isEmpty) return false ;
33+ final wsScheme = base .startsWith ('https' ) ? 'wss' : 'ws' ;
34+ wsUrl = '${base .replaceFirst (RegExp ('^https?' ), wsScheme )}/api/socket' ;
35+ }
3436
3537 try {
3638 final cookie = await AuthService ().getCookie ();
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ name: manager
22description : " Wuizy"
33publish_to : ' none' # Remove this line if you wish to publish to pub.dev
44
5- version : 3.3.8 +1
5+ version : 3.3.12 +1
66
77environment :
88 sdk : ^3.9.2
You can’t perform that action at this time.
0 commit comments