3

I am new in flutter web development and I need little help from you people. I am building an app in flutter web and in the domain of that app I want to add the prefix for example:

(shop.)localhost.com

or

(user123341.)localhost.com.

If you people have any small information about this please share your information. It will really appreciated.

Muhammad Ibrahim
  • 511
  • 1
  • 3
  • 13

1 Answers1

3

Yes it is completely possible to upload a Flutter Web App to a subdomain as Flutter compiles to Javascript and HTML. You can upload it to any subdomain you wish. But in your case you want to do that using localhost.

You need to understand that localhost is not purely a domain and you can't add a subdomain to it. But there are some workarounds to do that:

Based on this answer, you can try adding subdomains to the localhost as illustrated below.

 C:\Windows\System32\drivers\etc\hosts

And append lines like the following to it:

127.0.0.1    example.com
127.0.0.1    subdomain.example.com
Christopher Moore
  • 15,626
  • 10
  • 42
  • 52
Shubhamhackz
  • 7,333
  • 7
  • 50
  • 71