FLUTTER ECOSYSTEM

simpleclub/url_strategy

適用於 Flutter 應用的套件,僅需一行程式碼即可設定 Web URL 策略。

url_strategy 專案封面
Stars
84
Forks
7
最近推送(UTC)
2024年11月4日
專案狀態
已封存
simpleclub GitHub avatar
GITHUB Organization

simpleclub ↗

Germany's #1 learning app with 2M+ users. High-quality educational content, powered by state-of-the-art technology.

語言DartHTML

技術主題

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

url_strategy Pub version

⚠️ Discontinued: The functionality is now provided by the flutter SDK out of the box:

https://docs.flutter.dev/ui/navigation/url-strategies

Package for Flutter apps that allows setting the web URL strategy with a single line of code.

Usage

With a simple call of setPathUrlStrategy, your Flutter web app does not have a leading # in the URL anymore 🚀

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());
}

See the url_strategy package README or the explanation on StackOverflow for more detailed usage documentation.

Implementation

The package is basically a wrapper around the flutter_web_plugins setUrlStrategy. The reason it exists is that using the function from flutter_web_plugins requires conditional imports.
The problem is solved by using a conditional export from the url_strategy package.