Package selection guidance compiled from public package information, community data, and project usage.
The ua_client_hints package enables Flutter applications to access User-Agent Client Hints, providing detailed browser and device information through standardized HTTP headers. It simplifies the process of retrieving client metadata such as platform, model, and brand on Android, iOS, Web, and macOS. This helps developers tailor content delivery based on user device characteristics without relying solely on string parsing of User-Agent strings. The package integrates seamlessly with HTTP clients and supports modern web standards for privacy-preserving device detection.
Use cases
Device-specific content rendering
Browser and OS detection
Optimized asset delivery
Privacy-conscious analytics
Cross-platform compatibility testing
Key features
Supports Android, iOS, Web, and macOS
Provides standardized client hints via HTTP headers
Reduces reliance on User-Agent string parsing
Integrates with existing HTTP clients
Follows modern web standards for device detection
Suitable for
Developers needing accurate device info
Apps requiring adaptive UI/UX
Projects focused on privacy and compliance
Web and mobile hybrid applications
Content delivery optimization
Considerations
Requires compatible server-side support
Limited to devices that expose client hints
Not all browsers fully support client hints
May require additional server configuration
Depends on underlying platform capabilities
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
List of browser brands and their significant version.
UA-Mobile
Sec-CH-UA-Mobile
?1
Boolean indicating if the browser is on a mobile device (?1 for true) or not (?0 for false).
UA-Full-Version
Sec-CH-UA-Full-Version
"84.0.4143.2"
The complete version for the browser.
UA-Platform
Sec-CH-UA-Platform
"Android"
The platform for the device, usually the operating system (OS).
UA-Platform-Version
Sec-CH-UA-Platform-Version
"10"
The version for the platform or OS.
UA-Arch
Sec-CH-UA-Arch
"ARM64"
The underlying architecture for the device. While this may not be relevant to displaying the page, the site may want to offer a download which defaults to the right format.
Add this to your package's pubspec.yaml file by running the following command
$ flutter pub add ua_client_hints
Usage
Supported platforms:
Android
iOS
macOS
Web
On Web, values depend on browser support for User-Agent Client Hints. Some fields such as architecture, model, or platformVersion can be empty on browsers that don't expose high-entropy hints.