Search packages, repositories and app categories

Package detailsv2.1.0

fk_user_agent

Retrieve Android/iOS device user agents in Flutter.

AndroidiOS
30-day downloads
26K
Likes
44
Pub points
140

Install package

flutter pub add fk_user_agent

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

fk_user_agent is a Flutter package that enables retrieval of device-specific user agents for Android and iOS platforms. It provides a simple API to access the system-generated user agent strings used by the device's web view or HTTP client, which can be useful for server-side identification or debugging. The package integrates seamlessly into Flutter apps and supports both major mobile platforms. It is lightweight and designed for developers who need accurate device information without complex configuration.

Use cases

  • Server-side device identification
  • Debugging HTTP requests
  • API compatibility testing
  • User agent logging
  • Mobile app analytics

Key features

  • Platform-specific user agent retrieval
  • Support for Android and iOS
  • Simple and lightweight API
  • No external dependencies
  • Easy integration with Flutter

Suitable for

  • Developers needing device info in HTTP headers
  • Apps requiring user agent consistency
  • Testing and debugging network calls
  • Cross-platform mobile apps

Considerations

  • Limited to Android and iOS
  • Does not modify or generate user agents
  • Relies on platform-native implementation
  • Not suitable for web or desktop platforms

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

fk_user_agent

Pub Awesome Flutter Awesome Flutter License

Retrieve Android/iOS device user agents in Flutter.

Example user-agents:
System User-Agent WebView User-Agent
iOS CFNetwork/897.15 Darwin/17.5.0 (iPhone/6s iOS/11.3) Mozilla/5.0 (iPhone; CPU iPhone OS 11_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E217
Android Dalvik/2.1.0 (Linux; U; Android 5.1.1; Android SDK built for x86 Build/LMY48X) Mozilla/5.0 (Linux; Android 5.1.1; Android SDK built for x86 Build/LMY48X) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/39.0.0.0 Mobile Safari/537.36
Additionally:

Every version returns some additional constants that might be useful for custom user-agent building.

iOS version returns:

  • isEmulator
  • systemName
  • systemVersion
  • applicationName
  • applicationVersion
  • buildNumber
  • darwinVersion
  • cfnetworkVersion
  • deviceName
  • packageUserAgent

Android version returns:

  • systemName
  • systemVersion
  • packageName
  • shortPackageName
  • applicationName
  • applicationVersion
  • applicationBuildNumber
  • packageUserAgent
Credits 👍

Based of https://github.com/j0j00/flutter_user_agent

Categories

Source repository

Projects using this package