Skip to content
pubscout

dynamic_path_url_strategy

1.0.0, released 2 years ago by an unverified publisher

Removes the hash '#' from web URLs while safely supporting non-web platforms.

WASM-ready
$ flutter pub add dynamic_path_url_strategy
Source repository

What it does

Provides a function to configure the URL strategy for Flutter web applications to use clean paths instead of hash-based URLs. It safely acts as a no-op on non-web platforms to maintain cross-platform compatibility.

AI-written summary of version 1.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are building a Flutter web application and want clean URLs without the '#' character
  • You need a cross-platform codebase where URL strategy configuration does not break mobile or desktop builds

Skip it when

  • Your web server cannot be configured to handle client-side routing and clean paths
  • You are not targeting the web platform

Strengths

  • Simplifies URL strategy configuration for Flutter web
  • Platform-safe implementation using conditional imports
  • Zero configuration needed for non-web platforms

Weaknesses

  • Requires proper server-side configuration to support deep linking with clean paths on the web
  • Limited feature set restricted solely to URL strategy configuration

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0

Call setPathUrlStrategy() in your main function before runApp().

import 'package:dynamic_path_url_strategy/dynamic_path_url_strategy.dart';

void main() {
  setPathUrlStrategy();
  runApp(MyApp());
}