搜索插件、代码仓与 APP 分类

GitHub 代码仓edris-mazhari/pwa_info

pwa_info

edris-mazhari/pwa_info open-source repository details.

pwa_info 项目封面
星标
0
复刻
0
最近推送(UTC)
2026年6月4日
项目状态
未归档

原始 README

以下为英文项目原文快照,最新内容请访问 GitHub。

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.

Edris Mazhari GitHub avatar
GitHub 作者

Edris Mazhari ↗

语言DartHTML

此仓库发布的插件

使用的依赖

依赖清单 4 项

如何选择适合项目的代码仓?

先按使用场景筛选,再比较项目活跃情况,最后到原始仓库核对使用要求。

  1. 通过仓库名、作者或描述搜索,再按技术分类缩小范围。
  2. 结合星标、复刻与最近推送比较项目;星标反映社区关注,不代表质量保证。
  3. 使用前在 GitHub 核对 README、许可证与 Issues。

来源与维护

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗