How to get host name in flutter for windows?

Viewed 1128

I am working on a flutter application that connects to the MQTT client on the desktop it is opened on. I want to dynamically get the host name of the desktop and connect to it instead of the user having to enter it manually. Thanks in advance.

2 Answers

Solution for Flutter Web

import 'dart:html' as html;

final hostname = html.window.location.hostname;
Related