dynamic_path_url_strategy 1.0.0 copy "dynamic_path_url_strategy: ^1.0.0" to clipboard
dynamic_path_url_strategy: ^1.0.0 copied to clipboard

A Flutter package that provides a clean way to handle URL strategy for web applications, removing the '#' from URLs while maintaining compatibility with non-web platforms

example/lib/main.dart

import 'package:dynamic_path_url_strategy/dynamic_path_url_strategy.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'URL Strategy Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('URL Strategy Demo'),
      ),
      body: const Center(
        child: Text(
          'Check your URL - no "#" on web platform!\nIt doesn\'t throw an error when building non-web platforms',
        ),
      ),
    );
  }
}
3
likes
150
points
1.55k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package that provides a clean way to handle URL strategy for web applications, removing the '#' from URLs while maintaining compatibility with non-web platforms

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_web_plugins

More

Packages that depend on dynamic_path_url_strategy