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

パッケージ詳細v1.2.0

pwa_info

PWA 情報パッケージ

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
85
いいね数
2
Pub ポイント
150

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

flutter pub add pwa_info

パッケージ概要

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

pwa_info パッケージは、複数のプラットフォームでプログレッシブウェブアプリ(PWA)環境に関する情報を検出および取得するためのユーティリティを提供します。開発者は、現在のアプリがPWAとして実行されているかどうかを確認し、マニフェストの詳細などPWA固有のメタデータにアクセスし、対応しているプラットフォームでのインストール状態を判断できます。これにより、アプリがブラウザから起動されたか、スタンドアロンのPWAとしてインストールされたかに基づいてユーザー体験を最適化できます。このパッケージはAndroid、iOS、Web、macOS、Windows、Linuxをサポートしており、PWA機能を強化したいクロスプラットフォームWebアプリに最適です。

用途

  • PWA インストール状態の検出
  • PWAマニフェストデータにアクセスする
  • PWA コンテキストに基づくUIのカスタマイズ
  • オフライン機能の有効化
  • クロスプラットフォーム PWA アプリのサポート
  • PWA機能によるユーザー参加度の向上

主な機能

  • クロスプラットフォーム互換性
  • マニフェストデータの取得
  • インストール状態の検出
  • シンプルなAPI統合
  • すべての主要プラットフォームをサポートしています
  • 軽量で効率的

適している対象

  • PWA を構築する開発者
  • PWA固有のロジックを必要とするアプリ
  • クロスプラットフォームWebアプリケーション
  • 複数のOS環境をターゲットにするプロジェクト
  • Webおよびモバイル用にFlutterを使用するチーム

注意事項

  • Webプラットフォームのサポートが必要です
  • PWA専用のチェックに限定
  • 実行時構成オプションなし
  • ブラウザのPWA APIに依存しています
  • ネイティブ専用アプリには適していません
  • すべての埋め込みWebViewシナリオで動作しない可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

pwa_info

A Flutter package for detecting device and browser information in Progressive Web Apps (PWAs).

pub package License

Features

  • OS detection — identify iOS, Android, or other platforms
  • Browser detection — detect Chrome, Safari, Firefox, Edge, Opera, Samsung Internet
  • Mobile check — determine if the device is mobile
  • PWA standalone mode — check if running as a standalone PWA
  • User agent — access the raw user agent string

Installation

Add pwa_info to your pubspec.yaml:

dependencies:
  pwa_info: ^1.2.0

Then run:

flutter pub get

Usage

import 'package:pwa_info/pwa_info.dart';

final info = PwaInfo();

// Operating system
print(info.os); // DeviceOS.ios, DeviceOS.android, or DeviceOS.other

// Browser
print(info.browser); // BrowserName.chrome, BrowserName.safari, etc.

// User agent string
print(info.userAgent); // "Mozilla/5.0 (iPhone; CPU iPhone OS ..."

// Mobile check
print(info.isMobile); // true or false

// PWA standalone check
print(info.isStandalone); // true if running in standalone mode

// Get everything at once
final result = info.all;
print(result);

API

PwaInfo
Member Type Description
os DeviceOS Detected operating system
browser BrowserName Detected browser
userAgent String Raw user agent string (lowercased)
isWeb bool Whether running on web (kIsWeb)
isMobile bool Whether the device is mobile
isStandalone bool Whether running in PWA standalone mode
all PwaInfoResult All properties as a single object
DeviceOS
Value Description
ios iPhone or iPad
android Android device
other Desktop or unknown
BrowserName
Value Description
chrome Google Chrome
safari Apple Safari
firefox Mozilla Firefox
edge Microsoft Edge
opera Opera
samsungInternet Samsung Internet Browser
unknown Unrecognized browser

Example

See the example directory for a complete Flutter web app.

License

This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

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

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