パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.3.0

url_strategy

1行のコードでWebアプリのURL戦略を設定できるFlutterパッケージ。

AndroidiOSLinuxmacOSWebWindows
30日間ダウンロード
10.8万
いいね数
554
Pub ポイント
160

パッケージをインストール

flutter pub add url_strategy

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

url_strategy パッケージは、1行のコードで URL 戦略を設定することで、Flutter Web アプリケーションがクリーンで読みやすい URL を使用できるようにします。開発者がハッシュベースのルーティング(例:/#/home)とパスベースのルーティング(例:/home)の間で切り替えられるようになり、SEO とユーザー体験が向上します。このパッケージは軽量であり、Flutter Web 専用に設計されており、追加の設定なしにスムーズな統合を実現します。Web、Android、iOS、Linux、macOS、Windows など、すべての主要プラットフォームをサポートしています。

用途

  • Flutter Web アプリでクリーンな URL を有効にする
  • WebベースのFlutterアプリケーションのSEOを向上させる
  • Web専用のFlutterプロジェクトにおけるナビゲーションの簡素化
  • Web アプリにおけるディープリンクのサポート
  • 複数プラットフォーム間でのルーティングの一貫性を維持する

主な機能

  • 単一行のURL戦略のセットアップ
  • ハッシュおよびパスベースのルーティングの両方をサポートしています
  • 軽量でオーバーヘッドが最小限
  • クロスプラットフォーム互換性
  • 既存のFlutter Webプロジェクトへの簡単な統合

適している対象

  • Flutter開発者がウェブアプリを構築しています
  • SEOフレンドリーなURLを必要とするプロジェクト
  • ディープリンクまたは共有リンクを使用するアプリ
  • 明確なURL構造を重視するチーム
  • Webデプロイをターゲットにする開発者

注意事項

  • Webデプロイメントにのみ関連する
  • パスベースのルーティングには適切なサーバー設定が必要です
  • モバイル専用のFlutterアプリには不要です
  • 本番ホスティングには、バックエンドの調整が必要になる場合があります
  • Webコンテキスト以外では利用価値が限られる

元の README

関連するソースリポジトリの 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.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。