MQTT for flutter web fails to connect

Below is my code for connecting HIVE broker from Flutter chrome web. In advance, I would like to note that it works for windows app with no issues. However, with browser, i get below error

broker.mqttdashboard.com
    at Object.throw_ [as throw] (http://localhost:54330/dart_sdk.js:5069:11)
    at mqttservice.MQQTTService.new.connectClientToBroker (http://localhost:54330/packages/baycontrolwindows/services/mqttservice.dart.lib.js:44:23)
    at connectClientToBroker.throw (<anonymous>)
    at http://localhost:54330/dart_sdk.js:40632:38
    at _RootZone.runBinary (http://localhost:54330/dart_sdk.js:40501:59)
    at _FutureListener.thenAwait.handleError (http://localhost:54330/dart_sdk.js:35435:33)
    at handleError (http://localhost:54330/dart_sdk.js:36001:51)
    at Function._propagateToListeners (http://localhost:54330/dart_sdk.js:36027:17)
    at _Future.new.[_completeError] (http://localhost:54330/dart_sdk.js:35864:23)
    at async._AsyncCallbackEntry.new.callback (http://localhost:54330/dart_sdk.js:35913:31)
    at Object._microtaskLoop (http://localhost:54330/dart_sdk.js:40764:13)
    at _startMicrotaskLoop (http://localhost:54330/dart_sdk.js:40770:13)
    at http://localhost:54330/dart_sdk.js:36247:9```