Enable path-based URL routing for clean share links
This commit is contained in:
@@ -18,6 +18,7 @@ import 'injection.dart';
|
|||||||
|
|
||||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||||
import 'package:web/web.dart' as web;
|
import 'package:web/web.dart' as web;
|
||||||
|
import 'package:flutter_web_plugins/url_strategy.dart';
|
||||||
|
|
||||||
final GoRouter _router = GoRouter(
|
final GoRouter _router = GoRouter(
|
||||||
initialLocation: kIsWeb
|
initialLocation: kIsWeb
|
||||||
@@ -58,6 +59,9 @@ final GoRouter _router = GoRouter(
|
|||||||
);
|
);
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
if (kIsWeb) {
|
||||||
|
setUrlStrategy(PathUrlStrategy());
|
||||||
|
}
|
||||||
runApp(const MainApp());
|
runApp(const MainApp());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user