v1.2.0
pwa_info
PWA INFO PACKAGE
2Likes 8530-day downloads150Pub points
AndroidiOSWebmacOSWindowsLinux
edris-mazhari/pwa_info open-source repository details.
English project snapshot. Visit GitHub for the latest content.
A Flutter package for detecting device and browser information in Progressive Web Apps (PWAs).
Add pwa_info to your pubspec.yaml:
dependencies:
pwa_info: ^1.2.0
Then run:
flutter pub get
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);
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 |
See the example directory for a complete Flutter web app.
This project is licensed under the BSD 3-Clause License — see the LICENSE file for details.
Dependency list 4 items
{"sdk":"flutter"}^2.3.0{"sdk":"flutter"}^6.0.0Start with your use case, compare repository activity, and check the original project before adopting it.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗