dynamic_path_url_strategy 1.0.0
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
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',
),
),
);
}
}