3

As the time am asking this question, is there any official or an update that enables me to remove the # symbol in the flutter web app url.

I have seen some work arounds to achieve this but they end up causing other issues like: people not able to access the webpage without the hash # in the url

Norbert
  • 6,874
  • 14
  • 40
  • 65
  • Work in progress [Flutter_web navigation should provide a way to customize url strategy](https://github.com/flutter/flutter/issues/33245) – Spatz Sep 10 '20 at 18:52

1 Answers1

2

From this answer

There is a package call url_strategy in pub.dev. You only need to import in into pubspec.yaml and copy the code below into your main.dart file. It will remove the # in your flutter web URL

import 'package:url_strategy/url_strategy.dart';

void main() {
  // Here we set the URL strategy for our web app.
  // It is safe to call this function when running on mobile or desktop as well.
  setPathUrlStrategy();
  runApp(MyApp());
}
Muhammad Adil
  • 4,358
  • 3
  • 32
  • 36
  • 1
    This does not work for me. I run into the issue of "people not able to access the webpage without the hash # in the url". Am I doing something wrong? – Martin Reindl Apr 23 '22 at 03:53